Commit b56908a3 authored by Steven Fackler's avatar Steven Fackler
Browse files

Take a c_ulong directly in BN construction

Closes #416
parent 7ca5ccf0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -584,9 +584,9 @@ impl BigNum {
    }

    /// Creates a new `BigNum` with the given value.
    pub fn new_from(n: u64) -> Result<BigNum, ErrorStack> {
    pub fn new_from(n: c_ulong) -> Result<BigNum, ErrorStack> {
        BigNum::new().and_then(|v| unsafe {
            try_ssl!(ffi::BN_set_word(v.raw(), n as c_ulong));
            try_ssl!(ffi::BN_set_word(v.raw(), n));
            Ok(v)
        })
    }