mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 23:28:48 +00:00
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:
@@ -18,9 +18,12 @@ import "core:encoding/endian"
|
||||
import "core:math/bits"
|
||||
import "core:mem"
|
||||
|
||||
// DIGEST_SIZE is the SM3 digest size.
|
||||
// DIGEST_SIZE is the SM3 digest size in bytes.
|
||||
DIGEST_SIZE :: 32
|
||||
|
||||
// BLOCK_SIZE is the SM3 block size in bytes.
|
||||
BLOCK_SIZE :: 64
|
||||
|
||||
// Context is a SM3 instance.
|
||||
Context :: struct {
|
||||
state: [8]u32,
|
||||
@@ -133,9 +136,6 @@ reset :: proc(ctx: ^Context) {
|
||||
SM3 implementation
|
||||
*/
|
||||
|
||||
@(private)
|
||||
BLOCK_SIZE :: 64
|
||||
|
||||
@(private)
|
||||
IV := [8]u32 {
|
||||
0x7380166f, 0x4914b2b9, 0x172442d7, 0xda8a0600,
|
||||
|
||||
Reference in New Issue
Block a user