core/crypto: Expose the block sizes for every hash algorithm

While I just went and made this private, this information is required
for keying HMAC.
This commit is contained in:
Yawning Angel
2024-02-07 00:37:18 +09:00
parent bc160d2eb7
commit 7a8b1669b0
11 changed files with 100 additions and 42 deletions
+4 -4
View File
@@ -22,9 +22,12 @@ import "core:encoding/endian"
import "core:math/bits"
import "core:mem"
// DIGEST_SIZE is the MD5 digest size.
// DIGEST_SIZE is the MD5 digest size in bytes.
DIGEST_SIZE :: 16
// BLOCK_SIZE is the MD5 block size in bytes.
BLOCK_SIZE :: 64
// Context is a MD5 instance.
Context :: struct {
data: [BLOCK_SIZE]byte,
@@ -131,9 +134,6 @@ reset :: proc(ctx: ^$T) {
MD5 implementation
*/
@(private)
BLOCK_SIZE :: 64
/*
@note(zh): F, G, H and I, as mentioned in the RFC, have been inlined into FF, GG, HH
and II respectively, instead of declaring them separately.