@@ -71,10 +71,10 @@ pub unsafe trait Context: private::Sealed {
71
71
unsafe fn deallocate ( ptr : * mut u8 , size : usize ) ;
72
72
}
73
73
74
- /// Marker trait for indicating that an instance of `Secp256k1` can be used for signing.
74
+ /// Marker trait for indicating that an instance of [ `Secp256k1`] can be used for signing.
75
75
pub trait Signing : Context { }
76
76
77
- /// Marker trait for indicating that an instance of `Secp256k1` can be used for verification.
77
+ /// Marker trait for indicating that an instance of [ `Secp256k1`] can be used for verification.
78
78
pub trait Verification : Context { }
79
79
80
80
/// Represents the set of capabilities needed for signing (preallocated memory).
@@ -239,8 +239,8 @@ mod alloc_only {
239
239
impl Secp256k1 < VerifyOnly > {
240
240
/// Creates a new Secp256k1 context that can only be used for verification.
241
241
///
242
- /// If `rand-std` feature is enabled, context will have been randomized using `thread_rng`.
243
- /// If `rand-std` feature is not enabled please consider randomizing the context (see docs
242
+ /// * If `rand-std` feature is enabled, context will have been randomized using `thread_rng`.
243
+ /// * If `rand-std` feature is not enabled please consider randomizing the context (see docs
244
244
/// for `Secp256k1::gen_new()`).
245
245
pub fn verification_only ( ) -> Secp256k1 < VerifyOnly > { Secp256k1 :: gen_new ( ) }
246
246
}
@@ -299,7 +299,7 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
299
299
}
300
300
301
301
impl < ' buf , C : Context + ' buf > Secp256k1 < C > {
302
- /// Lets you create a context with a preallocated buffer in a generic manner(sign/verify/all).
302
+ /// Lets you create a context with a preallocated buffer in a generic manner (sign/verify/all).
303
303
pub fn preallocated_gen_new ( buf : & ' buf mut [ AlignedType ] ) -> Result < Secp256k1 < C > , Error > {
304
304
#[ cfg( target_arch = "wasm32" ) ]
305
305
ffi:: types:: sanity_checks_for_wasm ( ) ;
@@ -321,7 +321,7 @@ impl<'buf, C: Context + 'buf> Secp256k1<C> {
321
321
}
322
322
323
323
impl < ' buf > Secp256k1 < AllPreallocated < ' buf > > {
324
- /// Creates a new Secp256k1 context with all capabilities
324
+ /// Creates a new Secp256k1 context with all capabilities.
325
325
pub fn preallocated_new (
326
326
buf : & ' buf mut [ AlignedType ] ,
327
327
) -> Result < Secp256k1 < AllPreallocated < ' buf > > , Error > {
@@ -330,7 +330,7 @@ impl<'buf> Secp256k1<AllPreallocated<'buf>> {
330
330
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for a context.
331
331
pub fn preallocate_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
332
332
333
- /// Create a context from a raw context.
333
+ /// Creates a context from a raw context.
334
334
///
335
335
/// # Safety
336
336
/// This is highly unsafe, due to the number of conditions that aren't checked.
@@ -364,9 +364,10 @@ impl<'buf> Secp256k1<SignOnlyPreallocated<'buf>> {
364
364
#[ inline]
365
365
pub fn preallocate_signing_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
366
366
367
- /// Create a context from a raw context.
367
+ /// Creates a context from a raw context.
368
368
///
369
369
/// # Safety
370
+ ///
370
371
/// This is highly unsafe, due to the number of conditions that aren't checked.
371
372
/// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
372
373
/// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
@@ -398,9 +399,10 @@ impl<'buf> Secp256k1<VerifyOnlyPreallocated<'buf>> {
398
399
#[ inline]
399
400
pub fn preallocate_verification_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
400
401
401
- /// Create a context from a raw context.
402
+ /// Creates a context from a raw context.
402
403
///
403
404
/// # Safety
405
+ ///
404
406
/// This is highly unsafe, due to the number of conditions that aren't checked.
405
407
/// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
406
408
/// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
0 commit comments