Skip to content

Commit 8b49635

Browse files
authored
Merge pull request #101 from jonasnick/export_raw_ctx
Add raw context getter to Secp256k1 struct
2 parents 7234606 + 6eaacb1 commit 8b49635

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/lib.rs

+8
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,14 @@ impl Secp256k1<VerifyOnly> {
639639

640640
impl<C> Secp256k1<C> {
641641

642+
/// Getter for the raw pointer to the underlying secp256k1 context. This
643+
/// shouldn't be needed with normal usage of the library. It enables
644+
/// extending the Secp256k1 with more cryptographic algorithms outside of
645+
/// this crate.
646+
pub fn ctx(&self) -> &*mut ffi::Context {
647+
&self.ctx
648+
}
649+
642650
/// (Re)randomizes the Secp256k1 context for cheap sidechannel resistance;
643651
/// see comment in libsecp256k1 commit d2275795f by Gregory Maxwell. Requires
644652
/// compilation with "rand" feature.

0 commit comments

Comments
 (0)