MCPcopy Create free account
hub / github.com/docknetwork/crypto / next

Method next

oblivious_transfer/src/aes_prng.rs:107–118  ·  view source on GitHub ↗

Computes the next state by looking at the counter of the current state Writes the next counters into bytes over the u8 state array

(&mut self)

Source from the content-addressed store, hash-verified

105 /// Computes the next state by looking at the counter of the current state
106 /// Writes the next counters into bytes over the u8 state array
107 fn next(&mut self) {
108 let counter = self.next_index;
109 let blocks_bytes = self.as_mut_bytes();
110 for i in 0..PIPELINES_USIZE {
111 LittleEndian::write_u128(
112 &mut blocks_bytes[i * AES_BLK_SIZE..(i + 1) * AES_BLK_SIZE],
113 counter + i as u128,
114 );
115 }
116 self.next_index += PIPELINES_U128;
117 self.used_bytes = 0;
118 }
119}
120
121/// Necessary data to compute randomness, a state and an initialized AES blockcipher.

Callers 12

_verifyMethod · 0.80
initializationFunction · 0.80
computing_dFunction · 0.80
checkFunction · 0.80
dealFunction · 0.80
next_u32Method · 0.80
next_u64Method · 0.80
fill_bytesMethod · 0.80

Calls 1

as_mut_bytesMethod · 0.80

Tested by 6

initializationFunction · 0.64
computing_dFunction · 0.64