pub struct Curve25519Subgroup(_);
Expand description

Prime-order subgroup of Curve25519 without any transforms performed for EC points.

Since the curve has cofactor 8, ElementOps::deserialize_element() implementation explicitly checks on deserializing each EC point that the point is torsion-free (belongs to the prime-order subgroup), which is moderately slow (takes ~0.1ms on a laptop).

Prefer using Ristretto if compatibility with other Curve25519 applications is not a concern. (If it is a concern, beware of [cofactor pitfalls]!)

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Element of the group. Arithmetic operations requested here (addition among elements and multiplication by a Scalar) must be constant-time. Read more

Byte size of a serialized Self::Element.

Returns the identity of the group (aka point at infinity for EC groups).

Checks if the specified element is the identity.

Returns the agreed-upon generator of the group.

Serializes element into the provided buffer, which is guaranteed to have length Self::ELEMENT_SIZE. Read more

Deserializes an element from buffer, which is guaranteed to have length Self::ELEMENT_SIZE. This method returns None if the buffer does not correspond to a representation of a valid scalar. Read more

Multiplies the provided scalar by ElementOps::generator(). This operation must be constant-time. Read more

Multiplies the provided scalar by ElementOps::generator(). Unlike Self::mul_generator(), this operation does not need to be constant-time; thus, it may employ additional optimizations. Read more

Multiplies provided scalars by elements. This operation must be constant-time w.r.t. the given length of elements. Read more

Calculates k * k_element + r * G, where G is the group generator. This operation does not need to be constant-time. Read more

Multiplies provided scalars by elements. Unlike Self::multi_mul(), this operation does not need to be constant-time; thus, it may employ additional optimizations. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Scalar type. As per Group contract, scalars must form a prime field. Arithmetic operations on scalars requested here must be constant-time. Read more

Byte size of a serialized Self::Scalar.

Generates a random scalar based on the provided CSPRNG. This operation must be constant-time. Read more

Generates a scalar from a source of random bytes. This operation must be constant-time. The source is guaranteed to return any necessary number of bytes. Read more

Inverts the scalar, which is guaranteed to be non-zero. This operation does not need to be constant-time. Read more

Inverts scalars in a batch. This operation does not need to be constant-time. Read more

Serializes the scalar into the provided buffer, which is guaranteed to have length Self::SCALAR_SIZE. Read more

Deserializes the scalar from buffer, which is guaranteed to have length Self::SCALAR_SIZE. This method returns None if the buffer does not correspond to a representation of a valid scalar. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.