diff --git a/core/crypto/kmac/kmac.odin b/core/crypto/kmac/kmac.odin index f0c27739a..f09176edc 100644 --- a/core/crypto/kmac/kmac.odin +++ b/core/crypto/kmac/kmac.odin @@ -35,6 +35,10 @@ sum :: proc(sec_strength: int, dst, msg, key, domain_sep: []byte) { // strength, key and domain separator over msg and return true if and only if (⟺) the // tag is valid. verify :: proc(sec_strength: int, tag, msg, key, domain_sep: []byte, allocator := context.temp_allocator) -> bool { + if len(tag) < MIN_TAG_SIZE { + return false + } + derived_tag := make([]byte, len(tag), allocator) defer(delete(derived_tag))