Merge pull request #142 from 35359595/master

check_scalar bug fix for legacy_compatibility feature
This commit is contained in:
isis agora lovecruft 2020-09-10 01:36:55 +00:00 committed by GitHub
commit bd572dcd52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ fn check_scalar(bytes: [u8; 32]) -> Result<Scalar, SignatureError> {
// This is compatible with ed25519-donna and libsodium when
// -DED25519_COMPAT is NOT specified.
if bytes[31] & 224 != 0 {
return Err(SignatureError(InternalError::ScalarFormatError));
return Err(InternalError::ScalarFormatError.into());
}
Ok(Scalar::from_bits(bytes))