Loading openssl-sys/src/handwritten/bn.rs +7 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,13 @@ extern "C" { m: *const BIGNUM, ctx: *mut BN_CTX, ) -> c_int; #[cfg(ossl110)] pub fn BN_mod_sqrt( ret: *mut BIGNUM, a: *const BIGNUM, p: *const BIGNUM, ctx: *mut BN_CTX, ) -> *mut BIGNUM; pub fn BN_mod_word(r: *const BIGNUM, w: BN_ULONG) -> BN_ULONG; pub fn BN_div_word(r: *mut BIGNUM, w: BN_ULONG) -> BN_ULONG; Loading openssl/src/bn.rs +20 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,26 @@ impl BigNumRef { } } /// Places into `self` the modular square root of `a` such that `self^2 = a (mod p)` #[corresponds(BN_mod_sqrt)] #[cfg(ossl110)] pub fn mod_sqrt( &mut self, a: &BigNumRef, p: &BigNumRef, ctx: &mut BigNumContextRef, ) -> Result<(), ErrorStack> { unsafe { cvt_p(ffi::BN_mod_sqrt( self.as_ptr(), a.as_ptr(), p.as_ptr(), ctx.as_ptr(), )) .map(|_| ()) } } /// Places the result of `a^p` in `self`. #[corresponds(BN_exp)] pub fn exp( Loading Loading
openssl-sys/src/handwritten/bn.rs +7 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,13 @@ extern "C" { m: *const BIGNUM, ctx: *mut BN_CTX, ) -> c_int; #[cfg(ossl110)] pub fn BN_mod_sqrt( ret: *mut BIGNUM, a: *const BIGNUM, p: *const BIGNUM, ctx: *mut BN_CTX, ) -> *mut BIGNUM; pub fn BN_mod_word(r: *const BIGNUM, w: BN_ULONG) -> BN_ULONG; pub fn BN_div_word(r: *mut BIGNUM, w: BN_ULONG) -> BN_ULONG; Loading
openssl/src/bn.rs +20 −0 Original line number Diff line number Diff line Loading @@ -639,6 +639,26 @@ impl BigNumRef { } } /// Places into `self` the modular square root of `a` such that `self^2 = a (mod p)` #[corresponds(BN_mod_sqrt)] #[cfg(ossl110)] pub fn mod_sqrt( &mut self, a: &BigNumRef, p: &BigNumRef, ctx: &mut BigNumContextRef, ) -> Result<(), ErrorStack> { unsafe { cvt_p(ffi::BN_mod_sqrt( self.as_ptr(), a.as_ptr(), p.as_ptr(), ctx.as_ptr(), )) .map(|_| ()) } } /// Places the result of `a^p` in `self`. #[corresponds(BN_exp)] pub fn exp( Loading