diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-01-22 21:45:41 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2015-01-22 21:45:41 +0100 |
commit | fce215716851606f7578a73f34eecd7bcb420d2a (patch) | |
tree | cd2159a58e61941f7192710a8305fca40388088a /src/protocols/ec25519_fhmqvc | |
parent | dc48b2309295c5209abd8e20bf18ee2805296fbb (diff) | |
download | fastd-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.
Diffstat (limited to 'src/protocols/ec25519_fhmqvc')
-rw-r--r-- | src/protocols/ec25519_fhmqvc/handshake.c | 4 |
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); |