Commit eff1e11
committed
fix: Fr::from_u64 must use big-endian encoding to match C++ msgpack format
Fr::from_u64 was storing values in little-endian, but the C++ field::msgpack_unpack
expects big-endian (network byte order). This was masked before because the C++ side
silently reduced non-canonical values via to_montgomery_form_reduced(). After #22311
added strict non-canonical field validation (throwing for values >= modulus), values
like Fr::from_u64(123) produce 0x7B<<248 which exceeds the BN254 Fr modulus (0x30...)
and cause a C++ exception that propagates through the FFI boundary, aborting the Rust
test process.1 parent 5f09c55 commit eff1e11
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments