Skip to content

Commit

Permalink
Merge #453: Remove mentions of 32-byte slice from tweak APIs
Browse files Browse the repository at this point in the history
e612458 Remove mentions of 32-byte slice from tweak APIs (Martin Habovštiak)

Pull request description:

  These methods accept `&Scalar`, not slice and `&Scalar` already guarantees 32-bytes, so this failure case is impossible.

ACKs for top commit:
  sanket1729:
    ACK e612458.
  apoelstra:
    ACK e612458

Tree-SHA512: f1c083756cb99b16b16764c4d603196a99b7bae864ca7f62908866667cf0218c459447b95298edc71de92c1abe1268a1c085495e1626bb0b9168e1af6aaf2af6
  • Loading branch information
apoelstra committed Jun 21, 2022
2 parents a1ac3fb + e612458 commit 81e5801
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ impl SecretKey {
///
/// # Errors
///
/// Returns an error if the resulting key would be invalid or if the tweak was not a 32-byte
/// length slice.
/// Returns an error if the resulting key would be invalid.
#[inline]
pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe {
Expand Down Expand Up @@ -301,8 +300,7 @@ impl SecretKey {
///
/// # Errors
///
/// Returns an error if the resulting key would be invalid or if the tweak was not a 32-byte
/// length slice.
/// Returns an error if the resulting key would be invalid.
#[inline]
pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe {
Expand Down Expand Up @@ -1255,7 +1253,7 @@ impl XOnlyPublicKey {
///
/// # Errors
///
/// If the resulting key would be invalid or if the tweak was not a 32-byte length slice.
/// If the resulting key would be invalid.
///
/// # Examples
///
Expand Down

0 comments on commit 81e5801

Please sign in to comment.