Context: crates/zk-core/src/store/prover.rs
Description
The transcript is updated using adjust.as_raw_slice().as_bytes(), which hashes the underlying u32 storage in native endianness. This makes the transcript non-portable across architectures with different endianness and can cause cross-platform prover/verifier transcript mismatches (protocol abort/DoS).
Impacted Code
let adjust_len = adjust.len();
transcript.update(&adjust.as_raw_slice().as_bytes()[..adjust_len.div_ceil(8)]);
Recommendation
Hash a canonical byte encoding of the bitstring (e.g., pack bits into bytes in a defined endianness such as little-endian, or use a serialization format that defines byte order) rather than as_raw_slice().as_bytes() on native words.
Context:
crates/zk-core/src/store/prover.rsDescription
The transcript is updated using
adjust.as_raw_slice().as_bytes(), which hashes the underlyingu32storage in native endianness. This makes the transcript non-portable across architectures with different endianness and can cause cross-platform prover/verifier transcript mismatches (protocol abort/DoS).Impacted Code
RecommendationHash a canonical byte encoding of the bitstring (e.g., pack bits into bytes in a defined endianness such as little-endian, or use a serialization format that defines byte order) rather than
as_raw_slice().as_bytes()on native words.