Struct hacspec_pasta::PallasCanvas
source · Fields§
§b: [u8; 32]
§sign: Sign
§signed: bool
Implementations§
source§impl PallasCanvas
impl PallasCanvas
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) -> PallasCanvas
pub fn pow2(x: usize) -> PallasCanvas
Returns 2 to the power of the argument
source§impl PallasCanvas
impl PallasCanvas
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 PallasCanvas
impl PallasCanvas
source§impl PallasCanvas
impl PallasCanvas
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> PallasCanvas
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> PallasCanvas
pub fn to_byte_seq_be(self) -> Seq<U8>
Trait Implementations§
source§impl Add<PallasCanvas> for PallasCanvas
impl Add<PallasCanvas> for PallasCanvas
Warning: panics on overflow.
§type Output = PallasCanvas
type Output = PallasCanvas
+
operator.source§fn add(self, rhs: PallasCanvas) -> PallasCanvas
fn add(self, rhs: PallasCanvas) -> PallasCanvas
+
operation. Read moresource§impl BitAnd<PallasCanvas> for PallasCanvas
impl BitAnd<PallasCanvas> for PallasCanvas
source§impl BitOr<PallasCanvas> for PallasCanvas
impl BitOr<PallasCanvas> for PallasCanvas
source§impl BitXor<PallasCanvas> for PallasCanvas
impl BitXor<PallasCanvas> for PallasCanvas
source§impl Clone for PallasCanvas
impl Clone for PallasCanvas
source§fn clone(&self) -> PallasCanvas
fn clone(&self) -> PallasCanvas
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PallasCanvas
impl Debug for PallasCanvas
source§impl Default for PallasCanvas
impl Default for PallasCanvas
source§fn default() -> PallasCanvas
fn default() -> PallasCanvas
source§impl Display for PallasCanvas
impl Display for PallasCanvas
source§impl Div<PallasCanvas> for PallasCanvas
impl Div<PallasCanvas> for PallasCanvas
Warning: panics on division by 0.
§type Output = PallasCanvas
type Output = PallasCanvas
/
operator.source§fn div(self, rhs: PallasCanvas) -> PallasCanvas
fn div(self, rhs: PallasCanvas) -> PallasCanvas
/
operation. Read moresource§impl From<BigInt> for PallasCanvas
impl From<BigInt> for PallasCanvas
source§fn from(x: BigInt) -> PallasCanvas
fn from(x: BigInt) -> PallasCanvas
source§impl From<BigUint> for PallasCanvas
impl From<BigUint> for PallasCanvas
source§fn from(x: BigUint) -> PallasCanvas
fn from(x: BigUint) -> PallasCanvas
source§impl From<PallasCanvas> for FpPallas
impl From<PallasCanvas> for FpPallas
source§fn from(x: PallasCanvas) -> FpPallas
fn from(x: PallasCanvas) -> FpPallas
source§impl Integer for PallasCanvas
impl Integer for PallasCanvas
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 PallasCanvas
impl Into<BigInt> for PallasCanvas
source§impl Into<BigUint> for PallasCanvas
impl Into<BigUint> for PallasCanvas
source§impl Into<PallasCanvas> for FpPallas
impl Into<PallasCanvas> for FpPallas
source§fn into(self) -> PallasCanvas
fn into(self) -> PallasCanvas
source§impl LowerHex for PallasCanvas
impl LowerHex for PallasCanvas
source§impl ModNumeric for PallasCanvas
impl ModNumeric for PallasCanvas
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<PallasCanvas> for PallasCanvas
impl Mul<PallasCanvas> for PallasCanvas
Warning: panics on overflow.
§type Output = PallasCanvas
type Output = PallasCanvas
*
operator.source§fn mul(self, rhs: PallasCanvas) -> PallasCanvas
fn mul(self, rhs: PallasCanvas) -> PallasCanvas
*
operation. Read moresource§impl Not for PallasCanvas
impl Not for PallasCanvas
source§impl Numeric for PallasCanvas
impl Numeric for PallasCanvas
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 PallasCanvas
impl Ord for PallasCanvas
source§fn cmp(&self, other: &PallasCanvas) -> Ordering
fn cmp(&self, other: &PallasCanvas) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<PallasCanvas> for PallasCanvas
impl PartialEq<PallasCanvas> for PallasCanvas
source§fn eq(&self, rhs: &PallasCanvas) -> bool
fn eq(&self, rhs: &PallasCanvas) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<PallasCanvas> for PallasCanvas
impl PartialOrd<PallasCanvas> for PallasCanvas
source§fn partial_cmp(&self, other: &PallasCanvas) -> Option<Ordering>
fn partial_cmp(&self, other: &PallasCanvas) -> 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<PallasCanvas> for PallasCanvas
impl Rem<PallasCanvas> for PallasCanvas
Warning: panics on division by 0.
§type Output = PallasCanvas
type Output = PallasCanvas
%
operator.source§fn rem(self, rhs: PallasCanvas) -> PallasCanvas
fn rem(self, rhs: PallasCanvas) -> PallasCanvas
%
operation. Read moresource§impl Shl<usize> for PallasCanvas
impl Shl<usize> for PallasCanvas
source§impl Shr<usize> for PallasCanvas
impl Shr<usize> for PallasCanvas
source§impl Sub<PallasCanvas> for PallasCanvas
impl Sub<PallasCanvas> for PallasCanvas
Warning: panics on underflow.
§type Output = PallasCanvas
type Output = PallasCanvas
-
operator.source§fn sub(self, rhs: PallasCanvas) -> PallasCanvas
fn sub(self, rhs: PallasCanvas) -> PallasCanvas
-
operation. Read more