[go: up one dir, main page]

logo
pub struct AffinePoint {
    pub x: FieldElement,
    pub y: FieldElement,
    pub infinity: u8,
}
Available on crate feature arithmetic only.
Expand description

NIST P-384 (secp384r1) curve point expressed in affine coordinates.

serde support

When the serde feature of this crate is enabled, the Serialize and Deserialize traits are impl’d for this type.

The serialization uses the SEC1 Elliptic-Curve-Point-to-Octet-String encoding, serialized as binary.

When serialized with a text-based format, the SEC1 representation is subsequently hex encoded.

Fields

x: FieldElement

x-coordinate

y: FieldElement

y-coordinate

infinity: u8

Is this point the point at infinity? 0 = no, 1 = yes

This is a proxy for Choice, but uses u8 instead to permit const constructors for IDENTITY and GENERATOR.

Implementations

Base point of P-384.

Defined in FIPS 186-4 § D.1.2.4:

Gₓ = aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98
     59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7
Gᵧ = 3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c
     e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f

NOTE: coordinate field elements have been translated into the Montgomery domain.

Additive identity of the group: the point at infinity.

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

The resulting type after applying the + operator.

Performs the + operation. Read more

Performs the += operation. Read more

Performs the += operation. Read more

Get the affine x-coordinate as a serialized field element.

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

Determine if two items are equal. Read more

Formats the value using the given formatter. Read more

Attempt to decompress an elliptic curve point.

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

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Attempts to parse the given EncodedPoint as an SEC1-encoded AffinePoint.

Returns

None value if encoded_point is not on the secp384r1 curve.

NOTE: not constant-time with respect to identity point

The encoding of group elements. Read more

Attempts to deserialize a group element, not checking if the element is valid. Read more

Converts this element into its byte encoding. This may or may not support encoding the identity. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

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

This method tests for !=.

Returns the additive identity.

Returns a fixed generator of unknown exponent.

Determines if this point represents the point at infinity; the additive identity. Read more

Converts this element to its curve representation.

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

The resulting type after applying the - operator.

Performs the - operation. Read more

Performs the -= operation. Read more

Performs the -= operation. Read more

Serialize this value as a SEC1 EncodedPoint, optionally applying point compression. 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.

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.

Verify the prehashed message against the provided signature Read more

Verify message digest against the provided signature.

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.

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler. Read more