Struct crypto_bigint::Limb[][src]

#[repr(transparent)]
pub struct Limb(pub LimbUInt);
Expand description

Big integers are represented as an array of smaller CPU word-size integers called “limbs”.

Tuple Fields

0: LimbUInt

Implementations

Computes self + rhs + carry, returning the result along with the new carry.

Perform saturating addition.

Perform wrapping addition, discarding overflow.

Calculates a & b.

Calculates !a.

Calculates a | b.

Calculates a ^ b.

Calculate the number of bits needed to represent this number.

Is this limb an odd number?

Perform a comparison of the inner value in variable-time.

Note that the PartialOrd and Ord impls wrap constant-time comparisons using the subtle crate.

Performs an equality check in variable-time.

Create a Limb from a u8 integer (const-friendly)

Create a Limb from a u16 integer (const-friendly)

Create a Limb from a u32 integer (const-friendly)

Computes self + (b * c) + carry, returning the result along with the new carry.

Perform saturating multiplication.

Perform wrapping multiplication, discarding overflow.

Computes self - (rhs + borrow), returning the result along with the new borrow.

Perform saturating subtraction.

Perform wrapping subtraction, discarding underflow and wrapping around the boundary of the type.

The value 0.

The value 1.

Maximum value this Limb can express.

Size of the inner integer in bits.

Size of the inner integer in bytes.

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

Output type.

Perform checked subtraction, returning a CtOption which is_some only if the operation did not overflow. Read more

Output type.

Perform checked multiplication, returning a CtOption which is_some only if the operation did not overflow. Read more

Output type.

Perform checked subtraction, returning a CtOption which is_some only if the operation did not underflow. 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 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

Determine whether self > other. Read more

Determine whether self < other. Read more

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

Size of this integer in bits.

Size of this integer in bytes.

Byte array representation.

Decode from big endian bytes.

Decode from little endian bytes.

Encode to big endian bytes.

Encode to little endian bytes.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Feeds this value into the given Hasher. Read more

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

Formats the value using the given formatter.

The resulting type after applying the ! operator.

Performs the unary ! operation. Read more

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

Generate a cryptographically secure random value.

Generate a cryptographically secure random number which is less than a given modulus. Read more

Formats the value using the given formatter.

The value 0.

Determine if this value is equal to zero. 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

Performs the conversion.

Performs the conversion.

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)

recently added

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.

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