Skip to content

Commit

Permalink
Merge pull request #1895 from sfackler/alex-patch-1
Browse files Browse the repository at this point in the history
Expose BigNum::to_vec_padded on libressl and boringssl
  • Loading branch information
alex authored Apr 21, 2023
2 parents f7b98c2 + 0a3cca2 commit 3f038cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openssl-sys/src/handwritten/bn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extern "C" {
pub fn BN_clear_free(bn: *mut BIGNUM);
pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
pub fn BN_bn2bin(a: *const BIGNUM, to: *mut u8) -> c_int;
#[cfg(ossl110)]
#[cfg(any(ossl110, libressl340))]
pub fn BN_bn2binpad(a: *const BIGNUM, to: *mut u8, tolen: c_int) -> c_int;
pub fn BN_sub(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
pub fn BN_add(r: *mut BIGNUM, a: *const BIGNUM, b: *const BIGNUM) -> c_int;
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/bn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ impl BigNumRef {
/// assert_eq!(&bn_vec, &[0, 0, 0x45, 0x43]);
/// ```
#[corresponds(BN_bn2binpad)]
#[cfg(ossl110)]
#[cfg(any(ossl110, libressl340, boringssl))]
pub fn to_vec_padded(&self, pad_to: i32) -> Result<Vec<u8>, ErrorStack> {
let mut v = Vec::with_capacity(pad_to as usize);
unsafe {
Expand Down

0 comments on commit 3f038cf

Please sign in to comment.