We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_bits
to_bytes
u128
Opcodes ToBits and ToRadix cast the input field element to u128 so they don't work for larger field elements
ToBits
ToRadix
noir/crates/noirc_evaluator/src/ssa/optimizations.rs
Lines 535 to 537 in 545340c
The functions should work for all field elements (i.e. up-to 254 bits)
Casting should be avoided
use dep::std; fn main() { let x1 = 0xffffffffffffffffffffffffffffffff; let x2 = 0xffffffffffffffffffffffffffffffffff; let x1_bytes = x1.to_le_bytes(32); let x2_bytes = x2.to_le_bytes(32); std::println(x1_bytes); std::println(x2_bytes); // This should fail assert(x1_bytes[16] == x2_bytes[16]); } #[test] fn test_main() { main(); }
Compiled from source
nargo 0.5.1 (git version hash: 545340c, is dirty: false)
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Aim
Opcodes
ToBits
andToRadix
cast the input field element tou128
so they don't work for larger field elementsnoir/crates/noirc_evaluator/src/ssa/optimizations.rs
Lines 535 to 537 in 545340c
Expected behavior
The functions should work for all field elements (i.e. up-to 254 bits)
Bug
Casting should be avoided
To reproduce
Installation method
Compiled from source
Nargo version
nargo 0.5.1 (git version hash: 545340c, is dirty: false)
@noir-lang/noir_wasm version
No response
@noir-lang/barretenberg version
No response
@noir-lang/aztec_backend version
No response
Additional context
No response
Submission Checklist
The text was updated successfully, but these errors were encountered: