X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=crypto%2Fref10%2Ffe.h;fp=crypto%2Fref10%2Ffe.h;h=eaa5e666d1032bc93ad4826bd51602d0b68e8991;hb=66bc25938679f1d6a1d1200f329093d82a5e99b4;hp=0000000000000000000000000000000000000000;hpb=a52ee0733f420ca20224049260d6fc5cf7d8f621;p=zpackage diff --git a/crypto/ref10/fe.h b/crypto/ref10/fe.h new file mode 100644 index 0000000..eaa5e66 --- /dev/null +++ b/crypto/ref10/fe.h @@ -0,0 +1,30 @@ +#ifndef FE_H +#define FE_H + +#include + +/* +fe means field element. +Here the field is \Z/(2^255-19). +An element t, entries t[0]...t[9], represents the integer +t[0]+2^26 t[1]+2^51 t[2]+2^77 t[3]+2^102 t[4]+...+2^230 t[9]. +Bounds on each t[i] vary depending on context. +*/ +int x25519(unsigned char *q, const unsigned char *n, const unsigned char *p); + +void fe_frombytes(int32_t fe[10], const unsigned char *); +void fe_tobytes(unsigned char *, int32_t fe[10]); + +void fe_copy(int32_t dest[10], int32_t src[10]); +void fe_0(int32_t fe[10]); +void fe_1(int32_t fe[10]); +void fe_cswap(int32_t a[10], int32_t b[10], unsigned int); + +void fe_add(int32_t dest[10], int32_t a[10], int32_t b[10]); +void fe_sub(int32_t dest[10], int32_t a[10], int32_t b[10]); +void fe_mul(int32_t dest[10], int32_t a[10], int32_t b[10]); +void fe_sq(int32_t dest[10], int32_t a[10]); +void fe_mul121666(int32_t dest[10], int32_t a[10]); +void fe_invert(int32_t dest[10], int32_t a[10]); + +#endif