# [−][src]Enum sequoia_openpgp::constants::Curve

Elliptic curves used in OpenPGP.

`PublicKeyAlgorithm`

does not differentiate between elliptic
curves. Instead, the curve is specified using an OID prepended to
the key material. We provide this type to be able to match on the
curves.

## Variants

`NistP256`

NIST curve P-256.

`NistP384`

NIST curve P-384.

`NistP521`

NIST curve P-521.

`BrainpoolP256`

brainpoolP256r1.

`BrainpoolP512`

brainpoolP512r1.

`Ed25519`

D.J. Bernstein's "Twisted" Edwards curve Ed25519.

`Cv25519`

Elliptic curve Diffie-Hellman using D.J. Bernstein's Curve25519.

`Unknown(Box<[u8]>)`

Unknown curve.

## Methods

`impl Curve`

[src]

`pub fn bits(&self) -> Option<usize>`

[src]

Returns the length of public keys over this curve in bits.

For the Kobliz curves this is the size of the underlying finite field. For X25519 it is 256.

Note: This information is useless and should not be used to gauge the security of a particular curve. This function exists only because some legacy PGP application like HKP need it.

Returns `None`

for unknown curves.

`impl Curve`

[src]

`pub fn from_oid(oid: &[u8]) -> Curve`

[src]

Parses the given OID.

`pub fn oid(&self) -> &[u8]`

[src]

Returns this curve's OID.

`pub fn len(&self) -> Result<usize>`

[src]

Returns the length of a coordinate in bits.

# Errors

Returns `Error::UnsupportedEllipticCurve`

if the curve is not
supported.

`pub fn is_supported(&self) -> bool`

[src]

Returns whether this algorithm is supported.

## Trait Implementations

`impl Eq for Curve`

[src]

`impl PartialOrd<Curve> for Curve`

[src]

`fn partial_cmp(&self, other: &Curve) -> Option<Ordering>`

[src]

`fn lt(&self, other: &Curve) -> bool`

[src]

`fn le(&self, other: &Curve) -> bool`

[src]

`fn gt(&self, other: &Curve) -> bool`

[src]

`fn ge(&self, other: &Curve) -> bool`

[src]

`impl PartialEq<Curve> for Curve`

[src]

`impl Clone for Curve`

[src]

`fn clone(&self) -> Curve`

[src]

`fn clone_from(&mut self, source: &Self)`

1.0.0[src]

Performs copy-assignment from `source`

. Read more

`impl Ord for Curve`

[src]

`fn cmp(&self, other: &Curve) -> Ordering`

[src]

`fn max(self, other: Self) -> Self`

1.21.0[src]

Compares and returns the maximum of two values. Read more

`fn min(self, other: Self) -> Self`

1.21.0[src]

Compares and returns the minimum of two values. Read more

`impl Display for Curve`

[src]

`impl Hash for Curve`

[src]

`fn hash<__H: Hasher>(&self, state: &mut __H)`

[src]

`fn hash_slice<H>(data: &[Self], state: &mut H) where`

H: Hasher,

1.3.0[src]

H: Hasher,

Feeds a slice of this type into the given [`Hasher`

]. Read more

`impl Debug for Curve`

[src]

`impl Arbitrary for Curve`

[src]

## Auto Trait Implementations

## Blanket Implementations

`impl<T> From for T`

[src]

`impl<T, U> Into for T where`

U: From<T>,

[src]

U: From<T>,

`impl<T> ToOwned for T where`

T: Clone,

[src]

T: Clone,

`impl<T> ToString for T where`

T: Display + ?Sized,

[src]

T: Display + ?Sized,

`impl<T, U> TryFrom 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> Borrow for T where`

T: ?Sized,

[src]

T: ?Sized,

`impl<T> BorrowMut for T where`

T: ?Sized,

[src]

T: ?Sized,

`fn borrow_mut(&mut self) -> &mut T`

[src]

`impl<T> Any for T where`

T: 'static + ?Sized,

[src]

T: 'static + ?Sized,

`impl<T, U> TryInto for T where`

U: TryFrom<T>,

[src]

U: TryFrom<T>,

`type Error = <U as TryFrom<T>>::Error`

The type returned in the event of a conversion error.

`fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`

[src]

`impl<V, T> VZip for T where`

V: MultiLane<T>,

V: MultiLane<T>,