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

Method xor_in2out

inout/src/inout_buf.rs:270–279  ·  view source on GitHub ↗
(&mut self, data: &[u8])

Source from the content-addressed store, hash-verified

268 /// If `data` length is not equal to the buffer length.
269 #[inline(always)]
270 pub fn xor_in2out(&mut self, data: &[u8]) {
271 assert_eq!(self.len(), data.len());
272 unsafe {
273 for i in 0..data.len() {
274 let in_ptr = self.in_ptr.add(i);
275 let out_ptr = self.out_ptr.add(i);
276 *out_ptr = *in_ptr ^ data[i];
277 }
278 }
279 }
280}
281
282impl<'inp, 'out, T, N> TryInto<InOut<'inp, 'out, Array<T, N>>> for InOutBuf<'inp, 'out, T>

Callers

nothing calls this directly

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected