aboutsummaryrefslogtreecommitdiff
path: root/openssl-sys/src
diff options
context:
space:
mode:
authorChris Cole <[email protected]>2014-12-14 10:02:18 -0500
committerChris Cole <[email protected]>2014-12-14 10:02:18 -0500
commit38682821ade69780e5c125fa00f1f71a3b161ffd (patch)
tree3b75263e862f6c9f1743c9ce4647d111921d7e9f /openssl-sys/src
parentAdded BigNum::one(). (diff)
downloadrust-openssl-38682821ade69780e5c125fa00f1f71a3b161ffd.tar.xz
rust-openssl-38682821ade69780e5c125fa00f1f71a3b161ffd.zip
Added BigNum::{from_dec_str,from_hex_str}, BN_dec2bn, and BN_hex2bn.
Diffstat (limited to 'openssl-sys/src')
-rw-r--r--openssl-sys/src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs
index 03a5a567..68d2d6dc 100644
--- a/openssl-sys/src/lib.rs
+++ b/openssl-sys/src/lib.rs
@@ -81,6 +81,11 @@ pub struct BIGNUM {
pub flags: c_int,
}
+#[repr(C)]
+pub struct BIGNUM_PTR {
+ pub ptr: *mut BIGNUM,
+}
+
pub type CRYPTO_EX_new = extern "C" fn(parent: *mut c_void, ptr: *mut c_void,
ad: *const CRYPTO_EX_DATA, idx: c_int,
argl: c_long, argp: *const c_void) -> c_int;
@@ -291,9 +296,14 @@ extern "C" {
pub fn BN_bin2bn(s: *const u8, size: c_int, ret: *mut BIGNUM) -> *mut BIGNUM;
pub fn BN_bn2bin(a: *mut BIGNUM, to: *mut u8) -> c_int;
- /* Conversion from/to string representation */
+ /* Conversion from/to decimal string representation */
+ pub fn BN_dec2bn(a: *mut BIGNUM_PTR, s: *const i8) -> c_int;
pub fn BN_bn2dec(a: *mut BIGNUM) -> *const c_char;
+ /* Conversion from/to hexidecimal string representation */
+ pub fn BN_hex2bn(a: *mut BIGNUM_PTR, s: *const i8) -> c_int;
+ pub fn BN_bn2hex(a: *mut BIGNUM) -> *const c_char;
+
pub fn CRYPTO_num_locks() -> c_int;
pub fn CRYPTO_set_locking_callback(func: extern "C" fn(mode: c_int,
n: c_int,