libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_sign / edwards25519sha512batch / ref / fe25519.h
blob98c613fab541e782d51f2034e9fe2830c48859fe
1 #ifndef FE25519_H
2 #define FE25519_H
4 #define fe25519 crypto_sign_edwards25519sha512batch_fe25519
5 #define fe25519_unpack crypto_sign_edwards25519sha512batch_fe25519_unpack
6 #define fe25519_pack crypto_sign_edwards25519sha512batch_fe25519_pack
7 #define fe25519_cmov crypto_sign_edwards25519sha512batch_fe25519_cmov
8 #define fe25519_setone crypto_sign_edwards25519sha512batch_fe25519_setone
9 #define fe25519_setzero crypto_sign_edwards25519sha512batch_fe25519_setzero
10 #define fe25519_neg crypto_sign_edwards25519sha512batch_fe25519_neg
11 #define fe25519_getparity crypto_sign_edwards25519sha512batch_fe25519_getparity
12 #define fe25519_add crypto_sign_edwards25519sha512batch_fe25519_add
13 #define fe25519_sub crypto_sign_edwards25519sha512batch_fe25519_sub
14 #define fe25519_mul crypto_sign_edwards25519sha512batch_fe25519_mul
15 #define fe25519_square crypto_sign_edwards25519sha512batch_fe25519_square
16 #define fe25519_pow crypto_sign_edwards25519sha512batch_fe25519_pow
17 #define fe25519_sqrt_vartime crypto_sign_edwards25519sha512batch_fe25519_sqrt_vartime
18 #define fe25519_invert crypto_sign_edwards25519sha512batch_fe25519_invert
20 #include "crypto_uint32.h"
22 typedef struct {
23 crypto_uint32 v[32];
24 } fe25519;
26 void fe25519_unpack(fe25519 *r, const unsigned char x[32]);
28 void fe25519_pack(unsigned char r[32], const fe25519 *x);
30 void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b);
32 void fe25519_setone(fe25519 *r);
34 void fe25519_setzero(fe25519 *r);
36 void fe25519_neg(fe25519 *r, const fe25519 *x);
38 unsigned char fe25519_getparity(const fe25519 *x);
40 void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y);
42 void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y);
44 void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y);
46 void fe25519_square(fe25519 *r, const fe25519 *x);
48 void fe25519_pow(fe25519 *r, const fe25519 *x, const unsigned char *e);
50 int fe25519_sqrt_vartime(fe25519 *r, const fe25519 *x, unsigned char parity);
52 void fe25519_invert(fe25519 *r, const fe25519 *x);
54 #endif