mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-24 12:36:01 -07:00
More tests for constants
This commit is contained in:
parent
2645422a32
commit
d65c791e58
@ -27,5 +27,11 @@ int main(void)
|
||||
printf("0x%02x",(unsigned int) firstkey[i]);
|
||||
if (i % 8 == 7) printf("\n");
|
||||
}
|
||||
|
||||
assert(crypto_core_hsalsa20_outputbytes() > 0U);
|
||||
assert(crypto_core_hsalsa20_inputbytes() > 0U);
|
||||
assert(crypto_core_hsalsa20_keybytes() > 0U);
|
||||
assert(crypto_core_hsalsa20_constbytes() > 0U);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -32,6 +32,14 @@ int main(void)
|
||||
assert(crypto_generichash_keybytes() >= crypto_generichash_keybytes_min());
|
||||
assert(crypto_generichash_keybytes() <= crypto_generichash_keybytes_max());
|
||||
assert(strcmp(crypto_generichash_primitive(), "blake2b") == 0);
|
||||
assert(crypto_generichash_bytes_min() == crypto_generichash_blake2b_bytes_min());
|
||||
assert(crypto_generichash_bytes_max() == crypto_generichash_blake2b_bytes_max());
|
||||
assert(crypto_generichash_bytes() == crypto_generichash_blake2b_bytes());
|
||||
assert(crypto_generichash_keybytes_min() == crypto_generichash_blake2b_keybytes_min());
|
||||
assert(crypto_generichash_keybytes_max() == crypto_generichash_blake2b_keybytes_max());
|
||||
assert(crypto_generichash_keybytes() == crypto_generichash_blake2b_keybytes());
|
||||
assert(crypto_generichash_blake2b_saltbytes() > 0U);
|
||||
assert(crypto_generichash_blake2b_personalbytes() > 0U);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -53,5 +53,18 @@ int main(void)
|
||||
if (i % 8 == 7) printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
assert(crypto_secretbox_keybytes() > 0U);
|
||||
assert(crypto_secretbox_noncebytes() > 0U);
|
||||
assert(crypto_secretbox_zerobytes() > 0U);
|
||||
assert(crypto_secretbox_boxzerobytes() > 0U);
|
||||
assert(crypto_secretbox_macbytes() > 0U);
|
||||
assert(strcmp(crypto_secretbox_primitive(), "xsalsa20poly1305") == 0);
|
||||
assert(crypto_secretbox_keybytes() == crypto_secretbox_xsalsa20poly1305_keybytes());
|
||||
assert(crypto_secretbox_noncebytes() == crypto_secretbox_xsalsa20poly1305_noncebytes());
|
||||
assert(crypto_secretbox_zerobytes() == crypto_secretbox_xsalsa20poly1305_zerobytes());
|
||||
assert(crypto_secretbox_boxzerobytes() == crypto_secretbox_xsalsa20poly1305_boxzerobytes());
|
||||
assert(crypto_secretbox_macbytes() == crypto_secretbox_xsalsa20poly1305_macbytes());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -25,5 +25,12 @@ int main(void)
|
||||
crypto_stream(output,4194304,nonce,firstkey);
|
||||
crypto_hash_sha256(h,output,sizeof output);
|
||||
for (i = 0;i < 32;++i) printf("%02x",h[i]); printf("\n");
|
||||
|
||||
assert(crypto_stream_keybytes() > 0U);
|
||||
assert(crypto_stream_noncebytes() > 0U);
|
||||
assert(strcmp(crypto_stream_primitive(), "xsalsa20") == 0);
|
||||
assert(crypto_stream_keybytes() == crypto_stream_xsalsa20_keybytes());
|
||||
assert(crypto_stream_noncebytes() == crypto_stream_xsalsa20_noncebytes());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user