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

Method pad_detached

block-padding/src/lib.rs:58–65  ·  view source on GitHub ↗
(data: &[u8])

Source from the content-addressed store, hash-verified

56 #[inline]
57 #[must_use]
58 fn pad_detached<BlockSize: ArraySize>(data: &[u8]) -> PaddedData<'_, BlockSize> {
59 let (blocks, tail) = Array::slice_as_chunks(data);
60 let mut tail_block = Array::default();
61 let pos = tail.len();
62 tail_block[..pos].copy_from_slice(tail);
63 Self::pad(&mut tail_block, pos);
64 PaddedData::Pad { blocks, tail_block }
65 }
66
67 /// Unpad data in `blocks` and return unpadded byte slice.
68 ///

Callers

nothing calls this directly

Implementers 1

lib.rsblock-padding/src/lib.rs

Calls 3

slice_as_chunksFunction · 0.85
defaultFunction · 0.85
lenMethod · 0.80

Tested by

no test coverage detected