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_isnegative.c
blob
3b2c8b8d52366f4eefceb1cd4ab568561781af5b
1
#include
"fe.h"
2
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}
6
7
Preconditions:
8
|f| bounded by 1.1*2^26,1.1*2^25,1.1*2^26,1.1*2^25,etc.
9
*/
10
11
int
fe_isnegative
(
const
fe f
)
12
{
13
unsigned char
s
[
32
];
14
fe_tobytes
(
s
,
f
);
15
return
s
[
0
] &
1
;
16
}