From 256e972b36623d24251f5c69d7c40bb5ab9d2a29 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 16 Oct 2015 23:07:34 +0200 Subject: Add Ed25519-compatible generator point The old point is renamed, as it isn't the only default point anymore. The old name and functions using the old point are deprecated now. --- include/libuecc/ecc.h | 44 ++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 40 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/libuecc/ecc.h b/include/libuecc/ecc.h index 98d756c..12f1d3e 100644 --- a/include/libuecc/ecc.h +++ b/include/libuecc/ecc.h @@ -27,6 +27,11 @@ #ifndef _LIBUECC_ECC_H_ #define _LIBUECC_ECC_H_ +#ifndef DEPRECATED +#define DEPRECATED __attribute__((deprecated)) +#endif + + #include @@ -61,8 +66,35 @@ typedef struct _ecc_25519_work { /** The identity element */ extern const ecc_25519_work_t ecc_25519_work_identity; -/** The ec25519 default base */ -extern const ecc_25519_work_t ecc_25519_work_default_base; + +/** + * The generator point used by Ed25519 + * + * \ref ecc_25519_work_base_ed25519 is the inverse of \ref ecc_25519_work_base_legacy + * + * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$. + **/ +extern const ecc_25519_work_t ecc_25519_work_base_ed25519; + +/** + * The ec25519 legacy generator point ("default base" till libuecc v5) + * + * In new software that doesn't need compablity with older libuecc releases, you should consider + * using \ref ecc_25519_work_base_ed25519 instead. + * + * \ref ecc_25519_work_base_legacy is the inverse of \ref ecc_25519_work_base_ed25519 + * + * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$. + */ +extern const ecc_25519_work_t ecc_25519_work_base_legacy; + + +/** + * The ec25519 legacy generator point (provided for API/ABI compatiblity with older releases of libuecc) + * + * \deprecated Use \ref ecc_25519_work_base_legacy instead. + */ +DEPRECATED extern const ecc_25519_work_t ecc_25519_work_default_base; @@ -143,15 +175,19 @@ void ecc_25519_scalarmult(ecc_25519_work_t *out, const ecc_int256_t *n, const ec * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$. * * See the notes about \ref ecc_25519_scalarmult_bits before using this function. + * + * \deprecated Use \ref ecc_25519_scalarmult_bits and explicitly specify the base point. */ -void ecc_25519_scalarmult_base_bits(ecc_25519_work_t *out, const ecc_int256_t *n, unsigned bits); +DEPRECATED void ecc_25519_scalarmult_base_bits(ecc_25519_work_t *out, const ecc_int256_t *n, unsigned bits); /** * Does a scalar multiplication of the default base point (generator element) of the Elliptic Curve with an integer * * The order of the base point is \f$ 2^{252} + 27742317777372353535851937790883648493 \f$. + * + * \deprecated Use \ref ecc_25519_scalarmult and explicitly specify the base point. */ -void ecc_25519_scalarmult_base(ecc_25519_work_t *out, const ecc_int256_t *n); +DEPRECATED void ecc_25519_scalarmult_base(ecc_25519_work_t *out, const ecc_int256_t *n); /**@}*/ -- cgit v1.2.3