Swap #ifdef branches for clarity
This commit is contained in:
parent
958060e2ec
commit
e2581d9105
@ -23,7 +23,11 @@ _crypto_sign_ed25519_verify_detached(const unsigned char *sig,
|
|||||||
ge25519_p3 A;
|
ge25519_p3 A;
|
||||||
ge25519_p2 R;
|
ge25519_p2 R;
|
||||||
|
|
||||||
#ifndef ED25519_COMPAT
|
#ifdef ED25519_COMPAT
|
||||||
|
if (sig[63] & 224) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (sc25519_is_canonical(sig + 32) == 0 ||
|
if (sc25519_is_canonical(sig + 32) == 0 ||
|
||||||
ge25519_has_small_order(sig) != 0) {
|
ge25519_has_small_order(sig) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
@ -32,10 +36,6 @@ _crypto_sign_ed25519_verify_detached(const unsigned char *sig,
|
|||||||
ge25519_has_small_order(pk) != 0) {
|
ge25519_has_small_order(pk) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
if (sig[63] & 224) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
if (ge25519_frombytes_negate_vartime(&A, pk) != 0) {
|
if (ge25519_frombytes_negate_vartime(&A, pk) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user