Struct unsafe_hacspec_examples::curve25519::ScalarCanvas
source · [−]pub struct ScalarCanvas { /* private fields */ }
Implementations
sourceimpl ScalarCanvas
impl ScalarCanvas
sourceimpl ScalarCanvas
impl ScalarCanvas
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 ScalarCanvas
impl ScalarCanvas
sourceimpl ScalarCanvas
impl ScalarCanvas
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> ScalarCanvas
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> ScalarCanvas
pub fn to_byte_seq_be(self) -> Seq<U8>
Trait Implementations
sourceimpl Add<ScalarCanvas> for ScalarCanvas
impl Add<ScalarCanvas> for ScalarCanvas
Warning: panics on overflow.
type Output = ScalarCanvas
type Output = ScalarCanvas
The resulting type after applying the +
operator.
sourcefn add(self, rhs: ScalarCanvas) -> ScalarCanvas
fn add(self, rhs: ScalarCanvas) -> ScalarCanvas
Performs the +
operation. Read more
sourceimpl BitAnd<ScalarCanvas> for ScalarCanvas
impl BitAnd<ScalarCanvas> for ScalarCanvas
sourceimpl BitOr<ScalarCanvas> for ScalarCanvas
impl BitOr<ScalarCanvas> for ScalarCanvas
sourceimpl BitXor<ScalarCanvas> for ScalarCanvas
impl BitXor<ScalarCanvas> for ScalarCanvas
sourceimpl Clone for ScalarCanvas
impl Clone for ScalarCanvas
sourcefn clone(&self) -> ScalarCanvas
fn clone(&self) -> ScalarCanvas
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 ScalarCanvas
impl Debug for ScalarCanvas
sourceimpl Default for ScalarCanvas
impl Default for ScalarCanvas
sourcefn default() -> ScalarCanvas
fn default() -> ScalarCanvas
Returns the “default value” for a type. Read more
sourceimpl Display for ScalarCanvas
impl Display for ScalarCanvas
sourceimpl Div<ScalarCanvas> for ScalarCanvas
impl Div<ScalarCanvas> for ScalarCanvas
Warning: panics on division by 0.
type Output = ScalarCanvas
type Output = ScalarCanvas
The resulting type after applying the /
operator.
sourcefn div(self, rhs: ScalarCanvas) -> ScalarCanvas
fn div(self, rhs: ScalarCanvas) -> ScalarCanvas
Performs the /
operation. Read more
sourceimpl From<BigInt> for ScalarCanvas
impl From<BigInt> for ScalarCanvas
sourcefn from(x: BigInt) -> ScalarCanvas
fn from(x: BigInt) -> ScalarCanvas
Converts to this type from the input type.
sourceimpl From<BigUint> for ScalarCanvas
impl From<BigUint> for ScalarCanvas
sourcefn from(x: BigUint) -> ScalarCanvas
fn from(x: BigUint) -> ScalarCanvas
Converts to this type from the input type.
sourceimpl From<ScalarCanvas> for Scalar
impl From<ScalarCanvas> for Scalar
sourcefn from(x: ScalarCanvas) -> Scalar
fn from(x: ScalarCanvas) -> Scalar
Converts to this type from the input type.
sourceimpl Integer for ScalarCanvas
impl Integer for ScalarCanvas
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 ScalarCanvas
impl Into<BigInt> for ScalarCanvas
sourceimpl Into<BigUint> for ScalarCanvas
impl Into<BigUint> for ScalarCanvas
sourceimpl Into<ScalarCanvas> for Scalar
impl Into<ScalarCanvas> for Scalar
sourcefn into(self) -> ScalarCanvas
fn into(self) -> ScalarCanvas
Converts this type into the (usually inferred) input type.
sourceimpl LowerHex for ScalarCanvas
impl LowerHex for ScalarCanvas
sourceimpl ModNumeric for ScalarCanvas
impl ModNumeric for ScalarCanvas
sourcefn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
sourceimpl Mul<ScalarCanvas> for ScalarCanvas
impl Mul<ScalarCanvas> for ScalarCanvas
Warning: panics on overflow.
type Output = ScalarCanvas
type Output = ScalarCanvas
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: ScalarCanvas) -> ScalarCanvas
fn mul(self, rhs: ScalarCanvas) -> ScalarCanvas
Performs the *
operation. Read more
sourceimpl Not for ScalarCanvas
impl Not for ScalarCanvas
sourceimpl Numeric for ScalarCanvas
impl Numeric for ScalarCanvas
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 ScalarCanvas
impl Ord for ScalarCanvas
sourceimpl PartialEq<ScalarCanvas> for ScalarCanvas
impl PartialEq<ScalarCanvas> for ScalarCanvas
sourceimpl PartialOrd<ScalarCanvas> for ScalarCanvas
impl PartialOrd<ScalarCanvas> for ScalarCanvas
sourcefn partial_cmp(&self, other: &ScalarCanvas) -> Option<Ordering>
fn partial_cmp(&self, other: &ScalarCanvas) -> 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<ScalarCanvas> for ScalarCanvas
impl Rem<ScalarCanvas> for ScalarCanvas
Warning: panics on division by 0.
type Output = ScalarCanvas
type Output = ScalarCanvas
The resulting type after applying the %
operator.
sourcefn rem(self, rhs: ScalarCanvas) -> ScalarCanvas
fn rem(self, rhs: ScalarCanvas) -> ScalarCanvas
Performs the %
operation. Read more
sourceimpl Shl<usize> for ScalarCanvas
impl Shl<usize> for ScalarCanvas
sourceimpl Shr<usize> for ScalarCanvas
impl Shr<usize> for ScalarCanvas
sourceimpl Sub<ScalarCanvas> for ScalarCanvas
impl Sub<ScalarCanvas> for ScalarCanvas
Warning: panics on underflow.
type Output = ScalarCanvas
type Output = ScalarCanvas
The resulting type after applying the -
operator.
sourcefn sub(self, rhs: ScalarCanvas) -> ScalarCanvas
fn sub(self, rhs: ScalarCanvas) -> ScalarCanvas
Performs the -
operation. Read more
impl Copy for ScalarCanvas
impl Eq for ScalarCanvas
impl NumericCopy for ScalarCanvas
impl UnsignedInteger for ScalarCanvas
impl UnsignedIntegerCopy for ScalarCanvas
Auto Trait Implementations
impl RefUnwindSafe for ScalarCanvas
impl Send for ScalarCanvas
impl Sync for ScalarCanvas
impl Unpin for ScalarCanvas
impl UnwindSafe for ScalarCanvas
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