Crate block_buffer
Fixed size buffer for block processing of data.
Examples
use ;
let mut buf = default;
let mut accum = Vecnew;
let msg1: & = &;
let msg2: & = &;
buf.digest_blocks;
buf.digest_blocks;
assert_eq!;
assert_eq!;
assert_eq!;
assert_eq!;
let padded_block = buf.pad_with_zeros;
assert_eq!;
Note that block size used with buffers MUST be bigger than zero and smaller than 256. You will get a compilation error with an invalid block size:
use block_buffer::{EagerBuffer, array::typenum::U0};
let buf = EagerBuffer::<U0>::default();
use block_buffer::{EagerBuffer, array::typenum::U256};
let buf = EagerBuffer::<U256>::default();
Modules
Structs
- BlockBuffer Buffer for block processing of data.
-
Eager
Eager block buffer kind, which guarantees that buffer position
always lies in the range of
0..BlockSize. - Error Block buffer error.
-
Lazy
Lazy block buffer kind, which guarantees that buffer position
always lies in the range of
0..=BlockSize. - ReadBuffer Buffer for reading block-generated data.
Traits
-
BlockSizes
Trait implemented for supported block sizes, i.e. for types from
U1toU255. - BufferKind Trait for buffer kinds.
Type Aliases
- EagerBuffer Eager block buffer.
- LazyBuffer Lazy block buffer.
-
SerializedBuffer
BlockBufferserialized as a byte array. -
SerializedBufferSize
Size of serialized
BlockBufferin bytes.