-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ssa refactor): pad radix result (#1730)
* fix(ssa refactor): pad radix result * chore(ssa refactor): cp working test * fix(ssa refactor): padding always at end
- Loading branch information
1 parent
3109239
commit 8e9b612
Showing
5 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
crates/nargo_cli/tests/test_data_ssa_refactor/to_le_bytes/Nargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[package] | ||
authors = [""] | ||
compiler_version = "0.1" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
crates/nargo_cli/tests/test_data_ssa_refactor/to_le_bytes/Prover.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
x = "2040124" |
14 changes: 14 additions & 0 deletions
14
crates/nargo_cli/tests/test_data_ssa_refactor/to_le_bytes/src/main.nr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
use dep::std; | ||
|
||
fn main(x : Field) -> pub [u8; 4] { | ||
// The result of this byte array will be little-endian | ||
let byte_array = x.to_le_bytes(31); | ||
let mut first_four_bytes = [0; 4]; | ||
for i in 0..4 { | ||
first_four_bytes[i] = byte_array[i]; | ||
} | ||
// Issue #617 fix | ||
// We were incorrectly mapping our output array from bit decomposition functions during acir generation | ||
first_four_bytes[3] = byte_array[31]; | ||
first_four_bytes | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters