Commit 82eb3c4f authored by Steven Fackler's avatar Steven Fackler
Browse files

Add EcKey::check_key

parent 35f11d55
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1391,6 +1391,7 @@ extern {
    pub fn EC_KEY_set_private_key(key: *mut EC_KEY, key: *const BIGNUM) -> c_int;
    pub fn EC_KEY_get0_private_key(key: *const EC_KEY) -> *const BIGNUM;
    pub fn EC_KEY_generate_key(key: *mut EC_KEY) -> c_int;
    pub fn EC_KEY_check_key(key: *const EC_KEY) -> c_int;
    pub fn EC_KEY_free(key: *mut EC_KEY);

    pub fn EC_GFp_simple_method() -> *const EC_METHOD;
+5 −0
Original line number Diff line number Diff line
@@ -249,6 +249,11 @@ impl EcKeyRef {
            }
        }
    }

    /// Checks the key for validity.
    pub fn check_key(&self) -> Result<(), ErrorStack> {
        unsafe { cvt(ffi::EC_KEY_check_key(self.as_ptr())).map(|_| ()) }
    }
}

impl EcKey {