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

Method split_at

inout/src/inout_buf.rs:217–234  ·  view source on GitHub ↗
(self, mid: usize)

Source from the content-addressed store, hash-verified

215 #[inline(always)]
216 #[must_use]
217 pub fn split_at(self, mid: usize) -> (InOutBuf<'inp, 'out, T>, InOutBuf<'inp, 'out, T>) {
218 assert!(mid <= self.len);
219 let (tail_in_ptr, tail_out_ptr) = unsafe { (self.in_ptr.add(mid), self.out_ptr.add(mid)) };
220 (
221 InOutBuf {
222 in_ptr: self.in_ptr,
223 out_ptr: self.out_ptr,
224 len: mid,
225 _pd: PhantomData,
226 },
227 InOutBuf {
228 in_ptr: tail_in_ptr,
229 out_ptr: tail_out_ptr,
230 len: self.len() - mid,
231 _pd: PhantomData,
232 },
233 )
234 }
235
236 /// Partition buffer into 2 parts: buffer of arrays and tail.
237 #[inline(always)]

Callers 6

parse_into_arrayFunction · 0.80
parse_into_vecFunction · 0.80
absorb_u64_leMethod · 0.80
digest_blocksMethod · 0.80
deserializeMethod · 0.80
digest_pad_combinationsFunction · 0.80

Calls 1

lenMethod · 0.80

Tested by 1

digest_pad_combinationsFunction · 0.64