Starting 128-bit FE implementation

This commit is contained in:
Sean Parkinson
2017-04-04 14:17:54 +10:00
parent ccad9f5575
commit 683a655908
2 changed files with 6 additions and 0 deletions

View File

@ -41,6 +41,9 @@
#include <wolfcrypt/src/misc.c> #include <wolfcrypt/src/misc.c>
#endif #endif
#ifdef FE_128BIT
#include "fe_x25519.c"
#else
/* /*
fe means field element. fe means field element.
Here the field is \Z/(2^255-19). Here the field is \Z/(2^255-19).
@ -1407,6 +1410,7 @@ void fe_cmov(fe f, const fe g, int b)
f[8] = f8 ^ x8; f[8] = f8 ^ x8;
f[9] = f9 ^ x9; f[9] = f9 ^ x9;
} }
#endif
#endif /* HAVE ED25519 or CURVE25519 */ #endif /* HAVE ED25519 or CURVE25519 */
#endif /* not defined CURVED25519_SMALL */ #endif /* not defined CURVED25519_SMALL */

View File

@ -43,6 +43,8 @@ Bounds on each t[i] vary depending on context.
#ifdef CURVED25519_SMALL #ifdef CURVED25519_SMALL
#define F25519_SIZE 32 #define F25519_SIZE 32
typedef byte fe[32]; typedef byte fe[32];
#elif defined(FE_128BIT)
typedef int64_t fe[5];
#else #else
typedef int32_t fe[10]; typedef int32_t fe[10];
#endif #endif