Struct coins_bip32::ecdsa::signature::digest::block_buffer::BlockBuffer
source · [−]pub struct BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero, { /* private fields */ }
Expand description
Buffer for block processing of data.
Implementations
sourceimpl<BlockSize, Kind> BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<BlockSize, Kind> BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
sourcepub fn new(buf: &[u8]) -> BlockBuffer<BlockSize, Kind>
pub fn new(buf: &[u8]) -> BlockBuffer<BlockSize, Kind>
sourcepub fn digest_blocks(
&mut self,
input: &[u8],
compress: impl FnMut(&[GenericArray<u8, BlockSize>])
)
pub fn digest_blocks(
&mut self,
input: &[u8],
compress: impl FnMut(&[GenericArray<u8, BlockSize>])
)
Digest data in input
in blocks of size BlockSize
using
the compress
function, which accepts slice of blocks.
sourcepub fn pad_with_zeros(&mut self) -> &mut GenericArray<u8, BlockSize>
pub fn pad_with_zeros(&mut self) -> &mut GenericArray<u8, BlockSize>
Pad remaining data with zeros and return resulting block.
sourcepub fn get_data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn get_data(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Return slice of data stored inside the buffer.
sourcepub fn set(&mut self, buf: GenericArray<u8, BlockSize>, pos: usize)
pub fn set(&mut self, buf: GenericArray<u8, BlockSize>, pos: usize)
sourceimpl<BlockSize> BlockBuffer<BlockSize, Eager> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<BlockSize> BlockBuffer<BlockSize, Eager> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
sourcepub fn set_data(
&mut self,
data: &mut [u8],
process_blocks: impl FnMut(&mut [GenericArray<u8, BlockSize>])
)
pub fn set_data(
&mut self,
data: &mut [u8],
process_blocks: impl FnMut(&mut [GenericArray<u8, BlockSize>])
)
Set data
to generated blocks.
sourcepub fn digest_pad(
&mut self,
delim: u8,
suffix: &[u8],
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn digest_pad(
&mut self,
delim: u8,
suffix: &[u8],
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
Compress remaining data after padding it with delim
, zeros and
the suffix
bytes. If there is not enough unused space, compress
will be called twice.
Panics
If suffix length is bigger than block size.
sourcepub fn len64_padding_be(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len64_padding_be(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
Pad message with 0x80, zeros and 64-bit message length using big-endian byte order.
sourcepub fn len64_padding_le(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len64_padding_le(
&mut self,
data_len: u64,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
Pad message with 0x80, zeros and 64-bit message length using little-endian byte order.
sourcepub fn len128_padding_be(
&mut self,
data_len: u128,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
pub fn len128_padding_be(
&mut self,
data_len: u128,
compress: impl FnMut(&GenericArray<u8, BlockSize>)
)
Pad message with 0x80, zeros and 128-bit message length using big-endian byte order.
Trait Implementations
sourceimpl<BlockSize, Kind> Clone for BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<BlockSize, Kind> Clone for BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
sourcefn clone(&self) -> BlockBuffer<BlockSize, Kind>
fn clone(&self) -> BlockBuffer<BlockSize, Kind>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<BlockSize, Kind> Debug for BlockBuffer<BlockSize, Kind> where
BlockSize: Debug + ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: Debug + BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<BlockSize, Kind> Debug for BlockBuffer<BlockSize, Kind> where
BlockSize: Debug + ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: Debug + BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
sourceimpl<BlockSize, Kind> Default for BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
impl<BlockSize, Kind> Default for BlockBuffer<BlockSize, Kind> where
BlockSize: ArrayLength<u8> + IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>,
Kind: BufferKind,
<BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,
sourcefn default() -> BlockBuffer<BlockSize, Kind>
fn default() -> BlockBuffer<BlockSize, Kind>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<BlockSize, Kind> RefUnwindSafe for BlockBuffer<BlockSize, Kind> where
Kind: RefUnwindSafe,
<BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<BlockSize, Kind> Send for BlockBuffer<BlockSize, Kind> where
Kind: Send,
impl<BlockSize, Kind> Sync for BlockBuffer<BlockSize, Kind> where
Kind: Sync,
impl<BlockSize, Kind> Unpin for BlockBuffer<BlockSize, Kind> where
Kind: Unpin,
<BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<BlockSize, Kind> UnwindSafe for BlockBuffer<BlockSize, Kind> where
Kind: UnwindSafe,
<BlockSize as ArrayLength<u8>>::ArrayType: 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