Skip to content

Commit d79989b

Browse files
committed
Remove erroneous duplicate feature
When we removed the "global-context-less-secure" a duplicate feature snuck in, remove it.
1 parent ecb6261 commit d79989b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ use core::{mem, fmt, str};
198198
use ffi::{CPtr, types::AlignedType};
199199

200200
#[cfg(feature = "global-context")]
201-
#[cfg_attr(docsrs, doc(cfg(any(feature = "global-context", feature = "global-context"))))]
201+
#[cfg_attr(docsrs, doc(cfg(feature = "global-context")))]
202202
pub use context::global::SECP256K1;
203203

204204
#[cfg(feature = "bitcoin_hashes")]
@@ -458,6 +458,14 @@ impl<C: Signing> Secp256k1<C> {
458458
}
459459
}
460460

461+
/// Generates a random keypair using the global [`SECP256K1`] context.
462+
#[inline]
463+
#[cfg(all(feature = "global-context", feature = "rand"))]
464+
#[cfg_attr(docsrs, doc(cfg(all(feature = "global-context", feature = "rand"))))]
465+
pub fn generate_keypair<R: Rng + ?Sized>(rng: &mut R) -> (key::SecretKey, key::PublicKey) {
466+
SECP256K1.generate_keypair(rng)
467+
}
468+
461469
/// Utility function used to parse hex into a target u8 buffer. Returns
462470
/// the number of bytes converted or an error if it encounters an invalid
463471
/// character or unexpected end of string.

0 commit comments

Comments
 (0)