Struct hacspec_lib::seq::SecretSeq
source · [−]pub struct SecretSeq<T: Default + SecretInteger> { /* private fields */ }
Expand description
Variable length byte arrays.
Implementations
sourceimpl<T: Clone + Default + SecretInteger> SecretSeq<T>
impl<T: Clone + Default + SecretInteger> SecretSeq<T>
sourcepub fn new(l: usize) -> Self
pub fn new(l: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn with_capacity(l: usize) -> Self
pub fn with_capacity(l: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn reserve(self, additional: usize) -> Self
pub fn reserve(self, additional: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec Get the size of this sequence.
sourcepub fn slice(&self, start_out: usize, len: usize) -> Self
pub fn slice(&self, start_out: 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 native_slice(&self) -> &[T]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
pub fn native_slice(&self) -> &[T]ⓘNotable traits for &[u8]impl<'_> Read for &[u8]impl<'_> Write for &mut [u8]
Function that is not part of the language but is offered as a helper for tests, etc.
sourcepub fn into_slice(self, start_out: usize, len: usize) -> Self
pub fn into_slice(self, start_out: usize, len: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn slice_range(&self, r: Range<usize>) -> Self
pub fn slice_range(&self, 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 into_slice_range(self, r: Range<usize>) -> Self
pub fn into_slice_range(self, r: Range<usize>) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn split_off(self, at: usize) -> (Self, Self)
pub fn split_off(self, at: usize) -> (Self, Self)
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn pop(self) -> (T, Self)
pub fn pop(self) -> (T, Self)
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn truncate(self, len: usize) -> Self
pub fn truncate(self, len: usize) -> Self
This function can be called from hacspec programs but its body features Rust constructs that are not part of hacspec
sourcepub fn from_slice<A: SeqTrait<T>>(input: &A, start: usize, len: usize) -> Self
pub fn from_slice<A: SeqTrait<T>>(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<T>>(&self, next: &A) -> Self
pub fn concat<A: SeqTrait<T>>(&self, next: &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.
sourcepub fn concat_owned(self, next: Self) -> Self
pub fn concat_owned(self, next: 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.
sourcepub fn push(&self, next: &T) -> Self
pub fn push(&self, next: &T) -> 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 push_owned(self, next: T) -> Self
pub fn push_owned(self, next: T) -> 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 from_slice_range<A: SeqTrait<T>>(input: &A, r: Range<usize>) -> Self
pub fn from_slice_range<A: SeqTrait<T>>(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 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 num_exact_chunks(&self, chunk_size: usize) -> usize
pub fn num_exact_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.
Get the number of chunks of chunk_size
in this array.
There might be less than chunk_size
remaining elements in this
array beyond these.
sourcepub fn get_chunk(&self, chunk_size: usize, chunk_number: usize) -> (usize, Self)
pub fn get_chunk(&self, chunk_size: usize, chunk_number: usize) -> (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 get_exact_chunk(&self, chunk_size: usize, chunk_number: usize) -> Self
pub fn get_exact_chunk(&self, chunk_size: usize, chunk_number: 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.
Get the chunk_number
chunk of chunk_size
from this array
as Seq<T>
.
The resulting sequence is of exactly chunk_size
length.
Until #84 is fixed this returns an empty sequence if not enough
elements are left.
sourcepub fn get_remainder_chunk(&self, chunk_size: usize) -> Self
pub fn get_remainder_chunk(&self, chunk_size: 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.
Get the remaining chunk of this array of length less than
chunk_size
.
If there’s no remainder, i.e. if the length of this array can
be divided by chunk_size
without a remainder, the function
returns an empty sequence (until #84 is fixed).
sourcepub fn set_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &A
) -> Self
pub fn set_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &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.
sourcepub fn set_exact_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &A
) -> Self
pub fn set_exact_chunk<A: SeqTrait<T>>(
self,
chunk_size: usize,
chunk_number: usize,
input: &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.
sourcepub fn update_owned(self, start_out: usize, v: Self) -> Self
pub fn update_owned(self, start_out: usize, v: 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<T: Clone + Default + SecretInteger> SecretSeq<T>
impl<T: Clone + Default + SecretInteger> SecretSeq<T>
Trait Implementations
sourceimpl<T: Clone + Default + SecretInteger> SeqTrait<T> for SecretSeq<T>
impl<T: Clone + Default + SecretInteger> SeqTrait<T> for SecretSeq<T>
sourcefn create(l: usize) -> Self
fn create(l: 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.
Get a new sequence of capacity l
.
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<'_, T>
fn iter(&self) -> Iter<'_, T>
Function that is not part of the language but is offered as a helper for tests, etc.
sourcefn update_slice<A: SeqTrait<T>>(
self,
start_out: usize,
v: &A,
start_in: usize,
len: usize
) -> Self
fn update_slice<A: SeqTrait<T>>(
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<T>>(self, start: usize, v: &A) -> Self
fn update<A: SeqTrait<T>>(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<T>>(self, v: &A) -> Self
fn update_start<A: SeqTrait<T>>(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.
Auto Trait Implementations
impl<T> RefUnwindSafe for SecretSeq<T> where
T: RefUnwindSafe,
impl<T> Send for SecretSeq<T> where
T: Send,
impl<T> Sync for SecretSeq<T> where
T: Sync,
impl<T> Unpin for SecretSeq<T> where
T: Unpin,
impl<T> UnwindSafe for SecretSeq<T> where
T: UnwindSafe,
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