Skip to content

Commit

Permalink
chore(docs): XOR typo in docs
Browse files Browse the repository at this point in the history
closes #4222
  • Loading branch information
signorecello authored Feb 1, 2024
1 parent 3af2a89 commit 52f9dca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/docs/noir/concepts/unconstrained.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Total ACIR opcodes generated for language PLONKCSat { width: 3 }: 91
Backend circuit size: 3619
```

A lot of the operations in this function are optimized away by the compiler (all the bit-shifts turn into divisions by constants). However we can save a bunch of gates by casting to u8 a bit earlier. This automatically truncates the bit-shifted value to fit in a u8 which allows us to remove the XOR against 0xff. This saves us ~480 gates in total.
A lot of the operations in this function are optimized away by the compiler (all the bit-shifts turn into divisions by constants). However we can save a bunch of gates by casting to u8 a bit earlier. This automatically truncates the bit-shifted value to fit in a u8 which allows us to remove the AND against 0xff. This saves us ~480 gates in total.

```rust
fn main(num: u72) -> pub [u8; 8] {
Expand Down

0 comments on commit 52f9dca

Please sign in to comment.