From fce215716851606f7578a73f34eecd7bcb420d2a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 22 Jan 2015 21:45:41 +0100 Subject: 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. --- src/protocols/ec25519_fhmqvc/handshake.c | 4 ++-- 1 file 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); -- cgit v1.2.3