[−][src]Struct smc::group::EllipticCurveGroup
A simple wrapper of EcGroup.
It also manages the context for BigNum operations.
In order to create a new EllipticCurveGroup, you can use new
.
Methods
impl EllipticCurveGroup
[src]
pub fn new(secpar: i32, nid: Nid) -> Result<Self, ErrorStack>
[src]
Creates a new EllipticCurveGroup.
Parameters
secpar
: Length of the security parameter in bits.nid
: The numerical identifier for the curve. These curves can be discovered using usingopenssl ecparam -list_curves
command.
Examples
use smc::group::{DLogGroup, EllipticCurveGroup}; use openssl::error::ErrorStack; use openssl::nid::Nid; let group = EllipticCurveGroup::new(128, Nid::SECP224R1); println!("{:#?}", group.unwrap());
Trait Implementations
impl DLogGroup<EcPoint> for EllipticCurveGroup
[src]
fn get_generator(&self) -> &EcPoint
[src]
Caution: this method panics!
fn get_order(&mut self) -> BigNum
[src]
Get the order of the group.
Note: this returns a clone, not a reference to the object.
fn generate_random_element(&self) -> EcPoint
[src]
Generates a random element in the group.
fn generate_random_exponent(&self) -> BigNum
[src]
Generates a random exponent.
fn exponentiate(&mut self, e1: &EcPoint, e2: &BigNum) -> EcPoint
[src]
Despite its name, this method performs a multiplication on the curve.
Indeed it returns an Ecpoint x = e1 * e2
.
fn multiply(&mut self, e1: &EcPoint, e2: &EcPoint) -> EcPoint
[src]
Indeed it returns an Ecpoint x = e1 + e2
.
fn pow(&mut self, pow: &BigNum) -> EcPoint
[src]
Despite its name, this method performs a multiplication for the
group generator g
. Indeed it returns an Ecpoint x = g ^ pow
fn eq(&mut self, e1: &EcPoint, e2: &EcPoint) -> bool
[src]
impl Debug for EllipticCurveGroup
[src]
Auto Trait Implementations
impl RefUnwindSafe for EllipticCurveGroup
impl Send for EllipticCurveGroup
impl Sync for EllipticCurveGroup
impl Unpin for EllipticCurveGroup
impl UnwindSafe for EllipticCurveGroup
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,