mirror of
https://github.com/odin-lang/Odin.git
synced 2026-08-15 10:09:15 +00:00
core/crypto/kmac: Early reject pathologically short tags in verify
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user