Skip to content

[L-1] Transcript hashing uses native-endian bit storage #372

Description

@this-vishalsingh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions