forked from wolfSSL/wolfssl
Starting 128-bit FE implementation
This commit is contained in:
@ -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 */
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user