Loading openssl-sys/src/lib.rs +2 −0 Original line number Diff line number Diff line Loading @@ -1274,6 +1274,8 @@ extern { pub fn BN_new() -> *mut BIGNUM; pub fn BN_dup(n: *const BIGNUM) -> *mut BIGNUM; pub fn BN_clear(bn: *mut BIGNUM); pub fn BN_free(bn: *mut BIGNUM); pub fn BN_clear_free(bn: *mut BIGNUM); pub fn BN_CTX_new() -> *mut BN_CTX; Loading openssl/src/bn.rs +8 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,13 @@ impl BnCtx { } impl Ref<BigNum> { /// Erases the memory used by this `BigNum`, resetting its value to 0. /// /// This can be used to destroy sensitive data such as keys when they are no longer needed. pub fn clear(&mut self) { unsafe { ffi::BN_clear(self.as_ptr()) } } /// Adds a `u32` to `self`. pub fn add_word(&mut self, w: u32) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_add_word(self.as_ptr(), w as ffi::BN_ULONG)).map(|_| ()) } Loading Loading @@ -431,7 +438,7 @@ impl Ref<BigNum> { } } type_!(BigNum, ffi::BIGNUM, ffi::BN_clear_free); type_!(BigNum, ffi::BIGNUM, ffi::BN_free); impl BigNum { /// Creates a new `BigNum` with the value 0. Loading Loading
openssl-sys/src/lib.rs +2 −0 Original line number Diff line number Diff line Loading @@ -1274,6 +1274,8 @@ extern { pub fn BN_new() -> *mut BIGNUM; pub fn BN_dup(n: *const BIGNUM) -> *mut BIGNUM; pub fn BN_clear(bn: *mut BIGNUM); pub fn BN_free(bn: *mut BIGNUM); pub fn BN_clear_free(bn: *mut BIGNUM); pub fn BN_CTX_new() -> *mut BN_CTX; Loading
openssl/src/bn.rs +8 −1 Original line number Diff line number Diff line Loading @@ -225,6 +225,13 @@ impl BnCtx { } impl Ref<BigNum> { /// Erases the memory used by this `BigNum`, resetting its value to 0. /// /// This can be used to destroy sensitive data such as keys when they are no longer needed. pub fn clear(&mut self) { unsafe { ffi::BN_clear(self.as_ptr()) } } /// Adds a `u32` to `self`. pub fn add_word(&mut self, w: u32) -> Result<(), ErrorStack> { unsafe { cvt(ffi::BN_add_word(self.as_ptr(), w as ffi::BN_ULONG)).map(|_| ()) } Loading Loading @@ -431,7 +438,7 @@ impl Ref<BigNum> { } } type_!(BigNum, ffi::BIGNUM, ffi::BN_clear_free); type_!(BigNum, ffi::BIGNUM, ffi::BN_free); impl BigNum { /// Creates a new `BigNum` with the value 0. Loading