1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! # dig-capsule-guest
//!
//! The served WASM logic. Documented deviations enforced here:
//! 1. Codec is BIG-ENDIAN (Chia streamable framing), NOT the paper's little-endian
//! note (§5.3). Chia compatibility wins.
//! 2. Decoy/cover streams use deterministic ChaCha20 keyed by SHA-256 so identical
//! inputs yield identical bytes (§19.3 determinism), interpreting the paper's
//! "random filler" as "deterministically pseudo-random".
//! 3. The guest VERIFIES BLS with pure-Rust bls12_381 (AugScheme); it never signs
//! and never decrypts. Node proof signatures are produced by the host.
//! 4. CONVENTIONS C3: `get_proof` returns a serialized `ProofPrelude`, NOT a
//! finished `ExecutionProof` (the guest cannot make ZK proofs in wasm). The
//! prelude binds `output_commitment` = SHA-256 of the served bytes (ordered by
//! `crate::imp::core::serving::concat_output`, CONVENTIONS C9) and a
//! nonce-bound `serving_digest`.
//! 5. `bls12_381` 0.8's hash-to-curve lives behind its `experimental` feature and
//! is bound to the `digest` 0.9 trait family, so the AugScheme hash-to-G2 step
//! uses a `sha2` 0.9 hasher (aliased `sha2_v09`); every other hash uses
//! `sha2` 0.10. (Plan listed neither the feature nor the alias.)
//! 6. The C8 cross-impl BLS parity vectors are loaded directly from
//! `dig-capsule-crypto/tests/fixtures/bls_vectors.json` (the plan referenced a
//! non-existent `crate::imp::crypto::test_vectors` module).
// Wasm-only ABI surface. Pure logic modules below are always compiled.
// On wasm with no std, supply a panic handler.
!