[][src]Struct secp256k1::curve::Field

pub struct Field { /* fields omitted */ }

Field element for secp256k1.

Methods

impl Field
[src]

Normalize a field element.

Weakly normalize a field element: reduce it magnitude to 1, but don't fully normalize.

Normalize a field element, without constant-time guarantee.

Verify whether a field element represents zero i.e. would normalize to a zero value. The field implementation may optionally normalize the input, but this should not be relied upon.

Verify whether a field element represents zero i.e. would normalize to a zero value. The field implementation may optionally normalize the input, but this should not be relied upon.

Set a field element equal to a small integer. Resulting field element is normalized.

Verify whether a field element is zero. Requires the input to be normalized.

Check the "oddness" of a field element. Requires the input to be normalized.

Sets a field element equal to zero, initializing all fields.

Set a field element equal to 32-byte big endian value. If successful, the resulting field element is normalized.

Convert a field element to a 32-byte big endian value. Requires the input to be normalized.

Set a field element equal to the additive inverse of another. Takes a maximum magnitude of the input as an argument. The magnitude of the output is one higher.

Multiplies the passed field element with a small integer constant. Multiplies the magnitude by that small integer.

Compare two field elements. Requires both inputs to be normalized.

Sets a field element to be the product of two others. Requires the inputs' magnitudes to be at most 8. The output magnitude is 1 (but not guaranteed to be normalized).

Sets a field element to be the square of another. Requires the input's magnitude to be at most 8. The output magnitude is 1 (but not guaranteed to be normalized).

If a has a square root, it is computed in r and 1 is returned. If a does not have a square root, the root of its negation is computed and 0 is returned. The input's magnitude can be at most 8. The output magnitude is 1 (but not guaranteed to be normalized). The result in r will always be a square itself.

Sets a field element to be the (modular) inverse of another. Requires the input's magnitude to be at most 8. The output magnitude is 1 (but not guaranteed to be normalized).

Potentially faster version of secp256k1_fe_inv, without constant-time guarantee.

Checks whether a field element is a quadratic residue.

If flag is true, set *r equal to *a; otherwise leave it. Constant-time.

Trait Implementations

impl PartialEq<Field> for Field
[src]

This method tests for !=.

impl Eq for Field
[src]

impl Ord for Field
[src]

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl PartialOrd<Field> for Field
[src]

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

impl Debug for Field
[src]

impl Add<Field> for Field
[src]

The resulting type after applying the + operator.

impl<'a, 'b> Add<&'a Field> for &'b Field
[src]

The resulting type after applying the + operator.

impl Mul<Field> for Field
[src]

The resulting type after applying the * operator.

impl<'a, 'b> Mul<&'a Field> for &'b Field
[src]

The resulting type after applying the * operator.

impl<'a> AddAssign<&'a Field> for Field
[src]

impl AddAssign<Field> for Field
[src]

impl<'a> MulAssign<&'a Field> for Field
[src]

impl MulAssign<Field> for Field
[src]

impl Clone for Field
[src]

Performs copy-assignment from source. Read more

impl Default for Field
[src]

Auto Trait Implementations

impl Send for Field

impl Sync for Field

Blanket Implementations

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> From for T
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T
[src]

Should always be Self