Merge rust-bitcoin/rust-secp256k1#453: Remove mentions of 32-byte slice from tweak APIs

e612458dc7 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 e612458dc7.
  apoelstra:
    ACK e612458dc7

Tree-SHA512: f1c083756cb99b16b16764c4d603196a99b7bae864ca7f62908866667cf0218c459447b95298edc71de92c1abe1268a1c085495e1626bb0b9168e1af6aaf2af6
This commit is contained in:
Andrew Poelstra 2022-06-21 20:25:16 +00:00
commit 81e580183b
No known key found for this signature in database
GPG Key ID: C588D63CE41B97C1
1 changed files with 3 additions and 5 deletions

View File

@ -270,8 +270,7 @@ impl SecretKey {
/// ///
/// # Errors /// # Errors
/// ///
/// Returns an error if the resulting key would be invalid or if the tweak was not a 32-byte /// Returns an error if the resulting key would be invalid.
/// length slice.
#[inline] #[inline]
pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> { pub fn add_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe { unsafe {
@ -301,8 +300,7 @@ impl SecretKey {
/// ///
/// # Errors /// # Errors
/// ///
/// Returns an error if the resulting key would be invalid or if the tweak was not a 32-byte /// Returns an error if the resulting key would be invalid.
/// length slice.
#[inline] #[inline]
pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> { pub fn mul_tweak(mut self, tweak: &Scalar) -> Result<SecretKey, Error> {
unsafe { unsafe {
@ -1255,7 +1253,7 @@ impl XOnlyPublicKey {
/// ///
/// # Errors /// # 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 /// # Examples
/// ///