Remove these useless #define

This commit is contained in:
Frank Denis 2017-11-06 11:42:02 +01:00
parent 1e57b1d455
commit 55a6b6bb46

View File

@ -9,41 +9,26 @@
Here the field is \Z/(2^255-19). Here the field is \Z/(2^255-19).
*/ */
#define fe crypto_core_curve25519_ref10_fe
#ifdef HAVE_TI_MODE #ifdef HAVE_TI_MODE
typedef uint64_t fe[5]; typedef uint64_t fe[5];
#else #else
typedef int32_t fe[10]; typedef int32_t fe[10];
#endif #endif
#define fe_frombytes crypto_core_curve25519_ref10_fe_frombytes void fe_frombytes(fe,const unsigned char *);
#define fe_tobytes crypto_core_curve25519_ref10_fe_tobytes void fe_tobytes(unsigned char *,const fe);
#define fe_copy crypto_core_curve25519_ref10_fe_copy
#define fe_iszero crypto_core_curve25519_ref10_fe_iszero
#define fe_0 crypto_core_curve25519_ref10_fe_0
#define fe_1 crypto_core_curve25519_ref10_fe_1
#define fe_add crypto_core_curve25519_ref10_fe_add
#define fe_sub crypto_core_curve25519_ref10_fe_sub
#define fe_mul crypto_core_curve25519_ref10_fe_mul
#define fe_sq crypto_core_curve25519_ref10_fe_sq
#define fe_invert crypto_core_curve25519_ref10_fe_invert
#define fe_cswap crypto_core_curve25519_fe_cswap
#define fe_scalar_product crypto_core_curve25519_fe_scalar_product
extern void fe_frombytes(fe,const unsigned char *); void fe_copy(fe,const fe);
extern void fe_tobytes(unsigned char *,const fe); int fe_iszero(const fe);
void fe_0(fe);
extern void fe_copy(fe,const fe); void fe_1(fe);
extern int fe_iszero(const fe); void fe_add(fe,const fe,const fe);
extern void fe_0(fe); void fe_sub(fe,const fe,const fe);
extern void fe_1(fe); void fe_mul(fe,const fe,const fe);
extern void fe_add(fe,const fe,const fe); void fe_sq(fe,const fe);
extern void fe_sub(fe,const fe,const fe); void fe_invert(fe,const fe);
extern void fe_mul(fe,const fe,const fe); void fe_cswap(fe f, fe g, unsigned int b);
extern void fe_sq(fe,const fe); void fe_scalar_product(fe h, const fe f, uint32_t n);
extern void fe_invert(fe,const fe);
extern void fe_cswap(fe f, fe g, unsigned int b);
extern void fe_scalar_product(fe h, const fe f, uint32_t n);
/* /*
ge means group element. ge means group element.
@ -59,14 +44,12 @@ extern void fe_scalar_product(fe h, const fe f, uint32_t n);
ge_precomp (Duif): (y+x,y-x,2dxy) ge_precomp (Duif): (y+x,y-x,2dxy)
*/ */
#define ge_p2 crypto_core_curve25519_ref10_ge_p2
typedef struct { typedef struct {
fe X; fe X;
fe Y; fe Y;
fe Z; fe Z;
} ge_p2; } ge_p2;
#define ge_p3 crypto_core_curve25519_ref10_ge_p3
typedef struct { typedef struct {
fe X; fe X;
fe Y; fe Y;
@ -74,7 +57,6 @@ typedef struct {
fe T; fe T;
} ge_p3; } ge_p3;
#define ge_p1p1 crypto_core_curve25519_ref10_ge_p1p1
typedef struct { typedef struct {
fe X; fe X;
fe Y; fe Y;
@ -82,14 +64,12 @@ typedef struct {
fe T; fe T;
} ge_p1p1; } ge_p1p1;
#define ge_precomp crypto_core_curve25519_ref10_ge_precomp
typedef struct { typedef struct {
fe yplusx; fe yplusx;
fe yminusx; fe yminusx;
fe xy2d; fe xy2d;
} ge_precomp; } ge_precomp;
#define ge_cached crypto_core_curve25519_ref10_ge_cached
typedef struct { typedef struct {
fe YplusX; fe YplusX;
fe YminusX; fe YminusX;
@ -97,53 +77,31 @@ typedef struct {
fe T2d; fe T2d;
} ge_cached; } ge_cached;
#define ge_frombytes_negate_vartime crypto_core_curve25519_ref10_ge_frombytes_negate_vartime void ge_tobytes(unsigned char *,const ge_p2 *);
#define ge_frombytes crypto_core_curve25519_ref10_ge_frombytes void ge_p3_tobytes(unsigned char *,const ge_p3 *);
#define ge_tobytes crypto_core_curve25519_ref10_ge_tobytes int ge_frombytes(ge_p3 *,const unsigned char *);
#define ge_p3_tobytes crypto_core_curve25519_ref10_ge_p3_tobytes int ge_frombytes_negate_vartime(ge_p3 *,const unsigned char *);
#define ge_p3_to_cached crypto_core_curve25519_ref10_ge_p3_to_cached void ge_p3_to_cached(ge_cached *,const ge_p3 *);
#define ge_p1p1_to_p2 crypto_core_curve25519_ref10_ge_p1p1_to_p2 void ge_p1p1_to_p2(ge_p2 *,const ge_p1p1 *);
#define ge_add crypto_core_curve25519_ref10_ge_add void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *);
#define ge_scalarmult crypto_core_curve25519_ref10_ge_scalarmult void ge_scalarmult_base(ge_p3 *,const unsigned char *);
#define ge_scalarmult_base crypto_core_curve25519_ref10_ge_scalarmult_base void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *);
#define ge_double_scalarmult_vartime crypto_core_curve25519_ref10_ge_double_scalarmult_vartime void ge_scalarmult(ge_p3 *,const unsigned char *,const ge_p3 *);
#define ge_scalarmult_vartime crypto_core_curve25519_ref10_ge_scalarmult_vartime void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *);
#define ge_is_canonical crypto_core_curve25519_ref10_ge_is_canonical int ge_is_canonical(const unsigned char *s);
#define ge_is_on_curve crypto_core_curve25519_ref10_ge_is_on_curve int ge_is_on_curve(const ge_p3 *p);
#define ge_is_on_main_subgroup crypto_core_curve25519_ref10_ge_is_on_main_subgroup int ge_is_on_main_subgroup(const ge_p3 *p);
#define ge_has_small_order crypto_core_curve25519_ref10_ge_has_small_order int ge_has_small_order(const unsigned char s[32]);
extern void ge_tobytes(unsigned char *,const ge_p2 *);
extern void ge_p3_tobytes(unsigned char *,const ge_p3 *);
extern int ge_frombytes(ge_p3 *,const unsigned char *);
extern int ge_frombytes_negate_vartime(ge_p3 *,const unsigned char *);
extern void ge_p3_to_cached(ge_cached *,const ge_p3 *);
extern void ge_p1p1_to_p2(ge_p2 *,const ge_p1p1 *);
extern void ge_add(ge_p1p1 *,const ge_p3 *,const ge_cached *);
extern void ge_scalarmult_base(ge_p3 *,const unsigned char *);
extern void ge_double_scalarmult_vartime(ge_p2 *,const unsigned char *,const ge_p3 *,const unsigned char *);
extern void ge_scalarmult(ge_p3 *,const unsigned char *,const ge_p3 *);
extern void ge_scalarmult_vartime(ge_p3 *,const unsigned char *,const ge_p3 *);
extern int ge_is_canonical(const unsigned char *s);
extern int ge_is_on_curve(const ge_p3 *p);
extern int ge_is_on_main_subgroup(const ge_p3 *p);
extern int ge_has_small_order(const unsigned char s[32]);
/* /*
The set of scalars is \Z/l The set of scalars is \Z/l
where l = 2^252 + 27742317777372353535851937790883648493. where l = 2^252 + 27742317777372353535851937790883648493.
*/ */
#define sc_reduce crypto_core_curve25519_ref10_sc_reduce void sc_reduce(unsigned char *);
#define sc_muladd crypto_core_curve25519_ref10_sc_muladd void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
#define sc_is_canonical crypto_core_curve25519_ref10_sc_is_canonical int sc_is_canonical(const unsigned char *s);
extern void sc_reduce(unsigned char *);
extern void sc_muladd(unsigned char *,const unsigned char *,const unsigned char *,const unsigned char *);
extern int sc_is_canonical(const unsigned char *s);
#endif #endif