ed25519: deprecate Signature::new in favor of ::from_bytes#401
Merged
ed25519: deprecate Signature::new in favor of ::from_bytes#401
Signature::new in favor of ::from_bytes#401Conversation
7804f39 to
cfd3baa
Compare
Adds a `Signature::from_bytes` inherent method which matches the method of the same name on the `Signature` trait, i.e. it returns a `signature::Result`. This method performs a partial range check on the `s` component of the signature to ensure fit within the order of ~2^(252.5). It won't reject all invalid signatures, but it will detect quite a few of them. Deprecates the infallible `Signature::new` method, since it can't detect invalid signatures. While the `from_bytes` method isn't perfect, it can be improved in the future, whereas an infallible method can't.
cfd3baa to
6a58487
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
Signature::from_bytesinherent method which matches the method of the same name on theSignaturetrait, i.e. it returns asignature::Result.This method performs a partial range check on the
scomponent of the signature to ensure fit within the order of ~2^(252.5). It won't reject all invalid signatures, but it will detect quite a few of them.Deprecates the infallible
Signature::newmethod, since it can't detect invalid signatures. While thefrom_bytesmethod isn't perfect, it can be improved in the future, whereas an infallible method can't.