aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven Fackler <[email protected]>2014-08-20 23:53:59 -0400
committerSteven Fackler <[email protected]>2014-08-20 23:53:59 -0400
commitfec71293a7dba1a176a20b22acb5365d17ce8bcd (patch)
tree06f1c51e99861e52f3f31543ead9a2ce31aa01b8
parentcargo update (diff)
parentUse BN_div instead of BN_mod (diff)
downloadrust-openssl-fec71293a7dba1a176a20b22acb5365d17ce8bcd.tar.xz
rust-openssl-fec71293a7dba1a176a20b22acb5365d17ce8bcd.zip
Merge pull request #33 from isra17/master
Use BN_div instead of BN_mod
-rw-r--r--src/bn/mod.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/bn/mod.rs b/src/bn/mod.rs
index ac4fff7b..1982de45 100644
--- a/src/bn/mod.rs
+++ b/src/bn/mod.rs
@@ -34,7 +34,6 @@ extern {
fn BN_mul(r: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
fn BN_sqr(r: *mut BIGNUM, a: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
fn BN_div(dv: *mut BIGNUM, rem: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
- fn BN_mod(rem: *mut BIGNUM, a: *mut BIGNUM, m: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
fn BN_nnmod(rem: *mut BIGNUM, a: *mut BIGNUM, m: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
fn BN_mod_add(r: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, m: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
fn BN_mod_sub(r: *mut BIGNUM, a: *mut BIGNUM, b: *mut BIGNUM, m: *mut BIGNUM, ctx: *mut BN_CTX) -> c_int;
@@ -356,7 +355,7 @@ impl BigNum {
pub fn checked_mod(&self, a: &BigNum) -> Result<BigNum, SslError> {
unsafe {
- with_bn_in_ctx!(r, ctx, { BN_mod(r.raw(), self.raw(), a.raw(), ctx) == 1 })
+ with_bn_in_ctx!(r, ctx, { BN_div(ptr::mut_null(), r.raw(), self.raw(), a.raw(), ctx) == 1 })
}
}