some tweaks
[mkp224o.git] / ed25519 / amd64-51-30k / fe25519.h
blob8a16cd833e7635242181969a1820f43d570f6cf3
1 #ifndef FE25519_H
2 #define FE25519_H
4 #include <stddef.h>
6 #define fe25519 crypto_sign_ed25519_amd64_51_30k_batch_fe25519
7 #define fe25519_freeze crypto_sign_ed25519_amd64_51_30k_batch_fe25519_freeze
8 #define fe25519_unpack crypto_sign_ed25519_amd64_51_30k_batch_fe25519_unpack
9 #define fe25519_pack crypto_sign_ed25519_amd64_51_30k_batch_fe25519_pack
10 #define fe25519_iszero_vartime crypto_sign_ed25519_amd64_51_30k_batch_fe25519_iszero_vartime
11 #define fe25519_iseq_vartime crypto_sign_ed25519_amd64_51_30k_batch_fe25519_iseq_vartime
12 #define fe25519_cmov crypto_sign_ed25519_amd64_51_30k_batch_fe25519_cmov
13 #define fe25519_setint crypto_sign_ed25519_amd64_51_30k_batch_fe25519_setint
14 #define fe25519_neg crypto_sign_ed25519_amd64_51_30k_batch_fe25519_neg
15 #define fe25519_getparity crypto_sign_ed25519_amd64_51_30k_batch_fe25519_getparity
16 #define fe25519_add crypto_sign_ed25519_amd64_51_30k_batch_fe25519_add
17 #define fe25519_sub crypto_sign_ed25519_amd64_51_30k_batch_fe25519_sub
18 #define fe25519_mul crypto_sign_ed25519_amd64_51_30k_batch_fe25519_mul
19 #define fe25519_mul121666 crypto_sign_ed25519_amd64_51_30k_batch_fe25519_mul121666
20 #define fe25519_square crypto_sign_ed25519_amd64_51_30k_batch_fe25519_square
21 #define fe25519_nsquare crypto_sign_ed25519_amd64_51_30k_batch_fe25519_nsquare
22 #define fe25519_invert crypto_sign_ed25519_amd64_51_30k_batch_fe25519_invert
23 #define fe25519_pow2523 crypto_sign_ed25519_amd64_51_30k_batch_fe25519_pow2523
25 typedef struct
27 unsigned long long v[5];
29 fe25519;
31 void fe25519_freeze(fe25519 *r);
33 void fe25519_unpack(fe25519 *r, const unsigned char x[32]);
35 void fe25519_pack(unsigned char r[32], const fe25519 *x);
37 void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b);
39 void fe25519_cswap(fe25519 *r, fe25519 *x, unsigned char b);
41 void fe25519_setint(fe25519 *r, unsigned int v);
43 void fe25519_neg(fe25519 *r, const fe25519 *x);
45 unsigned char fe25519_getparity(const fe25519 *x);
47 int fe25519_iszero_vartime(const fe25519 *x);
49 int fe25519_iseq_vartime(const fe25519 *x, const fe25519 *y);
51 void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y);
53 void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y);
55 void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y);
57 void fe25519_mul121666(fe25519 *r, const fe25519 *x);
59 void fe25519_square(fe25519 *r, const fe25519 *x);
61 void fe25519_nsquare(fe25519 *r, unsigned long long n);
63 void fe25519_invert(fe25519 *r, const fe25519 *x);
65 void fe25519_batchinvert(fe25519 *out[],fe25519 tmp[],fe25519 * const in[], size_t num);
67 void fe25519_pow2523(fe25519 *r, const fe25519 *x);
69 #endif