logo
pub struct EncodedPoint<Size> where
    Size: ModulusSize
{ /* private fields */ }
Expand description

SEC1 encoded curve point.

This type is an enum over the compressed and uncompressed encodings, useful for cases where either encoding can be supported, or conversions between the two forms.

Implementations

Decode elliptic curve point (compressed or uncompressed) from the Elliptic-Curve-Point-to-Octet-String encoding described in SEC 1: Elliptic Curve Cryptography (Version 2.0) section 2.3.3 (page 10).

http://www.secg.org/sec1-v2.pdf

Decode elliptic curve point from raw uncompressed coordinates, i.e. encoded as the concatenated x || y coordinates with no leading SEC1 tag byte (which would otherwise be 0x04 for an uncompressed point).

Encode an elliptic curve point from big endian serialized coordinates (with optional point compression)

Return EncodedPoint representing the additive identity (a.k.a. point at infinity)

Get the length of the encoded point in bytes

Get byte slice containing the serialized EncodedPoint.

Available on crate feature alloc only.

Get boxed byte slice containing the serialized EncodedPoint

Is this EncodedPoint compact?

Is this EncodedPoint compressed?

Is this EncodedPoint the additive identity? (a.k.a. point at infinity)

Compress this EncodedPoint, returning a new EncodedPoint.

Get the SEC1 tag for this EncodedPoint

Get the Coordinates for this EncodedPoint.

Get the x-coordinate for this EncodedPoint.

Returns None if this point is the identity point.

Get the y-coordinate for this EncodedPoint.

Returns None if this point is compressed or the identity point.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Select a or b according to choice. Read more

Conditionally assign other to self, according to choice. Read more

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

Decode a SEC1-encoded point from hexadecimal.

Upper and lower case hexadecimal are both accepted, however mixed case is rejected.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Formats the value using the given formatter.

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Formats the value using the given formatter.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. 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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

Converts the given value to a String. 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.