From 6eaacb19c53e321159c7b5029a9133253875fd74 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Fri, 1 Mar 2019 19:39:55 +0000 Subject: [PATCH] Add raw context getter to Secp256k1 struct --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6f7632b..5cb3d9b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -639,6 +639,14 @@ impl Secp256k1 { impl Secp256k1 { + /// Getter for the raw pointer to the underlying secp256k1 context. This + /// shouldn't be needed with normal usage of the library. It enables + /// extending the Secp256k1 with more cryptographic algorithms outside of + /// this crate. + pub fn ctx(&self) -> &*mut ffi::Context { + &self.ctx + } + /// (Re)randomizes the Secp256k1 context for cheap sidechannel resistance; /// see comment in libsecp256k1 commit d2275795f by Gregory Maxwell. Requires /// compilation with "rand" feature.