| 380 | /// Padded data split into blocks with detached last block returned by [`Padding::pad_detached`]. |
| 381 | #[derive(Debug)] |
| 382 | pub 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 | |
| 399 | impl<'a, BlockSize: ArraySize> PaddedData<'a, BlockSize> { |
| 400 | /// Unwrap the `Pad` variant. |
nothing calls this directly
no outgoing calls
no test coverage detected