1#ifndef FE_H
2#define FE_H
3
4#include "crypto_int32.h"
5
6typedef crypto_int32 fe[10];
7
8/*
9fe means field element.
10Here the field is \Z/(2^255-19).
11An element t, entries t[0]...t[9], represents the integer
12t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9].
13Bounds on each t[i] vary depending on context.
14*/
15
16#define fe_frombytes crypto_sign_ed25519_ref10_fe_frombytes
17#define fe_tobytes crypto_sign_ed25519_ref10_fe_tobytes
18#define fe_copy crypto_sign_ed25519_ref10_fe_copy
19#define fe_isnonzero crypto_sign_ed25519_ref10_fe_isnonzero
20#define fe_isnegative crypto_sign_ed25519_ref10_fe_isnegative
21#define fe_0 crypto_sign_ed25519_ref10_fe_0
22#define fe_1 crypto_sign_ed25519_ref10_fe_1
23#define fe_cswap crypto_sign_ed25519_ref10_fe_cswap
24#define fe_cmov crypto_sign_ed25519_ref10_fe_cmov
25#define fe_add crypto_sign_ed25519_ref10_fe_add
26#define fe_sub crypto_sign_ed25519_ref10_fe_sub
27#define fe_neg crypto_sign_ed25519_ref10_fe_neg
28#define fe_mul crypto_sign_ed25519_ref10_fe_mul
29#define fe_sq crypto_sign_ed25519_ref10_fe_sq
30#define fe_sq2 crypto_sign_ed25519_ref10_fe_sq2
31#define fe_mul121666 crypto_sign_ed25519_ref10_fe_mul121666
32#define fe_invert crypto_sign_ed25519_ref10_fe_invert
33#define fe_pow22523 crypto_sign_ed25519_ref10_fe_pow22523
34
35extern void fe_frombytes(fe,const unsigned char *);
36extern void fe_tobytes(unsigned char *,const fe);
37
38extern void fe_copy(fe,const fe);
39extern int fe_isnonzero(const fe);
40extern int fe_isnegative(const fe);
41extern void fe_0(fe);
42extern void fe_1(fe);
43extern void fe_cswap(fe,fe,unsigned int);
44extern void fe_cmov(fe,const fe,unsigned int);
45
46extern void fe_add(fe,const fe,const fe);
47extern void fe_sub(fe,const fe,const fe);
48extern void fe_neg(fe,const fe);
49extern void fe_mul(fe,const fe,const fe);
50extern void fe_sq(fe,const fe);
51extern void fe_sq2(fe,const fe);
52extern void fe_mul121666(fe,const fe);
53extern void fe_invert(fe,const fe);
54extern void fe_pow22523(fe,const fe);
55
56#endif
57