MCPcopy Create free account
hub / github.com/assaultcube/AC / ed25519speedtest

Function ed25519speedtest

source/src/crypto.cpp:692–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690COMMAND(ed25519test, "s");
691
692void ed25519speedtest() // check speed of ed25519 functions
693{
694 uchar priv[32], pub[32], msg[64], smsg[128], sk[64];
695 entropy_get(priv, 32);
696 entropy_get(msg, 32);
697 stopwatch watch;
698 watch.start();
699 loopi(200) ed25519_pubkey_from_private(pub, priv);
700 conoutf("create public key from private key: %.2f ms", watch.elapsed() / 200.0f);
701 memcpy(sk, priv, 32);
702 memcpy(sk + 32, pub, 32);
703 watch.start();
704 loopi(200) ed25519_sign(smsg, NULL, msg, 64, sk);
705 conoutf("signing 64-byte message: %.2f ms", watch.elapsed() / 200.0f);
706 watch.start();
707 loopi(200) ed25519_sign_check(smsg, 128, pub);
708 conoutf("verify signature of 64-byte message: %.2f ms", watch.elapsed() / 200.0f);
709}
710COMMAND(ed25519speedtest, "");
711#endif
712#endif

Callers

nothing calls this directly

Calls 8

entropy_getFunction · 0.85
ed25519_signFunction · 0.85
ed25519_sign_checkFunction · 0.85
elapsedMethod · 0.80
loopiFunction · 0.70
conoutfFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected