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:
1 parent
bc160d2eb7
commit
7a8b1669b0
11 files changed
+100
-42
No files matched your search
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user