diff options
| author | Steven Fackler <[email protected]> | 2016-10-31 19:37:21 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-31 20:02:24 -0700 |
| commit | 927c3e924cd894cb4b32efff666f949a294ab7c7 (patch) | |
| tree | 2a5667608e85469e4115a9d358c8a4119af7fada /openssl/src/bn.rs | |
| parent | Mention 0.7 README (diff) | |
| download | rust-openssl-927c3e924cd894cb4b32efff666f949a294ab7c7.tar.xz rust-openssl-927c3e924cd894cb4b32efff666f949a294ab7c7.zip | |
Add a generic Ref type
Diffstat (limited to 'openssl/src/bn.rs')
| -rw-r--r-- | openssl/src/bn.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/openssl/src/bn.rs b/openssl/src/bn.rs index 78684d0a..ab5f7769 100644 --- a/openssl/src/bn.rs +++ b/openssl/src/bn.rs @@ -23,16 +23,7 @@ pub enum RNGProperty { TwoMsbOne = 1, } -/// A context object for `BigNum` operations. -pub struct BnCtx(*mut ffi::BN_CTX); - -impl Drop for BnCtx { - fn drop(&mut self) { - unsafe { - ffi::BN_CTX_free(self.0); - } - } -} +type_!(BnCtx, ffi::BN_CTX, ffi::BN_CTX_free); impl BnCtx { /// Returns a new `BnCtx`. @@ -40,10 +31,6 @@ impl BnCtx { unsafe { cvt_p(ffi::BN_CTX_new()).map(BnCtx) } } - pub fn as_ptr(&self) -> *mut ffi::BN_CTX { - self.0 - } - /// Places the result of `a * b` in `r`. pub fn mul(&mut self, r: &mut BigNumRef, |