@@ -352,14 +352,15 @@ impl<'buf> Secp256k1<AllPreallocated<'buf>> {
352
352
/// Creates a context from a raw context.
353
353
///
354
354
/// # Safety
355
- /// This is highly unsafe, due to the number of conditions that aren't checked.
356
- /// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
357
- /// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
358
- /// * The capabilities (All/SignOnly/VerifyOnly) of the context *must* match the flags passed to libsecp256k1
359
- /// when generating the context.
360
- /// * The user must handle the freeing of the context(using the correct functions) by himself.
361
- /// * Violating these may lead to Undefined Behavior.
362
355
///
356
+ /// This is highly unsafe due to the number of conditions that aren't checked, specifically:
357
+ ///
358
+ /// * `raw_ctx` needs to be a valid Secp256k1 context pointer that was generated by *exactly*
359
+ /// the same code/version of the libsecp256k1 used here.
360
+ /// * The capabilities (`All`/`SignOnly`/`VerifyOnly`) of the context *must* match the flags
361
+ /// passed to libsecp256k1 when generating the context.
362
+ /// * The user must handle the freeing of the context (using the correct functions) by himself.
363
+ /// * `raw_ctx` must point to writable memory (cannot be `ffi::secp256k1_context_no_precomp`).
363
364
pub unsafe fn from_raw_all (
364
365
raw_ctx : NonNull < ffi:: Context > ,
365
366
) -> ManuallyDrop < Secp256k1 < AllPreallocated < ' buf > > > {
@@ -379,18 +380,18 @@ impl<'buf> Secp256k1<SignOnlyPreallocated<'buf>> {
379
380
#[ inline]
380
381
pub fn preallocate_signing_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
381
382
382
- /// Creates a context from a raw context.
383
+ /// Creates a context from a raw context that can only be used for signing .
383
384
///
384
385
/// # Safety
385
386
///
386
- /// This is highly unsafe, due to the number of conditions that aren't checked.
387
- /// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
388
- /// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
389
- /// * The capabilities (All/SignOnly/VerifyOnly) of the context *must* match the flags passed to libsecp256k1
390
- /// when generating the context.
391
- /// * The user must handle the freeing of the context(using the correct functions) by himself.
392
- /// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.
387
+ /// This is highly unsafe due to the number of conditions that aren't checked, specifically:
393
388
///
389
+ /// * `raw_ctx` needs to be a valid Secp256k1 context pointer that was generated by *exactly*
390
+ /// the same code/version of the libsecp256k1 used here.
391
+ /// * The capabilities (`All`/`SignOnly`/`VerifyOnly`) of the context *must* match the flags
392
+ /// passed to libsecp256k1 when generating the context.
393
+ /// * The user must handle the freeing of the context (using the correct functions) by himself.
394
+ /// * `raw_ctx` must point to writable memory (cannot be `ffi::secp256k1_context_no_precomp`).
394
395
pub unsafe fn from_raw_signing_only (
395
396
raw_ctx : NonNull < ffi:: Context > ,
396
397
) -> ManuallyDrop < Secp256k1 < SignOnlyPreallocated < ' buf > > > {
@@ -410,18 +411,18 @@ impl<'buf> Secp256k1<VerifyOnlyPreallocated<'buf>> {
410
411
#[ inline]
411
412
pub fn preallocate_verification_size ( ) -> usize { Self :: preallocate_size_gen ( ) }
412
413
413
- /// Creates a context from a raw context.
414
+ /// Creates a context from a raw context that can only be used for verification .
414
415
///
415
416
/// # Safety
416
417
///
417
- /// This is highly unsafe, due to the number of conditions that aren't checked.
418
- /// * `raw_ctx` needs to be a valid Secp256k1 context pointer.
419
- /// that was generated by *exactly* the same code/version of the libsecp256k1 used here.
420
- /// * The capabilities (All/SignOnly/VerifyOnly) of the context *must* match the flags passed to libsecp256k1
421
- /// when generating the context.
422
- /// * The user must handle the freeing of the context(using the correct functions) by himself.
423
- /// * This list *is not* exhaustive, and any violation may lead to Undefined Behavior.
418
+ /// This is highly unsafe due to the number of conditions that aren't checked, specifically:
424
419
///
420
+ /// * `raw_ctx` needs to be a valid Secp256k1 context pointer that was generated by *exactly*
421
+ /// the same code/version of the libsecp256k1 used here.
422
+ /// * The capabilities (`All`/`SignOnly`/`VerifyOnly`) of the context *must* match the flags
423
+ /// passed to libsecp256k1 when generating the context.
424
+ /// * The user must handle the freeing of the context (using the correct functions) by himself.
425
+ /// * `raw_ctx` must point to writable memory (cannot be `ffi::secp256k1_context_no_precomp`).
425
426
pub unsafe fn from_raw_verification_only (
426
427
raw_ctx : NonNull < ffi:: Context > ,
427
428
) -> ManuallyDrop < Secp256k1 < VerifyOnlyPreallocated < ' buf > > > {
0 commit comments