MCPcopy Create free account
hub / github.com/RustCrypto/utils / PaddedData

Enum PaddedData

block-padding/src/lib.rs:382–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380/// Padded data split into blocks with detached last block returned by [`Padding::pad_detached`].
381#[derive(Debug)]
382pub enum PaddedData<'a, BlockSize: ArraySize> {
383 /// Message split into blocks with detached and padded `tail_block`.
384 Pad {
385 /// Message blocks.
386 blocks: &'a [Array<u8, BlockSize>],
387 /// Last message block with padding.
388 tail_block: Array<u8, BlockSize>,
389 },
390 /// [`NoPadding`] or [`ZeroPadding`] were used on a message which does not require any padding.
391 NoPad {
392 /// Message blocks.
393 blocks: &'a [Array<u8, BlockSize>],
394 },
395 /// [`NoPadding`] was used on a message with size not multiple of the block size.
396 Error,
397}
398
399impl<'a, BlockSize: ArraySize> PaddedData<'a, BlockSize> {
400 /// Unwrap the `Pad` variant.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected