mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-28 22:21:15 -07:00
Additional tests for BLAKE2b
This commit is contained in:
parent
7a08f643bf
commit
71a548ac10
@ -1366,6 +1366,17 @@ main(void)
|
|||||||
printf("%02x", (unsigned int) out[j]);
|
printf("%02x", (unsigned int) out[j]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
assert(crypto_generichash(NULL, 0,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, sizeof k) == -1);
|
||||||
|
assert(crypto_generichash(NULL, crypto_generichash_BYTES_MAX + 1,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, sizeof k) == -1);
|
||||||
|
assert(crypto_generichash(NULL, (unsigned long long) sizeof in,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, crypto_generichash_KEYBYTES_MAX + 1) == -1);
|
||||||
|
|
||||||
assert(crypto_generichash_bytes_min() > 0U);
|
assert(crypto_generichash_bytes_min() > 0U);
|
||||||
assert(crypto_generichash_bytes_max() > 0U);
|
assert(crypto_generichash_bytes_max() > 0U);
|
||||||
assert(crypto_generichash_bytes() > 0U);
|
assert(crypto_generichash_bytes() > 0U);
|
||||||
|
@ -130,6 +130,19 @@ main(void)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
assert(crypto_generichash_blake2b_salt_personal
|
||||||
|
(NULL, 0,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, sizeof k, NULL, NULL) == -1);
|
||||||
|
assert(crypto_generichash_blake2b_salt_personal
|
||||||
|
(NULL, crypto_generichash_BYTES_MAX + 1,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, sizeof k, NULL, NULL) == -1);
|
||||||
|
assert(crypto_generichash_blake2b_salt_personal
|
||||||
|
(NULL, (unsigned long long) sizeof in,
|
||||||
|
in, (unsigned long long) sizeof in,
|
||||||
|
k, crypto_generichash_KEYBYTES_MAX + 1, NULL, NULL) == -1);
|
||||||
|
|
||||||
crypto_generichash_blake2b_init_salt_personal(&st, NULL, 0U, crypto_generichash_BYTES,
|
crypto_generichash_blake2b_init_salt_personal(&st, NULL, 0U, crypto_generichash_BYTES,
|
||||||
NULL, personal);
|
NULL, personal);
|
||||||
crypto_generichash_blake2b_update(&st, in, MAXLEN);
|
crypto_generichash_blake2b_update(&st, in, MAXLEN);
|
||||||
@ -148,6 +161,13 @@ main(void)
|
|||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
|
assert(crypto_generichash_blake2b_init_salt_personal
|
||||||
|
(&st, k, sizeof k, 0, NULL, NULL) == -1);
|
||||||
|
assert(crypto_generichash_blake2b_init_salt_personal
|
||||||
|
(&st, k, sizeof k, crypto_generichash_blake2b_BYTES_MAX + 1, NULL, NULL) == -1);
|
||||||
|
assert(crypto_generichash_blake2b_init_salt_personal
|
||||||
|
(&st, k, crypto_generichash_blake2b_KEYBYTES_MAX + 1, sizeof out, NULL, NULL) == -1);
|
||||||
|
|
||||||
assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
|
assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
|
||||||
NULL, personal) == 0);
|
NULL, personal) == 0);
|
||||||
assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
|
assert(crypto_generichash_blake2b_init_salt_personal(&st, k, sizeof k, crypto_generichash_BYTES,
|
||||||
|
Loading…
Reference in New Issue
Block a user