schnorr: Improve rustdocs
Improve the rustdocs in the `schnorr` module by doing: - Use third person tense - Add full stops - Use links and code ticks
This commit is contained in:
parent
47f19a78ef
commit
e945751d85
|
@ -73,7 +73,7 @@ impl str::FromStr for Signature {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Signature {
|
impl Signature {
|
||||||
/// Creates a Signature directly from a slice
|
/// Creates a `Signature` directly from a slice.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn from_slice(data: &[u8]) -> Result<Signature, Error> {
|
pub fn from_slice(data: &[u8]) -> Result<Signature, Error> {
|
||||||
match data.len() {
|
match data.len() {
|
||||||
|
@ -119,7 +119,7 @@ impl<C: Signing> Secp256k1<C> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a schnorr signature internally using the ThreadRng random number
|
/// Creates a schnorr signature internally using the [`rand::rngs::ThreadRng`] random number
|
||||||
/// generator to generate the auxiliary random data.
|
/// generator to generate the auxiliary random data.
|
||||||
#[cfg(feature = "rand-std")]
|
#[cfg(feature = "rand-std")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand-std")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand-std")))]
|
||||||
|
@ -127,12 +127,12 @@ impl<C: Signing> Secp256k1<C> {
|
||||||
self.sign_schnorr_with_rng(msg, keypair, &mut rand::thread_rng())
|
self.sign_schnorr_with_rng(msg, keypair, &mut rand::thread_rng())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a schnorr signature without using any auxiliary random data.
|
/// Creates a schnorr signature without using any auxiliary random data.
|
||||||
pub fn sign_schnorr_no_aux_rand(&self, msg: &Message, keypair: &KeyPair) -> Signature {
|
pub fn sign_schnorr_no_aux_rand(&self, msg: &Message, keypair: &KeyPair) -> Signature {
|
||||||
self.sign_schnorr_helper(msg, keypair, ptr::null())
|
self.sign_schnorr_helper(msg, keypair, ptr::null())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a schnorr signature using the given auxiliary random data.
|
/// Creates a schnorr signature using the given auxiliary random data.
|
||||||
pub fn sign_schnorr_with_aux_rand(
|
pub fn sign_schnorr_with_aux_rand(
|
||||||
&self,
|
&self,
|
||||||
msg: &Message,
|
msg: &Message,
|
||||||
|
@ -142,7 +142,7 @@ impl<C: Signing> Secp256k1<C> {
|
||||||
self.sign_schnorr_helper(msg, keypair, aux_rand.as_c_ptr() as *const ffi::types::c_uchar)
|
self.sign_schnorr_helper(msg, keypair, aux_rand.as_c_ptr() as *const ffi::types::c_uchar)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create a schnorr signature using the given random number generator to
|
/// Creates a schnorr signature using the given random number generator to
|
||||||
/// generate the auxiliary random data.
|
/// generate the auxiliary random data.
|
||||||
#[cfg(feature = "rand")]
|
#[cfg(feature = "rand")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
#[cfg_attr(docsrs, doc(cfg(feature = "rand")))]
|
||||||
|
@ -159,7 +159,7 @@ impl<C: Signing> Secp256k1<C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<C: Verification> Secp256k1<C> {
|
impl<C: Verification> Secp256k1<C> {
|
||||||
/// Verify a schnorr signature.
|
/// Verifies a schnorr signature.
|
||||||
pub fn verify_schnorr(
|
pub fn verify_schnorr(
|
||||||
&self,
|
&self,
|
||||||
sig: &Signature,
|
sig: &Signature,
|
||||||
|
|
Loading…
Reference in New Issue