summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2015-01-22 21:45:41 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2015-01-22 21:45:41 +0100
commitfce215716851606f7578a73f34eecd7bcb420d2a (patch)
treecd2159a58e61941f7192710a8305fca40388088a
parentdc48b2309295c5209abd8e20bf18ee2805296fbb (diff)
downloadfastd-fce215716851606f7578a73f34eecd7bcb420d2a.tar
fastd-fce215716851606f7578a73f34eecd7bcb420d2a.zip
ec25519-fhmqvc: use reduced-bitlength scalar multiplication
The values d and e will only use 128bits, so speed up the scalar multiplication by using the new reduced-bitlength scalar multiplication functions. This change requires the current development version of libuecc.
-rw-r--r--src/protocols/ec25519_fhmqvc/handshake.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/ec25519_fhmqvc/handshake.c b/src/protocols/ec25519_fhmqvc/handshake.c
index 8e3c67a..6b4d735 100644
--- a/src/protocols/ec25519_fhmqvc/handshake.c
+++ b/src/protocols/ec25519_fhmqvc/handshake.c
@@ -224,14 +224,14 @@ static bool make_shared_handshake_key(bool initiator, const keypair_t *handshake
ecc_25519_gf_mult(&da, &d, &conf.protocol_config->key.secret);
ecc_25519_gf_add(&s, &da, &handshake_key->secret);
- ecc_25519_scalarmult(&work, &e, &peer_key->unpacked);
+ ecc_25519_scalarmult_bits(&work, &e, &peer_key->unpacked, 128);
}
else {
ecc_int256_t eb;
ecc_25519_gf_mult(&eb, &e, &conf.protocol_config->key.secret);
ecc_25519_gf_add(&s, &eb, &handshake_key->secret);
- ecc_25519_scalarmult(&work, &d, &peer_key->unpacked);
+ ecc_25519_scalarmult_bits(&work, &d, &peer_key->unpacked, 128);
}
ecc_25519_add(&work, &workXY, &work);