1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-24 12:36:01 -07:00

Accept non-canonical PKs if ED25519_COMPAT is defined

This commit is contained in:
Frank Denis 2017-10-31 16:08:45 +01:00
parent 5808b83092
commit 1cd0633186

View File

@ -28,13 +28,15 @@ _crypto_sign_ed25519_verify_detached(const unsigned char *sig,
if (sc_is_canonical(sig + 32) == 0 || ge_has_small_order(sig) != 0) {
return -1;
}
if (ge_is_canonical(pk) == 0) {
return -1;
}
#else
if (sig[63] & 224) {
return -1;
}
#endif
if (ge_is_canonical(pk) == 0 || ge_has_small_order(pk) != 0 ||
ge_frombytes_negate_vartime(&A, pk) != 0) {
if (ge_has_small_order(pk) != 0 || ge_frombytes_negate_vartime(&A, pk) != 0) {
return -1;
}
_crypto_sign_ed25519_ref10_hinit(&hs, prehashed);