Throw some more mulmod52 implementations in there (but currently disabled) for future use so we do not have to hunt them down again.

This commit is contained in:
Adam Ierymenko 2020-02-26 11:31:03 -08:00
parent 83e79e1a1b
commit f20905b08a
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
2 changed files with 45 additions and 20 deletions

File diff suppressed because one or more lines are too long

View file

@ -876,6 +876,21 @@ extern "C" const char *ZTT_benchmarkCrypto()
ZT_T_PRINTF("%.4f MiB/sec" ZT_EOL_S,((16384.0 * 10000.0) / 1048576.0) / ((double)(end - start) / 1000.0));
}
{
ZT_T_PRINTF("[crypto] Benchmarking MIMC52 VDF delay... ");
int64_t start = now();
const uint64_t proof = mimc52Delay("testing",7,250000);
int64_t end = now();
int64_t dtime = end - start;
ZT_T_PRINTF("%.4f μs/round" ZT_EOL_S,((double)dtime * 1000.0) / 250000.0);
ZT_T_PRINTF("[crypto] Benchmarking MIMC52 VDF verify... ");
start = now();
foo = (uint8_t)mimc52Verify("testing",7,1000000,proof); // doesn't matter if return is true or false here
end = now();
int64_t vtime = end - start;
ZT_T_PRINTF("%.8f μs/round, %.4fX faster than delay" ZT_EOL_S,((double)vtime * 1000.0) / 1000000.0,(double)(dtime / 250000.0) / (double)(vtime / 1000000.0));
}
{
ZT_T_PRINTF("[crypto] Benchmarking AES-CTR... ");
AES aes(AES_CTR_TEST_VECTOR_0_KEY);
@ -999,21 +1014,6 @@ extern "C" const char *ZTT_benchmarkCrypto()
ZT_T_PRINTF("%.4f μs/verify" ZT_EOL_S,((double)(end - start) * 1000.0) / (double)(500 * ZT_NUM_C25519_TEST_VECTORS));
}
{
ZT_T_PRINTF("[crypto] Benchmarking MIMC52 VDF delay... ");
int64_t start = now();
const uint64_t proof = mimc52Delay("testing",7,250000);
int64_t end = now();
int64_t dtime = end - start;
ZT_T_PRINTF("%.4f μs/round" ZT_EOL_S,((double)dtime * 1000.0) / 250000.0);
ZT_T_PRINTF("[crypto] Benchmarking MIMC52 VDF verify... ");
start = now();
foo = (uint8_t)mimc52Verify("testing",7,1000000,proof); // doesn't matter if return is true or false here
end = now();
int64_t vtime = end - start;
ZT_T_PRINTF("%.8f μs/round, %.4fX faster than delay" ZT_EOL_S,((double)vtime * 1000.0) / 1000000.0,(double)(dtime / 250000.0) / (double)(vtime / 1000000.0));
}
{
ZT_T_PRINTF("[crypto] Benchmarking V0 Identity generation... ");
Identity id;