Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #445: Add
Scalar
newtype and use it in tweaking APIs
5a03324 Add `Scalar` newtype and use it in tweaking APIs (Martin Habovstiak) Pull request description: This adds `Scalar` newtype to better represent values accepted by tweaking functions. This type is always 32-bytes and guarantees being within curve order. This is an initial iteration. Things I'm not 100% sure of, would appreciate help: * Is it actually required for scalar to be within curve order? * Are non-constant-time operations actually an issue? Alterntive tweaking API designs: * Accept `Into<Scalar>` generic argument, so people can pass `SecretKey`, may slightly worsen performance * `unsafe`-ly implement `AsRef<Scalar> for SecretKey` (casting raw pointers) and accept that Possible extension: API to convert from slices so that the user doesn't need two steps (convert to array first). ACKs for top commit: apoelstra: ACK 5a03324 Tree-SHA512: cf639c91f0c6f6e0178d8a6d4125fd041708a59661fbd2f1924881001011e4cfe2b998148ae652995cdc9a3791c6644fcd5f004e059d76d9182a5e409b791446
- Loading branch information
Showing
3 changed files
with
174 additions
and
58 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
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
Oops, something went wrong.