@@ -79,10 +79,10 @@ pub unsafe trait Context: private::Sealed {
79
79
unsafe fn deallocate ( ptr : * mut u8 , size : usize ) ;
80
80
}
81
81
82
- /// Marker trait for indicating that an instance of `Secp256k1` can be used for signing.
82
+ /// Marker trait for indicating that an instance of [ `Secp256k1`] can be used for signing.
83
83
pub trait Signing : Context { }
84
84
85
- /// Marker trait for indicating that an instance of `Secp256k1` can be used for verification.
85
+ /// Marker trait for indicating that an instance of [ `Secp256k1`] can be used for verification.
86
86
pub trait Verification : Context { }
87
87
88
88
/// Represents the set of capabilities needed for signing (preallocated memory).
@@ -247,8 +247,8 @@ mod alloc_only {
247
247
impl Secp256k1 < VerifyOnly > {
248
248
/// Creates a new Secp256k1 context that can only be used for verification.
249
249
///
250
- /// If `rand-std` feature is enabled, context will have been randomized using `thread_rng`.
251
- /// If `rand-std` feature is not enabled please consider randomizing the context (see docs
250
+ /// * If `rand-std` feature is enabled, context will have been randomized using `thread_rng`.
251
+ /// * If `rand-std` feature is not enabled please consider randomizing the context (see docs
252
252
/// for `Secp256k1::gen_new()`).
253
253
pub fn verification_only ( ) -> Secp256k1 < VerifyOnly > { Secp256k1 :: gen_new ( ) }
254
254
}
@@ -307,7 +307,7 @@ unsafe impl<'buf> Context for AllPreallocated<'buf> {
307
307
}
308
308
309
309
impl < ' buf , C : Context + ' buf > Secp256k1 < C > {
310
- /// Lets you create a context with a preallocated buffer in a generic manner(sign/verify/all).
310
+ /// Lets you create a context with a preallocated buffer in a generic manner (sign/verify/all).
311
311
pub fn preallocated_gen_new ( buf : & ' buf mut [ AlignedType ] ) -> Result < Secp256k1 < C > , Error > {
312
312
#[ cfg( target_arch = "wasm32" ) ]
313
313
ffi:: types:: sanity_checks_for_wasm ( ) ;
@@ -329,7 +329,7 @@ impl<'buf, C: Context + 'buf> Secp256k1<C> {
329
329
}
330
330
331
331
impl < ' buf > Secp256k1 < AllPreallocated < ' buf > > {
332
- /// Creates a new Secp256k1 context with all capabilities
332
+ /// Creates a new Secp256k1 context with all capabilities.
333
333
pub fn preallocated_new (
334
334
buf : & ' buf mut [ AlignedType ] ,
335
335
) -> Result < Secp256k1 < AllPreallocated < ' buf > > , Error > {
@@ -338,7 +338,7 @@ impl<'buf> Secp256k1<AllPreallocated<'buf>> {
338
338
/// Uses the ffi `secp256k1_context_preallocated_size` to check the memory size needed for a context.
339
339
pub fn preallocate_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
340
340
341
- /// Create a context from a raw context.
341
+ /// Creates a context from a raw context.
342
342
///
343
343
/// # Safety
344
344
/// This is highly unsafe, due to the number of conditions that aren't checked.
@@ -372,9 +372,10 @@ impl<'buf> Secp256k1<SignOnlyPreallocated<'buf>> {
372
372
#[ inline]
373
373
pub fn preallocate_signing_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
374
374
375
- /// Create a context from a raw context.
375
+ /// Creates a context from a raw context.
376
376
///
377
377
/// # Safety
378
+ ///
378
379
/// This is highly unsafe, due to the number of conditions that aren't checked.
379
380
/// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
380
381
/// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
@@ -406,9 +407,10 @@ impl<'buf> Secp256k1<VerifyOnlyPreallocated<'buf>> {
406
407
#[ inline]
407
408
pub fn preallocate_verification_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
408
409
409
- /// Create a context from a raw context.
410
+ /// Creates a context from a raw context.
410
411
///
411
412
/// # Safety
413
+ ///
412
414
/// This is highly unsafe, due to the number of conditions that aren't checked.
413
415
/// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
414
416
/// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
0 commit comments