mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-29 21:27:13 +09:00
More tests for constants
This commit is contained in:
@@ -20,5 +20,12 @@ int main(void)
|
||||
printf("0x%02x",(unsigned int) alicepk[i]);
|
||||
if (i % 8 == 7) printf("\n");
|
||||
}
|
||||
assert(crypto_scalarmult_bytes() > 0U);
|
||||
assert(crypto_scalarmult_scalarbytes() > 0U);
|
||||
assert(strcmp(crypto_scalarmult_primitive(), "curve25519") == 0);
|
||||
assert(crypto_scalarmult_bytes() == crypto_scalarmult_curve25519_bytes());
|
||||
assert(crypto_scalarmult_scalarbytes() == crypto_scalarmult_curve25519_scalarbytes());
|
||||
assert(crypto_scalarmult_bytes() == crypto_scalarmult_scalarbytes());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -16,5 +16,11 @@ int main(void)
|
||||
for (j = 0;j < crypto_shorthash_BYTES;++j) printf("%02x",(unsigned int) out[j]);
|
||||
printf("\n");
|
||||
}
|
||||
assert(crypto_shorthash_bytes() > 0);
|
||||
assert(crypto_shorthash_keybytes() > 0);
|
||||
assert(strcmp(crypto_shorthash_primitive(), "siphash24") == 0);
|
||||
assert(crypto_shorthash_bytes() == crypto_shorthash_siphash24_bytes());
|
||||
assert(crypto_shorthash_keybytes() == crypto_shorthash_siphash24_keybytes());
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
int main(void)
|
||||
{
|
||||
printf ("%d\n", sodium_init());
|
||||
printf ("%d\n", sodium_init());
|
||||
|
||||
return 0;
|
||||
(void) sodium_runtime_has_neon();
|
||||
(void) sodium_runtime_has_sse2();
|
||||
(void) sodium_runtime_has_sse3();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,5 +28,9 @@ int main(void)
|
||||
printf("%d\n", crypto_verify_32(v32, v32x));
|
||||
printf("%d\n", crypto_verify_64(v64, v64x));
|
||||
|
||||
assert(crypto_verify_16_bytes() == 16U);
|
||||
assert(crypto_verify_32_bytes() == 32U);
|
||||
assert(crypto_verify_64_bytes() == 64U);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user