Struct hacspec_pasta::FpPallas
source · pub struct FpPallas(pub(crate) PallasCanvas);
Tuple Fields§
§0: PallasCanvas
Implementations§
source§impl FpPallas
impl FpPallas
pub fn from_canvas(x: PallasCanvas) -> FpPallas
pub fn into_canvas(self) -> PallasCanvas
pub fn max() -> PallasCanvas
pub fn declassify(self) -> BigInt
pub fn from_hex(s: &str) -> Self
pub fn from_be_bytes(v: &[u8]) -> Self
pub fn to_be_bytes(self) -> Vec<u8>
pub fn from_le_bytes(v: &[u8]) -> Self
pub fn to_le_bytes(self) -> Vec<u8>
pub fn from_literal(x: u128) -> Self
pub fn from_signed_literal(x: i128) -> Self
pub fn comp_eq(self, rhs: Self) -> Self
pub fn comp_ne(self, rhs: Self) -> Self
pub fn comp_gte(self, rhs: Self) -> Self
pub fn comp_gt(self, rhs: Self) -> Self
pub fn comp_lte(self, rhs: Self) -> Self
pub fn comp_lt(self, rhs: Self) -> Self
source§impl FpPallas
impl FpPallas
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> FpPallas
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> FpPallas
pub fn to_byte_seq_be(self) -> Seq<U8>
pub fn to_public_byte_seq_be(self) -> Seq<u8>
pub fn from_byte_seq_le<A: SeqTrait<U8>>(s: A) -> FpPallas
pub fn from_public_byte_seq_le<A: SeqTrait<u8>>(s: A) -> FpPallas
pub fn to_byte_seq_le(self) -> Seq<U8>
pub fn to_public_byte_seq_le(self) -> Seq<u8>
pub fn from_secret_literal(x: U128) -> FpPallas
Trait Implementations§
source§impl From<PallasCanvas> for FpPallas
impl From<PallasCanvas> for FpPallas
source§fn from(x: PallasCanvas) -> FpPallas
fn from(x: PallasCanvas) -> FpPallas
Converts to this type from the input type.
source§impl Integer for FpPallas
impl Integer for FpPallas
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
Get an integer with value
val
.source§fn 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
source§impl Into<PallasCanvas> for FpPallas
impl Into<PallasCanvas> for FpPallas
source§fn into(self) -> PallasCanvas
fn into(self) -> PallasCanvas
Converts this type into the (usually inferred) input type.
source§impl ModNumeric for FpPallas
impl ModNumeric for FpPallas
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 Numeric for FpPallas
impl Numeric for FpPallas
source§fn inv(self, n: Self) -> Self
fn inv(self, n: Self) -> Self
Invert self modulo n.
NOTE: n
is ignored and inversion is done with respect to
the modulus.
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 FpPallas
impl Ord for FpPallas
source§impl PartialEq<FpPallas> for FpPallas
impl PartialEq<FpPallas> for FpPallas
source§impl PartialOrd<FpPallas> for FpPallas
impl PartialOrd<FpPallas> for FpPallas
1.0.0 · source§fn 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