Commit 6d642923 authored by Lukas Lihotzki's avatar Lukas Lihotzki
Browse files

Add EC_GROUP_order_bits

parent dc72a8e2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -61,6 +61,8 @@ extern "C" {

    pub fn EC_GROUP_get_degree(group: *const EC_GROUP) -> c_int;

    pub fn EC_GROUP_order_bits(group: *const EC_GROUP) -> c_int;

    pub fn EC_GROUP_new_curve_GFp(
        p: *const BIGNUM,
        a: *const BIGNUM,
+9 −0
Original line number Diff line number Diff line
@@ -228,6 +228,15 @@ impl EcGroupRef {
        unsafe { ffi::EC_GROUP_get_degree(self.as_ptr()) as u32 }
    }

    /// Returns the number of bits in the group order.
    ///
    /// OpenSSL documentation at [`EC_GROUP_order_bits`]
    ///
    /// [`EC_GROUP_order_bits`]: https://www.openssl.org/docs/man1.1.0/crypto/EC_GROUP_order_bits.html
    pub fn order_bits(&self) -> u32 {
        unsafe { ffi::EC_GROUP_order_bits(self.as_ptr()) as u32 }
    }

    /// Returns the generator for the given curve as a [`EcPoint`].
    ///
    /// OpenSSL documentation at [`EC_GROUP_get0_generator`]