More tests for constants

This commit is contained in:
Frank Denis
2014-09-13 14:47:29 -07:00
parent 12a3f27706
commit a92731a9f4
4 changed files with 23 additions and 2 deletions
+7
View File
@@ -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;
}
+6
View File
@@ -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;
}
+6 -2
View File
@@ -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;
}
+4
View File
@@ -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;
}