Skip to content

Commit aa4489c

Browse files
committed
key: Improve docs
Crypto is _hard_. Make an effort to improve the docs with a minimum of exactly correct information.
1 parent 1f9c01a commit aa4489c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/key.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ use crate::{
2121
#[cfg(feature = "hashes")]
2222
use crate::{hashes, ThirtyTwoByteHash};
2323

24-
/// Secret 256-bit key used as `x` in an ECDSA signature.
24+
/// Secret key - a 256-bit key used to create ECDSA and Taproot signatures.
25+
///
26+
/// This value should be generated using a [cryptographically secure pseudorandom number generator].
2527
///
2628
/// # Side channel attacks
2729
///
@@ -50,6 +52,7 @@ use crate::{hashes, ThirtyTwoByteHash};
5052
/// ```
5153
/// [`bincode`]: https://docs.rs/bincode
5254
/// [`cbor`]: https://docs.rs/cbor
55+
/// [cryptographically secure pseudorandom number generator]: https://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator
5356
#[derive(Copy, Clone)]
5457
pub struct SecretKey([u8; constants::SECRET_KEY_SIZE]);
5558
impl_display_secret!(SecretKey);
@@ -117,7 +120,7 @@ impl str::FromStr for SecretKey {
117120
}
118121
}
119122

120-
/// A Secp256k1 public key, used for verification of signatures.
123+
/// Public key - used to verify ECDSA signatures and to do Taproot tweaks.
121124
///
122125
/// # Serde support
123126
///
@@ -1082,7 +1085,7 @@ impl CPtr for KeyPair {
10821085
fn as_mut_c_ptr(&mut self) -> *mut Self::Target { &mut self.0 }
10831086
}
10841087

1085-
/// An x-only public key, used for verification of schnorr signatures and serialized according to BIP-340.
1088+
/// An x-only public key, used for verification of Taproot signatures and serialized according to BIP-340.
10861089
///
10871090
/// # Serde support
10881091
///

0 commit comments

Comments
 (0)