diff options
| author | Steven Fackler <[email protected]> | 2016-10-31 19:45:52 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-10-31 20:02:24 -0700 |
| commit | 3363046c34ca3f968ce8b34e885d25aebac2b1f4 (patch) | |
| tree | 074f3994af5b38f2dc90c35d009515080aa7a06a /openssl/src/rsa.rs | |
| parent | Add a generic Ref type (diff) | |
| download | rust-openssl-3363046c34ca3f968ce8b34e885d25aebac2b1f4.tar.xz rust-openssl-3363046c34ca3f968ce8b34e885d25aebac2b1f4.zip | |
Update bignum
Diffstat (limited to 'openssl/src/rsa.rs')
| -rw-r--r-- | openssl/src/rsa.rs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/openssl/src/rsa.rs b/openssl/src/rsa.rs index c6c96223..a12dc4d1 100644 --- a/openssl/src/rsa.rs +++ b/openssl/src/rsa.rs @@ -6,10 +6,11 @@ use std::ops::Deref; use libc::{c_int, c_void, c_char}; use {cvt, cvt_p, cvt_n}; -use bn::{BigNum, BigNumRef}; +use bn::BigNum; use bio::{MemBio, MemBioSlice}; use error::ErrorStack; use util::{CallbackState, invoke_passwd_cb}; +use types::{OpenSslType, Ref}; use opaque::Opaque; /// Type of encryption padding to use. @@ -162,57 +163,57 @@ impl RsaRef { } } - pub fn n(&self) -> Option<&BigNumRef> { + pub fn n(&self) -> Option<&Ref<BigNum>> { unsafe { let n = compat::key(self.as_ptr())[0]; if n.is_null() { None } else { - Some(BigNumRef::from_ptr(n as *mut _)) + Some(Ref::<BigNum>::from_ptr(n as *mut _)) } } } - pub fn d(&self) -> Option<&BigNumRef> { + pub fn d(&self) -> Option<&Ref<BigNum>> { unsafe { let d = compat::key(self.as_ptr())[2]; if d.is_null() { None } else { - Some(BigNumRef::from_ptr(d as *mut _)) + Some(Ref::<BigNum>::from_ptr(d as *mut _)) } } } - pub fn e(&self) -> Option<&BigNumRef> { + pub fn e(&self) -> Option<&Ref<BigNum>> { unsafe { let e = compat::key(self.as_ptr())[1]; if e.is_null() { None } else { - Some(BigNumRef::from_ptr(e as *mut _)) + Some(Ref::<BigNum>::from_ptr(e as *mut _)) } } } - pub fn p(&self) -> Option<&BigNumRef> { + pub fn p(&self) -> Option<&Ref<BigNum>> { unsafe { let p = compat::factors(self.as_ptr())[0]; if p.is_null() { None } else { - Some(BigNumRef::from_ptr(p as *mut _)) + Some(Ref::<BigNum>::from_ptr(p as *mut _)) } } } - pub fn q(&self) -> Option<&BigNumRef> { + pub fn q(&self) -> Option<&Ref<BigNum>> { unsafe { let q = compat::factors(self.as_ptr())[1]; if q.is_null() { None } else { - Some(BigNumRef::from_ptr(q as *mut _)) + Some(Ref::<BigNum>::from_ptr(q as *mut _)) } } } |