diff options
| author | Chris Cole <[email protected]> | 2014-12-11 11:03:49 -0500 |
|---|---|---|
| committer | Chris Cole <[email protected]> | 2014-12-11 11:04:29 -0500 |
| commit | 7a4fbc1567d2a1fd886a00adcf0bb01e796bf5aa (patch) | |
| tree | e06e8af3cdec06bd434d73d49ae1811e23fe2190 /src | |
| parent | Use "ffi" namespace. (diff) | |
| download | rust-openssl-7a4fbc1567d2a1fd886a00adcf0bb01e796bf5aa.tar.xz rust-openssl-7a4fbc1567d2a1fd886a00adcf0bb01e796bf5aa.zip | |
Added BigNum::one().
Diffstat (limited to 'src')
| -rw-r--r-- | src/bn/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bn/mod.rs b/src/bn/mod.rs index 7e8697b7..7f33e9ed 100644 --- a/src/bn/mod.rs +++ b/src/bn/mod.rs @@ -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())); |