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

Method get_tail_block

inout/src/reserved.rs:240–248  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

238 /// Most padding implementations always return `Some`.
239 #[inline(always)]
240 pub fn get_tail_block(&mut self) -> Option<InOut<'_, '_, Array<u8, BS>>> {
241 // SAFETY: if `tail` is `Some`, then `out_ptr` points to a buffer with length equal
242 // to at least `blocks_len + 1` blocks, so it satisfies the safety conditions
243 // required by `InOut::from_raw`.
244 self.tail_block.as_ref().map(|in_block| unsafe {
245 let tail_out_ptr = self.out_ptr.add(self.blocks_len);
246 InOut::from_raw(in_block, tail_out_ptr)
247 })
248 }
249
250 /// Convert buffer into output slice.
251 #[inline(always)]

Callers 2

reserved_invalid_lengthsFunction · 0.80

Calls 2

mapMethod · 0.80
as_refMethod · 0.45

Tested by 2

reserved_invalid_lengthsFunction · 0.64