libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / src / libsodium / crypto_sign / ed25519 / ref10 / fe_isnonzero.c
blobdb29c2545e8837c35b080bd3149e6b6d351d325e
1 #include "fe.h"
2 #include "crypto_verify_32.h"
4 /*
5 return 1 if f == 0
6 return 0 if f != 0
8 Preconditions:
9 |f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
12 static unsigned char zero[32];
14 int fe_isnonzero(const fe f)
16 unsigned char s[32];
17 fe_tobytes(s,f);
18 return crypto_verify_32(s,zero);