libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_sign / ed25519 / ref10 / fe_isnegative.c
blob3b2c8b8d52366f4eefceb1cd4ab568561781af5b
1 #include "fe.h"
3 /*
4 return 1 if f is in {1,3,5,...,q-2}
5 return 0 if f is in {0,2,4,...,q-1}
7 Preconditions:
8 |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
9 */
11 int fe_isnegative(const fe f)
13 unsigned char s[32];
14 fe_tobytes(s,f);
15 return s[0] & 1;