Skip to content

Commit

Permalink
Reduce constraint serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
SleepingShell committed Oct 9, 2023
1 parent 2dfe974 commit dd8d239
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/chacha20/src/block.nr
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ impl ChaChaState {
fn to_le_4bytes(self) -> [u32; 16] {
let mut res = [0; 16];
for i in 0..16 {
res[i] = (self.state[i] & 0xFF) << 24 | (self.state[i] & 0xFF00) << 8 | (self.state[i] & 0xFF0000) >> 8 | (self.state[i] & 0xFF000000) >> 24;
res[i] = ((self.state[i] & 0xFF) << 24)
+ ((self.state[i] & 0xFF00) << 8)
+ ((self.state[i] & 0xFF0000) >> 8)
+ ((self.state[i] & 0xFF000000) >> 24);
}

res
Expand Down

0 comments on commit dd8d239

Please sign in to comment.