Skip to content
Snippets Groups Projects
Commit 2f9ef8fc authored by akwizgran's avatar akwizgran
Browse files

Log the running time of ECDH shared secret derivation.

parent c028728c
No related branches found
No related tags found
No related merge requests found
......@@ -234,9 +234,14 @@ class CryptoComponentImpl implements CryptoComponent {
throw new IllegalArgumentException();
ECPrivateKeyParameters ecPriv = ((Sec1PrivateKey) priv).getKey();
ECPublicKeyParameters ecPub = ((Sec1PublicKey) pub).getKey();
long now = System.currentTimeMillis();
ECDHCBasicAgreement agreement = new ECDHCBasicAgreement();
agreement.init(ecPriv);
return agreement.calculateAgreement(ecPub).toByteArray();
byte[] secret = agreement.calculateAgreement(ecPub).toByteArray();
long duration = System.currentTimeMillis() - now;
if(LOG.isLoggable(INFO))
LOG.info("Deriving shared secret took " + duration + " ms");
return secret;
}
public byte[] deriveGroupSalt(byte[] secret) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment