-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panic when creating a Schnorr from slice (#1056)
Introduced new safe builders, same as bign256 and sm2: - `split_at` can panic if it receives a slice shorter than `Self::BYTES / 2` - `split_at` is now use in the new `from_bytes` that accepts only byte arrays or the right size - `from_slice` uses a safe conversion that does not panic when the slice is too short - `try_from` slice uses `from_slice` internally, so it does not panic when a short slice is passed - introduce safe type conversion from SignatureBytes
- Loading branch information
Showing
1 changed file
with
48 additions
and
12 deletions.
There are no files selected for viewing
This file contains 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