diff --git a/src/context.rs b/src/context.rs index 937ae5d..8d958f7 100644 --- a/src/context.rs +++ b/src/context.rs @@ -71,10 +71,10 @@ pub unsafe trait Context: private::Sealed { unsafe fn deallocate(ptr: *mut u8, size: usize); } -/// Marker trait for indicating that an instance of `Secp256k1` can be used for signing. +/// Marker trait for indicating that an instance of [`Secp256k1`] can be used for signing. pub trait Signing: Context {} -/// Marker trait for indicating that an instance of `Secp256k1` can be used for verification. +/// Marker trait for indicating that an instance of [`Secp256k1`] can be used for verification. pub trait Verification: Context {} /// Represents the set of capabilities needed for signing (preallocated memory). @@ -239,8 +239,8 @@ mod alloc_only { impl Secp256k1 { /// Creates a new Secp256k1 context that can only be used for verification. /// - /// If `rand-std` feature is enabled, context will have been randomized using `thread_rng`. - /// If `rand-std` feature is not enabled please consider randomizing the context (see docs + /// * If `rand-std` feature is enabled, context will have been randomized using `thread_rng`. + /// * If `rand-std` feature is not enabled please consider randomizing the context (see docs /// for `Secp256k1::gen_new()`). pub fn verification_only() -> Secp256k1 { Secp256k1::gen_new() } } @@ -299,7 +299,7 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> { } impl<'buf, C: Context + 'buf> Secp256k1 { - /// Lets you create a context with a preallocated buffer in a generic manner(sign/verify/all). + /// Lets you create a context with a preallocated buffer in a generic manner (sign/verify/all). pub fn preallocated_gen_new(buf: &'buf mut [AlignedType]) -> Result, Error> { #[cfg(target_arch = "wasm32")] ffi::types::sanity_checks_for_wasm(); @@ -321,7 +321,7 @@ impl<'buf, C: Context + 'buf> Secp256k1 { } impl<'buf> Secp256k1> { - /// Creates a new Secp256k1 context with all capabilities + /// Creates a new Secp256k1 context with all capabilities. pub fn preallocated_new( buf: &'buf mut [AlignedType], ) -> Result>, Error> { @@ -330,7 +330,7 @@ impl<'buf> Secp256k1> { /// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for a context. pub fn preallocate_size() -> usize { Self::preallocate_size_gen() } - /// Create a context from a raw context. + /// Creates a context from a raw context. /// /// # Safety /// This is highly unsafe, due to the number of conditions that aren't checked. @@ -364,9 +364,10 @@ impl<'buf> Secp256k1> { #[inline] pub fn preallocate_signing_size() -> usize { Self::preallocate_size_gen() } - /// Create a context from a raw context. + /// Creates a context from a raw context. /// /// # Safety + /// /// This is highly unsafe, due to the number of conditions that aren't checked. /// * `raw_ctx` needs to be a valid Secp256k1 context pointer. /// that was generated by *exactly* the same code/version of the libsecp256k1 used here. @@ -398,9 +399,10 @@ impl<'buf> Secp256k1> { #[inline] pub fn preallocate_verification_size() -> usize { Self::preallocate_size_gen() } - /// Create a context from a raw context. + /// Creates a context from a raw context. /// /// # Safety + /// /// This is highly unsafe, due to the number of conditions that aren't checked. /// * `raw_ctx` needs to be a valid Secp256k1 context pointer. /// that was generated by *exactly* the same code/version of the libsecp256k1 used here.