Struct salty::FieldElement[][src]

pub struct FieldElement(pub [i64; 16]);
Expand description

Element of the base field of the elliptic curve

Trait Implementations

Addition of field elements

The resulting type after applying the + operator.

Performs the += operation. Read more

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 swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more

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

Determine if two items are equal. Read more

Formats the value using the given formatter. Read more

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

TODO: figure out why this doesn’t pass the test at the end

Internal representation as limbs

to canonical representation as little-endian bytes

construct from canonical representation as little-endian bytes

construct from possibly non-canonical representation as little-endian bytes

construct from canonical representation as little-endian bytes, with validity check

parity of field element, viewed as integer modulo 2**255 - 19

default implementation, actual implementation may override this with a faster version Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

Performs the *= operation. Read more

Subition of field elements

The resulting type after applying the - operator.

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

This method tests for !=.

Subition of field elements

The resulting type after applying the - operator.

Performs the -= operation. 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

Negate self if choice == Choice(1); otherwise, leave it unchanged. Read more

Performs the conversion.

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.