Struct hacspec_pasta::FpVesta
source · pub struct FpVesta(pub(crate) VestaCanvas);
Tuple Fields§
§0: VestaCanvas
Implementations§
source§impl FpVesta
impl FpVesta
pub fn from_canvas(x: VestaCanvas) -> FpVesta
pub fn into_canvas(self) -> VestaCanvas
pub fn max() -> VestaCanvas
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 FpVesta
impl FpVesta
pub fn from_byte_seq_be<A: SeqTrait<U8>>(s: &A) -> FpVesta
pub fn from_public_byte_seq_be<A: SeqTrait<u8>>(s: A) -> FpVesta
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) -> FpVesta
pub fn from_public_byte_seq_le<A: SeqTrait<u8>>(s: A) -> FpVesta
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) -> FpVesta
Trait Implementations§
source§impl From<VestaCanvas> for FpVesta
impl From<VestaCanvas> for FpVesta
source§fn from(x: VestaCanvas) -> FpVesta
fn from(x: VestaCanvas) -> FpVesta
Converts to this type from the input type.
source§impl Integer for FpVesta
impl Integer for FpVesta
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<VestaCanvas> for FpVesta
impl Into<VestaCanvas> for FpVesta
source§fn into(self) -> VestaCanvas
fn into(self) -> VestaCanvas
Converts this type into the (usually inferred) input type.
source§impl ModNumeric for FpVesta
impl ModNumeric for FpVesta
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 FpVesta
impl Numeric for FpVesta
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 FpVesta
impl Ord for FpVesta
source§impl PartialEq<FpVesta> for FpVesta
impl PartialEq<FpVesta> for FpVesta
source§impl PartialOrd<FpVesta> for FpVesta
impl PartialOrd<FpVesta> for FpVesta
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