From 6c37af4a76a58f1b879d0c6df465cf01ae5f9e5d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 14 Mar 2012 04:15:02 +0100 Subject: More renames, added secret key arithmetic --- include/libuecc/ecc.h | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'include/libuecc/ecc.h') diff --git a/include/libuecc/ecc.h b/include/libuecc/ecc.h index a5f0df7..9cf2b1e 100644 --- a/include/libuecc/ecc.h +++ b/include/libuecc/ecc.h @@ -27,27 +27,31 @@ #ifndef _LIBUECC_ECC_H_ #define _LIBUECC_ECC_H_ -typedef struct _ec_public_key_256 { +typedef struct _ecc_public_key_256 { unsigned char p[32]; -} ec_public_key_256; +} ecc_public_key_256; -typedef struct _ec_secret_key_256 { +typedef struct _ecc_secret_key_256 { unsigned char s[32]; -} ec_secret_key_256; +} ecc_secret_key_256; -typedef struct _ec_25519_work { +typedef struct _ecc_25519_work { unsigned int X[32]; unsigned int Y[32]; unsigned int Z[32]; -} ec_25519_work; +} ecc_25519_work; -void ec_25519_load(ec_25519_work *out, const ec_public_key_256 *in); -void ec_25519_store(ec_public_key_256 *out, const ec_25519_work *in); +void ecc_25519_load(ecc_25519_work *out, const ecc_public_key_256 *in); +void ecc_25519_store(ecc_public_key_256 *out, const ecc_25519_work *in); -void ec_25519_add(ec_25519_work *out, const ec_25519_work *in1, const ec_25519_work *in2); -void ec_25519_double(ec_25519_work *out, const ec_25519_work *in); -void ec_25519_scalarmult(ec_25519_work *out, const ec_secret_key_256 *n, const ec_25519_work *base); -void ec_25519_scalarmult_base(ec_25519_work *out, const ec_secret_key_256 *n); +void ecc_25519_add_secret(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1, const ecc_secret_key_256 *in2); +void ecc_25519_sub_secret(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1, const ecc_secret_key_256 *in2); +void ecc_25519_mult_secret(ecc_secret_key_256 *out, const ecc_secret_key_256 *in1, const ecc_secret_key_256 *in2); + +void ecc_25519_add(ecc_25519_work *out, const ecc_25519_work *in1, const ecc_25519_work *in2); +void ecc_25519_double(ecc_25519_work *out, const ecc_25519_work *in); +void ecc_25519_scalarmult(ecc_25519_work *out, const ecc_secret_key_256 *n, const ecc_25519_work *base); +void ecc_25519_scalarmult_base(ecc_25519_work *out, const ecc_secret_key_256 *n); #endif /* _LIBUECC_ECC_H_ */ -- cgit v1.2.3