From f11b14362b05f5965b0d1e6b9af1c48945884b9e Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 9 Jan 2015 11:55:07 +0100 Subject: ec25519-fhmqvc: unpack peers' keys only once --- src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h') diff --git a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h index 087cf35..8dd8456 100644 --- a/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h +++ b/src/protocols/ec25519_fhmqvc/ec25519_fhmqvc.h @@ -56,7 +56,7 @@ typedef union aligned_int256 { /** A keypair */ typedef struct keypair { - ecc_int256_t secret; /**< The section key */ + ecc_int256_t secret; /**< The secret key */ aligned_int256_t public; /**< The public key */ } keypair_t; @@ -68,8 +68,10 @@ struct fastd_protocol_config { /** A peer's public key */ struct fastd_protocol_key { aligned_int256_t key; /**< The peer's public key */ + ecc_25519_work_t unpacked; /**< The peer's public key (unpacked) */ }; + /** Session state */ typedef struct protocol_session { /** @@ -119,8 +121,7 @@ fastd_peer_t * fastd_protocol_ec25519_fhmqvc_find_peer(const fastd_protocol_key_ void fastd_protocol_ec25519_fhmqvc_generate_key(void); void fastd_protocol_ec25519_fhmqvc_show_key(void); - -bool fastd_protocol_ec25519_fhmqvc_check_key(const ecc_int256_t *key); +bool fastd_protocol_ec25519_fhmqvc_check_key(const ecc_25519_work_t *key); void fastd_protocol_ec25519_fhmqvc_set_shell_env(fastd_shell_env_t *env, const fastd_peer_t *peer); bool fastd_protocol_ec25519_fhmqvc_describe_peer(const fastd_peer_t *peer, char *buf, size_t len); -- cgit v1.2.3