diff options
Diffstat (limited to 'ref/blake2xs-ref.c')
-rw-r--r-- | ref/blake2xs-ref.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ref/blake2xs-ref.c b/ref/blake2xs-ref.c index 58cc684..133f240 100644 --- a/ref/blake2xs-ref.c +++ b/ref/blake2xs-ref.c @@ -30,7 +30,11 @@ int blake2xs_init( blake2xs_state *S, const size_t outlen, const void *key, size return -1; } - if (NULL == key || keylen > BLAKE2S_KEYBYTES) { + if (NULL != key && keylen > BLAKE2B_KEYBYTES) { + return -1; + } + + if (keylen > 0 && key == NULL) { return -1; } @@ -181,7 +185,6 @@ int main( void ) uint8_t hash[BLAKE2_KAT_LENGTH] = {0}; blake2xs( hash, outlen, buf, BLAKE2_KAT_LENGTH, key, BLAKE2S_KEYBYTES ); - if( 0 != memcmp( hash, blake2xs_keyed_kat[outlen-1], outlen ) ) { goto fail; |