Added BigNum::one().

This commit is contained in:
Chris Cole 2014-12-11 11:03:49 -05:00
parent f0de773888
commit 7a4fbc1567
1 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,10 @@ impl BigNum {
})
}
pub fn one() -> BigNum {
BigNum::new_from(1).unwrap()
}
pub fn new_from_slice(n: &[u8]) -> Result<BigNum, SslError> {
BigNum::new().and_then(|v| unsafe {
try_ssl_null!(ffi::BN_bin2bn(n.as_ptr(), n.len() as c_int, v.raw()));