Struct unsafe_hacspec_examples::ec::p256::FieldCanvas
source · [−]pub struct FieldCanvas { /* private fields */ }
Implementations
sourceimpl FieldCanvas
impl FieldCanvas
sourceimpl FieldCanvas
impl FieldCanvas
pub fn from_hex(s: &str) -> Self
pub fn from_be_bytes(v: &[u8]) -> Self
pub fn from_le_bytes(v: &[u8]) -> Self
pub fn to_be_bytes(self) -> [u8; 32]
pub fn to_le_bytes(self) -> [u8; 32]
sourcepub fn comp_eq(self, rhs: Self) -> Self
pub fn comp_eq(self, rhs: Self) -> Self
Produces a new integer which is all ones if the two arguments are equal and
all zeroes otherwise.
NOTE: This is not constant time but BigInt
generally isn’t.
sourcepub fn comp_ne(self, rhs: Self) -> Self
pub fn comp_ne(self, rhs: Self) -> Self
Produces a new integer which is all ones if the first argument is different from
the second argument, and all zeroes otherwise.
NOTE: This is not constant time but BigInt
generally isn’t.
sourcepub fn comp_gte(self, rhs: Self) -> Self
pub fn comp_gte(self, rhs: Self) -> Self
Produces a new integer which is all ones if the first argument is greater than or
equal to the second argument, and all zeroes otherwise.
NOTE: This is not constant time but BigInt
generally isn’t.
sourcepub fn comp_gt(self, rhs: Self) -> Self
pub fn comp_gt(self, rhs: Self) -> Self
Produces a new integer which is all ones if the first argument is strictly greater
than the second argument, and all zeroes otherwise.
NOTE: This is not constant time but BigInt
generally isn’t.
sourceimpl FieldCanvas
impl FieldCanvas
sourceimpl FieldCanvas
impl FieldCanvas
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> FieldCanvas
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> FieldCanvas
pub fn to_byte_seq_be(self) -> Seq<U8>
Trait Implementations
sourceimpl Add<FieldCanvas> for FieldCanvas
impl Add<FieldCanvas> for FieldCanvas
Warning: panics on overflow.
type Output = FieldCanvas
type Output = FieldCanvas
The resulting type after applying the +
operator.
sourcefn add(self, rhs: FieldCanvas) -> FieldCanvas
fn add(self, rhs: FieldCanvas) -> FieldCanvas
Performs the +
operation. Read more
sourceimpl BitAnd<FieldCanvas> for FieldCanvas
impl BitAnd<FieldCanvas> for FieldCanvas
sourceimpl BitOr<FieldCanvas> for FieldCanvas
impl BitOr<FieldCanvas> for FieldCanvas
sourceimpl BitXor<FieldCanvas> for FieldCanvas
impl BitXor<FieldCanvas> for FieldCanvas
sourceimpl Clone for FieldCanvas
impl Clone for FieldCanvas
sourcefn clone(&self) -> FieldCanvas
fn clone(&self) -> FieldCanvas
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FieldCanvas
impl Debug for FieldCanvas
sourceimpl Default for FieldCanvas
impl Default for FieldCanvas
sourcefn default() -> FieldCanvas
fn default() -> FieldCanvas
Returns the “default value” for a type. Read more
sourceimpl Display for FieldCanvas
impl Display for FieldCanvas
sourceimpl Div<FieldCanvas> for FieldCanvas
impl Div<FieldCanvas> for FieldCanvas
Warning: panics on division by 0.
type Output = FieldCanvas
type Output = FieldCanvas
The resulting type after applying the /
operator.
sourcefn div(self, rhs: FieldCanvas) -> FieldCanvas
fn div(self, rhs: FieldCanvas) -> FieldCanvas
Performs the /
operation. Read more
sourceimpl From<BigInt> for FieldCanvas
impl From<BigInt> for FieldCanvas
sourcefn from(x: BigInt) -> FieldCanvas
fn from(x: BigInt) -> FieldCanvas
Converts to this type from the input type.
sourceimpl From<BigUint> for FieldCanvas
impl From<BigUint> for FieldCanvas
sourcefn from(x: BigUint) -> FieldCanvas
fn from(x: BigUint) -> FieldCanvas
Converts to this type from the input type.
sourceimpl From<FieldCanvas> for FieldElement
impl From<FieldCanvas> for FieldElement
sourcefn from(x: FieldCanvas) -> FieldElement
fn from(x: FieldCanvas) -> FieldElement
Converts to this type from the input type.
sourceimpl Integer for FieldCanvas
impl Integer for FieldCanvas
sourcefn set_bit(self, b: Self, i: usize) -> Self
fn set_bit(self, b: Self, i: usize) -> Self
Set bit i
of this integer to b
and return the result.
Bit b
has to be 0
or 1
.
sourcefn set(self, pos: usize, y: Self, yi: usize) -> Self
fn set(self, pos: usize, y: Self, yi: usize) -> Self
Set bit pos
of this integer to bit yi
of integer y
.
const NUM_BITS: usize = 256usize
fn ZERO() -> Self
fn ONE() -> Self
fn TWO() -> Self
sourcefn from_literal(val: u128) -> Self
fn from_literal(val: u128) -> Self
Get an integer with value val
.
sourcefn from_hex_string(s: &String) -> Self
fn from_hex_string(s: &String) -> Self
Read a hex string (starting with 0x) into an Integer
.
fn rotate_left(self, n: usize) -> Self
fn rotate_right(self, n: usize) -> Self
sourceimpl Into<BigInt> for FieldCanvas
impl Into<BigInt> for FieldCanvas
sourceimpl Into<BigUint> for FieldCanvas
impl Into<BigUint> for FieldCanvas
sourceimpl Into<FieldCanvas> for FieldElement
impl Into<FieldCanvas> for FieldElement
sourcefn into(self) -> FieldCanvas
fn into(self) -> FieldCanvas
Converts this type into the (usually inferred) input type.
sourceimpl LowerHex for FieldCanvas
impl LowerHex for FieldCanvas
sourceimpl ModNumeric for FieldCanvas
impl ModNumeric for FieldCanvas
sourcefn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
sourceimpl Mul<FieldCanvas> for FieldCanvas
impl Mul<FieldCanvas> for FieldCanvas
Warning: panics on overflow.
type Output = FieldCanvas
type Output = FieldCanvas
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: FieldCanvas) -> FieldCanvas
fn mul(self, rhs: FieldCanvas) -> FieldCanvas
Performs the *
operation. Read more
sourceimpl Not for FieldCanvas
impl Not for FieldCanvas
sourceimpl Numeric for FieldCanvas
impl Numeric for FieldCanvas
fn wrap_add(self, rhs: Self) -> Self
fn wrap_sub(self, rhs: Self) -> Self
fn wrap_mul(self, rhs: Self) -> Self
fn wrap_div(self, rhs: Self) -> Self
fn equal(self, other: Self) -> bool
fn greater_than(self, other: Self) -> bool
fn greater_than_or_equal(self, other: Self) -> bool
fn less_than(self, other: Self) -> bool
fn less_than_or_equal(self, other: Self) -> bool
fn not_equal_bm(self, other: Self) -> Self
fn equal_bm(self, other: Self) -> Self
fn greater_than_bm(self, other: Self) -> Self
fn greater_than_or_equal_bm(self, other: Self) -> Self
fn less_than_bm(self, other: Self) -> Self
fn less_than_or_equal_bm(self, other: Self) -> Self
sourceimpl Ord for FieldCanvas
impl Ord for FieldCanvas
sourceimpl PartialEq<FieldCanvas> for FieldCanvas
impl PartialEq<FieldCanvas> for FieldCanvas
sourceimpl PartialOrd<FieldCanvas> for FieldCanvas
impl PartialOrd<FieldCanvas> for FieldCanvas
sourcefn partial_cmp(&self, other: &FieldCanvas) -> Option<Ordering>
fn partial_cmp(&self, other: &FieldCanvas) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl Rem<FieldCanvas> for FieldCanvas
impl Rem<FieldCanvas> for FieldCanvas
Warning: panics on division by 0.
type Output = FieldCanvas
type Output = FieldCanvas
The resulting type after applying the %
operator.
sourcefn rem(self, rhs: FieldCanvas) -> FieldCanvas
fn rem(self, rhs: FieldCanvas) -> FieldCanvas
Performs the %
operation. Read more
sourceimpl Shl<usize> for FieldCanvas
impl Shl<usize> for FieldCanvas
sourceimpl Shr<usize> for FieldCanvas
impl Shr<usize> for FieldCanvas
sourceimpl Sub<FieldCanvas> for FieldCanvas
impl Sub<FieldCanvas> for FieldCanvas
Warning: panics on underflow.
type Output = FieldCanvas
type Output = FieldCanvas
The resulting type after applying the -
operator.
sourcefn sub(self, rhs: FieldCanvas) -> FieldCanvas
fn sub(self, rhs: FieldCanvas) -> FieldCanvas
Performs the -
operation. Read more
impl Copy for FieldCanvas
impl Eq for FieldCanvas
impl NumericCopy for FieldCanvas
impl UnsignedInteger for FieldCanvas
impl UnsignedIntegerCopy for FieldCanvas
Auto Trait Implementations
impl RefUnwindSafe for FieldCanvas
impl Send for FieldCanvas
impl Sync for FieldCanvas
impl Unpin for FieldCanvas
impl UnwindSafe for FieldCanvas
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more