Skip to content

Commit

Permalink
Merge #757: chore: fix doc typos for keys
Browse files Browse the repository at this point in the history
e843bf5 chore: fix doc typos for keys (Tommy Volk)

Pull request description:

ACKs for top commit:
  tcharding:
    ACK e843bf5
  storopoli:
    ACK e843bf5
  apoelstra:
    ACK e843bf5; successfully ran local tests; thanks so much for this!

Tree-SHA512: 395ef2e2399ad3de65c5a22ff8fe050ff680b7da8d9113d22b318656e0c5dcbd1ad7da05553d21bba94447bedf503f6c1e59d3ba3020f301a68734e633f2c760
  • Loading branch information
apoelstra committed Oct 28, 2024
2 parents ac7c74a + e843bf5 commit bb4972f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ use crate::{
///
/// We have attempted to reduce the side channel attack surface by implementing a constant time `eq`
/// method. For similar reasons we explicitly do not implement `PartialOrd`, `Ord`, or `Hash` on
/// `SecretKey`. If you really want to order secrets keys then you can use `AsRef` to get at the
/// `SecretKey`. If you really want to order secret keys then you can use `AsRef` to get at the
/// underlying bytes and compare them - however this is almost certainly a bad idea.
///
/// # Serde support
///
/// Implements de/serialization with the `serde` feature enabled. We treat the byte value as a tuple
/// of 32 `u8`s for non-human-readable formats. This representation is optimal for for some formats
/// of 32 `u8`s for non-human-readable formats. This representation is optimal for some formats
/// (e.g. [`bincode`]) however other formats may be less optimal (e.g. [`cbor`]).
///
/// # Examples
Expand Down Expand Up @@ -126,7 +126,7 @@ impl str::FromStr for SecretKey {
/// # Serde support
///
/// Implements de/serialization with the `serde` feature enabled. We treat the byte value as a tuple
/// of 33 `u8`s for non-human-readable formats. This representation is optimal for for some formats
/// of 33 `u8`s for non-human-readable formats. This representation is optimal for some formats
/// (e.g. [`bincode`]) however other formats may be less optimal (e.g. [`cbor`]).
///
/// # Examples
Expand Down Expand Up @@ -358,7 +358,7 @@ impl SecretKey {
PublicKey::from_secret_key(secp, self)
}

/// Returns the [`XOnlyPublicKey`] (and it's [`Parity`]) for this [`SecretKey`].
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for this [`SecretKey`].
///
/// This is equivalent to `XOnlyPublicKey::from_keypair(self.keypair(secp))`.
#[inline]
Expand Down Expand Up @@ -715,7 +715,7 @@ impl PublicKey {
}
}

/// Returns the [`XOnlyPublicKey`] (and it's [`Parity`]) for this [`PublicKey`].
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for this [`PublicKey`].
#[inline]
pub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity) {
let mut pk_parity = 0;
Expand Down Expand Up @@ -803,9 +803,9 @@ impl<'de> serde::Deserialize<'de> for PublicKey {
///
/// # Serde support
///
/// Implements de/serialization with the `serde` and_`global-context` features enabled. Serializes
/// Implements de/serialization with the `serde` and `global-context` features enabled. Serializes
/// the secret bytes only. We treat the byte value as a tuple of 32 `u8`s for non-human-readable
/// formats. This representation is optimal for for some formats (e.g. [`bincode`]) however other
/// formats. This representation is optimal for some formats (e.g. [`bincode`]) however other
/// formats may be less optimal (e.g. [`cbor`]). For human-readable formats we use a hex string.
///
/// # Examples
Expand Down Expand Up @@ -905,7 +905,7 @@ impl Keypair {
Keypair::from_seckey_str(SECP256K1, s)
}

/// Generates a new random secret key.
/// Generates a new random key pair.
/// # Examples
///
/// ```
Expand Down Expand Up @@ -999,15 +999,15 @@ impl Keypair {
#[inline]
pub fn public_key(&self) -> PublicKey { PublicKey::from_keypair(self) }

/// Returns the [`XOnlyPublicKey`] (and it's [`Parity`]) for this [`Keypair`].
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for this [`Keypair`].
///
/// This is equivalent to using [`XOnlyPublicKey::from_keypair`].
#[inline]
pub fn x_only_public_key(&self) -> (XOnlyPublicKey, Parity) {
XOnlyPublicKey::from_keypair(self)
}

/// Constructs an schnorr signature for `msg` using the global [`SECP256K1`] context.
/// Constructs a schnorr signature for `msg` using the global [`SECP256K1`] context.
#[inline]
#[cfg(all(feature = "global-context", feature = "rand", feature = "std"))]
pub fn sign_schnorr(&self, msg: &[u8]) -> schnorr::Signature {
Expand Down Expand Up @@ -1126,7 +1126,7 @@ impl CPtr for Keypair {
/// # Serde support
///
/// Implements de/serialization with the `serde` feature enabled. We treat the byte value as a tuple
/// of 32 `u8`s for non-human-readable formats. This representation is optimal for for some formats
/// of 32 `u8`s for non-human-readable formats. This representation is optimal for some formats
/// (e.g. [`bincode`]) however other formats may be less optimal (e.g. [`cbor`]).
///
/// # Examples
Expand Down Expand Up @@ -1191,7 +1191,7 @@ impl XOnlyPublicKey {
)]
pub fn as_mut_ptr(&mut self) -> *mut ffi::XOnlyPublicKey { self.as_mut_c_ptr() }

/// Returns the [`XOnlyPublicKey`] (and it's [`Parity`]) for `keypair`.
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for `keypair`.
#[inline]
pub fn from_keypair(keypair: &Keypair) -> (XOnlyPublicKey, Parity) {
let mut pk_parity = 0;
Expand Down

0 comments on commit bb4972f

Please sign in to comment.