# Module openssl::ec [−] [src]

Elliptic Curve

Cryptology relies on the difficulty of solving mathematical problems, such as the factor of large integers composed of two large prime numbers and the discrete logarithm of a random eliptic curve. This module provides low-level features of the latter. Elliptic Curve protocols can provide the same security with smaller keys.

There are 2 forms of elliptic curves, `Fp` and `F2^m`. These curves use irreducible trinomial or pentanomial . Being a generic interface to a wide range of algorithms, the cuves are generally referenced by `EcGroup`. There are many built in groups found in `Nid`.

OpenSSL Wiki explains the fields and curves in detail at Eliptic Curve Cryptography.

# Examples

```use openssl::ec::{EcGroup, EcPoint};
use openssl::nid;
use openssl::error::ErrorStack;
fn get_ec_point() -> Result< EcPoint, ErrorStack > {
let group = EcGroup::from_curve_name(nid::SECP224R1)?;
let point = EcPoint::new(&group)?;
Ok(point)
}```

## Structs

 Asn1Flag Named Curve or Explicit EcGroup Describes the curve EcGroupRef Reference to `EcGroup` EcKey Public and optional Private key on the given curve EcKeyBuilder Builder pattern for key generation EcKeyBuilderRef Reference to `EcKeyBuilder` EcKeyRef Reference to `EcKey` EcPoint Represents a point on the curve EcPointRef Reference to `EcPoint` PointConversionForm Compressed or Uncompressed conversion

## Constants

 EXPLICIT_CURVE Curve defined using polynomial parameters NAMED_CURVE Standard Curves POINT_CONVERSION_COMPRESSED Compressed conversion from point value (Default) POINT_CONVERSION_HYBRID Performs both compressed and uncompressed conversions POINT_CONVERSION_UNCOMPRESSED Uncompressed conversion from point value (Binary curve default)