repo.or.cz
/
tomato.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git]
/
release
/
src
/
router
/
libsodium
/
src
/
libsodium
/
crypto_sign
/
ed25519
/
ref10
/
fe_isnonzero.c
blob
db29c2545e8837c35b080bd3149e6b6d351d325e
1
#include
"fe.h"
2
#include
"crypto_verify_32.h"
3
4
/*
5
return 1 if f == 0
6
return 0 if f != 0
7
8
Preconditions:
9
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
10
*/
11
12
static unsigned char
zero
[
32
];
13
14
int
fe_isnonzero
(
const
fe f
)
15
{
16
unsigned char
s
[
32
];
17
fe_tobytes
(
s
,
f
);
18
return
crypto_verify_32
(
s
,
zero
);
19
}