Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/BLAKE2/BLAKE2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'ref/blake2xb-ref.c')
-rw-r--r--ref/blake2xb-ref.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ref/blake2xb-ref.c b/ref/blake2xb-ref.c
index 6c69750..b84a138 100644
--- a/ref/blake2xb-ref.c
+++ b/ref/blake2xb-ref.c
@@ -30,7 +30,11 @@ int blake2xb_init( blake2xb_state *S, const size_t outlen, const void *key, size
return -1;
}
- if (NULL == key || keylen > BLAKE2B_KEYBYTES) {
+ if (NULL != key && keylen > BLAKE2B_KEYBYTES) {
+ return -1;
+ }
+
+ if (keylen > 0 && key == NULL) {
return -1;
}