Merge pull request #101 from jonasnick/export_raw_ctx

Add raw context getter to Secp256k1 struct
This commit is contained in:
Andrew Poelstra 2019-03-04 17:47:08 +00:00 committed by GitHub
commit 8b4963588a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -639,6 +639,14 @@ impl Secp256k1<VerifyOnly> {
impl<C> Secp256k1<C> {
/// 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.