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)
| 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. |