Struct hacspec_pasta::VestaCanvas
source · Fields§
§b: [u8; 32]
§sign: Sign
§signed: bool
Implementations§
source§impl VestaCanvas
impl VestaCanvas
pub(crate) fn max() -> BigInt
pub fn max_value() -> Self
pub(crate) fn hex_string_to_bytes(s: &str) -> Vec<u8>
pub fn from_literal(x: u128) -> Self
pub fn from_signed_literal(x: i128) -> Self
sourcepub fn pow2(x: usize) -> VestaCanvas
pub fn pow2(x: usize) -> VestaCanvas
Returns 2 to the power of the argument
source§impl VestaCanvas
impl VestaCanvas
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.
source§impl VestaCanvas
impl VestaCanvas
source§impl VestaCanvas
impl VestaCanvas
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> VestaCanvas
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> VestaCanvas
pub fn to_byte_seq_be(self) -> Seq<U8>
Trait Implementations§
source§impl Add<VestaCanvas> for VestaCanvas
impl Add<VestaCanvas> for VestaCanvas
Warning: panics on overflow.
§type Output = VestaCanvas
type Output = VestaCanvas
+
operator.source§fn add(self, rhs: VestaCanvas) -> VestaCanvas
fn add(self, rhs: VestaCanvas) -> VestaCanvas
+
operation. Read moresource§impl BitAnd<VestaCanvas> for VestaCanvas
impl BitAnd<VestaCanvas> for VestaCanvas
source§impl BitOr<VestaCanvas> for VestaCanvas
impl BitOr<VestaCanvas> for VestaCanvas
source§impl BitXor<VestaCanvas> for VestaCanvas
impl BitXor<VestaCanvas> for VestaCanvas
source§impl Clone for VestaCanvas
impl Clone for VestaCanvas
source§fn clone(&self) -> VestaCanvas
fn clone(&self) -> VestaCanvas
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for VestaCanvas
impl Debug for VestaCanvas
source§impl Default for VestaCanvas
impl Default for VestaCanvas
source§fn default() -> VestaCanvas
fn default() -> VestaCanvas
source§impl Display for VestaCanvas
impl Display for VestaCanvas
source§impl Div<VestaCanvas> for VestaCanvas
impl Div<VestaCanvas> for VestaCanvas
Warning: panics on division by 0.
§type Output = VestaCanvas
type Output = VestaCanvas
/
operator.source§fn div(self, rhs: VestaCanvas) -> VestaCanvas
fn div(self, rhs: VestaCanvas) -> VestaCanvas
/
operation. Read moresource§impl From<BigInt> for VestaCanvas
impl From<BigInt> for VestaCanvas
source§fn from(x: BigInt) -> VestaCanvas
fn from(x: BigInt) -> VestaCanvas
source§impl From<BigUint> for VestaCanvas
impl From<BigUint> for VestaCanvas
source§fn from(x: BigUint) -> VestaCanvas
fn from(x: BigUint) -> VestaCanvas
source§impl From<VestaCanvas> for FpVesta
impl From<VestaCanvas> for FpVesta
source§fn from(x: VestaCanvas) -> FpVesta
fn from(x: VestaCanvas) -> FpVesta
source§impl Integer for VestaCanvas
impl Integer for VestaCanvas
source§fn 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
.
source§fn 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 = 255usize
fn ZERO() -> Self
fn ONE() -> Self
fn TWO() -> Self
source§fn from_literal(val: u128) -> Self
fn from_literal(val: u128) -> Self
val
.source§fn from_hex_string(s: &String) -> Self
fn from_hex_string(s: &String) -> Self
Integer
.fn rotate_left(self, n: usize) -> Self
fn rotate_right(self, n: usize) -> Self
source§impl Into<BigInt> for VestaCanvas
impl Into<BigInt> for VestaCanvas
source§impl Into<BigUint> for VestaCanvas
impl Into<BigUint> for VestaCanvas
source§impl Into<VestaCanvas> for FpVesta
impl Into<VestaCanvas> for FpVesta
source§fn into(self) -> VestaCanvas
fn into(self) -> VestaCanvas
source§impl LowerHex for VestaCanvas
impl LowerHex for VestaCanvas
source§impl ModNumeric for VestaCanvas
impl ModNumeric for VestaCanvas
source§fn signed_modulo(self, n: Self) -> Self
fn signed_modulo(self, n: Self) -> Self
self % n
that always returns a positive integer
source§impl Mul<VestaCanvas> for VestaCanvas
impl Mul<VestaCanvas> for VestaCanvas
Warning: panics on overflow.
§type Output = VestaCanvas
type Output = VestaCanvas
*
operator.source§fn mul(self, rhs: VestaCanvas) -> VestaCanvas
fn mul(self, rhs: VestaCanvas) -> VestaCanvas
*
operation. Read moresource§impl Not for VestaCanvas
impl Not for VestaCanvas
source§impl Numeric for VestaCanvas
impl Numeric for VestaCanvas
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
source§impl Ord for VestaCanvas
impl Ord for VestaCanvas
source§fn cmp(&self, other: &VestaCanvas) -> Ordering
fn cmp(&self, other: &VestaCanvas) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<VestaCanvas> for VestaCanvas
impl PartialEq<VestaCanvas> for VestaCanvas
source§fn eq(&self, rhs: &VestaCanvas) -> bool
fn eq(&self, rhs: &VestaCanvas) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<VestaCanvas> for VestaCanvas
impl PartialOrd<VestaCanvas> for VestaCanvas
source§fn partial_cmp(&self, other: &VestaCanvas) -> Option<Ordering>
fn partial_cmp(&self, other: &VestaCanvas) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Rem<VestaCanvas> for VestaCanvas
impl Rem<VestaCanvas> for VestaCanvas
Warning: panics on division by 0.
§type Output = VestaCanvas
type Output = VestaCanvas
%
operator.source§fn rem(self, rhs: VestaCanvas) -> VestaCanvas
fn rem(self, rhs: VestaCanvas) -> VestaCanvas
%
operation. Read moresource§impl Shl<usize> for VestaCanvas
impl Shl<usize> for VestaCanvas
source§impl Shr<usize> for VestaCanvas
impl Shr<usize> for VestaCanvas
source§impl Sub<VestaCanvas> for VestaCanvas
impl Sub<VestaCanvas> for VestaCanvas
Warning: panics on underflow.
§type Output = VestaCanvas
type Output = VestaCanvas
-
operator.source§fn sub(self, rhs: VestaCanvas) -> VestaCanvas
fn sub(self, rhs: VestaCanvas) -> VestaCanvas
-
operation. Read more