Struct hacspec_lib::prelude::U16Word
source · [−]Expand description
Fixed length byte array.
Tuple Fields
0: [U8; 2]
Implementations
sourceimpl U16Word
impl U16Word
sourcepub fn new() -> Self
pub fn new() -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn length() -> usize
pub fn length() -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn from_array(v: [U8; 2]) -> Self
pub fn from_array(v: [U8; 2]) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn from_native_slice(v: &[U8]) -> Self
pub fn from_native_slice(v: &[U8]) -> Self
Function that is not part of the language but is offered as a helper for tests, etc.
sourceimpl U16Word
impl U16Word
sourcepub fn from_slice<A: SeqTrait<U8>>(input: &A, start: usize, len: usize) -> Self
pub fn from_slice<A: SeqTrait<U8>>(input: &A, start: usize, len: usize) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn concat<A: SeqTrait<U8>>(&self, next: &A) -> Seq<U8>
pub fn concat<A: SeqTrait<U8>>(&self, next: &A) -> Seq<U8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn from_slice_range<A: SeqTrait<U8>>(input: &A, r: Range<usize>) -> Self
pub fn from_slice_range<A: SeqTrait<U8>>(input: &A, r: Range<usize>) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn slice(&self, start_out: usize, len: usize) -> Seq<U8>
pub fn slice(&self, start_out: usize, len: usize) -> Seq<U8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn slice_range(&self, r: Range<usize>) -> Seq<U8>
pub fn slice_range(&self, r: Range<usize>) -> Seq<U8>
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn num_chunks(&self, chunk_size: usize) -> usize
pub fn num_chunks(&self, chunk_size: usize) -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcepub fn get_chunk_len(&self, chunk_size: usize, chunk_number: usize) -> usize
pub fn get_chunk_len(&self, chunk_size: usize, chunk_number: usize) -> usize
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourceimpl U16Word
impl U16Word
sourceimpl U16Word
impl U16Word
Warning: declassifies secret integer types.
sourcepub fn declassify_eq(&self, other: &Self) -> bool
pub fn declassify_eq(&self, other: &Self) -> bool
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourceimpl U16Word
impl U16Word
sourcepub fn to_be_bytes(&self) -> Seq<U8>
pub fn to_be_bytes(&self) -> Seq<U8>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_le_bytes(&self) -> Seq<U8>
pub fn to_le_bytes(&self) -> Seq<U8>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourceimpl U16Word
impl U16Word
sourcepub fn from_public_slice(v: &[u8]) -> U16Word
pub fn from_public_slice(v: &[u8]) -> U16Word
Function that is not part of the language but is offered as a helper for tests, etc.
sourcepub fn to_public_array(&self) -> [u8; 2]
pub fn to_public_array(&self) -> [u8; 2]
Function that is not part of the language but is offered as a helper for tests, etc.
sourceimpl U16Word
impl U16Word
sourcepub fn to_be_U32s(&self) -> Seq<U32>
pub fn to_be_U32s(&self) -> Seq<U32>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_le_U32s(&self) -> Seq<U32>
pub fn to_le_U32s(&self) -> Seq<U32>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_be_U64s(&self) -> Seq<U64>
pub fn to_be_U64s(&self) -> Seq<U64>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_le_U64s(&self) -> Seq<U64>
pub fn to_le_U64s(&self) -> Seq<U64>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_U128s_be(&self) -> Seq<U128>
pub fn to_U128s_be(&self) -> Seq<U128>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn to_U128s_le(&self) -> Seq<U128>
pub fn to_U128s_le(&self) -> Seq<U128>
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
Trait Implementations
sourceimpl ModNumeric for U16Word
impl ModNumeric for U16Word
sourcefn sub_mod(self, _rhs: Self, _n: Self) -> Self
fn sub_mod(self, _rhs: Self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. (self - rhs) % n.
sourcefn add_mod(self, _rhs: Self, _n: Self) -> Self
fn add_mod(self, _rhs: Self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self + rhs) % n
sourcefn mul_mod(self, _rhs: Self, _n: Self) -> Self
fn mul_mod(self, _rhs: Self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self * rhs) % n
sourcefn pow_mod(self, _exp: Self, _n: Self) -> Self
fn pow_mod(self, _exp: Self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
(self ^ exp) % n
sourcefn modulo(self, _n: Self) -> Self
fn modulo(self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self % n
sourcefn absolute(self) -> Self
fn absolute(self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
|self|
(coefficient-wise)
sourcefn signed_modulo(self, _n: Self) -> Self
fn signed_modulo(self, _n: Self) -> Self
self % n
that always returns a positive integer
sourceimpl Numeric for U16Word
impl Numeric for U16Word
sourcefn max_val() -> Self
fn max_val() -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Return largest value that can be represented.
sourcefn wrap_add(self, rhs: Self) -> Self
fn wrap_add(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn wrap_sub(self, rhs: Self) -> Self
fn wrap_sub(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn wrap_mul(self, rhs: Self) -> Self
fn wrap_mul(self, rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn wrap_div(self, _rhs: Self) -> Self
fn wrap_div(self, _rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn exp(self, _exp: u32) -> Self
fn exp(self, _exp: u32) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self ^ exp
where exp
is a u32
.
sourcefn pow_self(self, _exp: Self) -> Self
fn pow_self(self, _exp: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and
call functions whose signatures are in hacspec.
self ^ exp
where exp
is a Self
.
sourcefn divide(self, _rhs: Self) -> Self
fn divide(self, _rhs: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Division.
sourcefn inv(self, _n: Self) -> Self
fn inv(self, _n: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec. Invert self modulo n.
sourcefn equal(self, other: Self) -> bool
fn equal(self, other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than(self, _other: Self) -> bool
fn greater_than(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_or_equal(self, _other: Self) -> bool
fn greater_than_or_equal(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than(self, _other: Self) -> bool
fn less_than(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_or_equal(self, _other: Self) -> bool
fn less_than_or_equal(self, _other: Self) -> bool
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn not_equal_bm(self, _other: Self) -> Self
fn not_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn equal_bm(self, _other: Self) -> Self
fn equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_bm(self, _other: Self) -> Self
fn greater_than_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn greater_than_or_equal_bm(self, _other: Self) -> Self
fn greater_than_or_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_bm(self, _other: Self) -> Self
fn less_than_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn less_than_or_equal_bm(self, _other: Self) -> Self
fn less_than_or_equal_bm(self, _other: Self) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourceimpl SeqTrait<U8> for U16Word
impl SeqTrait<U8> for U16Word
sourcefn create(x: usize) -> Self
fn create(x: usize) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn len(&self) -> usize
fn len(&self) -> usize
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcefn iter(&self) -> Iter<'_, U8>
fn iter(&self) -> Iter<'_, U8>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcefn update_slice<A: SeqTrait<U8>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
fn update_slice<A: SeqTrait<U8>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn update<A: SeqTrait<U8>>(self, start: usize, v: &A) -> Self
fn update<A: SeqTrait<U8>>(self, start: usize, v: &A) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
sourcefn update_start<A: SeqTrait<U8>>(self, v: &A) -> Self
fn update_start<A: SeqTrait<U8>>(self, v: &A) -> Self
This function is within the hacspec subset of Rust: its signature and body use only hacspec constructs and call functions whose signatures are in hacspec.
impl Copy for U16Word
impl NumericCopy for U16Word
Auto Trait Implementations
impl RefUnwindSafe for U16Word
impl Send for U16Word
impl Sync for U16Word
impl Unpin for U16Word
impl UnwindSafe for U16Word
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