chacha-cohort.json

cdk-rsx/crates/crypto/symmetric/provenance/chacha-cohort.json

chacha-cohort.json60 lines← SDK documentation
1{2  "date": "2026-10-25",3  "status": "Explicit unqualified cohort-open candidates; existing defaults unchanged",4  "source_base": "3c9dc996",5  "license": "MIT OR Apache-2.0",6  "sources": [7    {8      "file": "src/chacha_cohort/poly2.rs",9      "arithmetic_source": "src/poly1305_wide.rs, adapted from RustCrypto poly1305 0.8.0 src/backend/soft.rs",10      "upstream_commit": "47a72962e8898fc70ab79d4ab40949efe61a23d2",11      "upstream_sha256": "fd77a8c9b0b35bb1514d8ce812caa2c89b8a1ccccb2394558e8471fb3201bf74",12      "licenses": [13        "poly1305-0.8.0-LICENSE-MIT",14        "poly1305-0.8.0-LICENSE-APACHE"15      ],16      "changes": [17        "Pack two independent accumulators in u64x2 lanes",18        "Unpack two 16-byte blocks with fixed shuffles and unsigned lane extension",19        "Preserve clamping, 26-bit carries, independent padding/lengths and branchless final reduction",20        "Run identical vector arithmetic natively with scalar lanes for differential testing",21        "Erase addressable r/s/pad/accumulator vectors on drop"22      ]23    },24    {25      "file": "src/chacha_cohort/simd.rs",26      "source": "Locally authored four-record adaptation of existing RFC 8439 SIMD rounds",27      "changes": [28        "Different key/nonce per lane instead of different counters",29        "Parallel block zero derives each record's independent one-time Poly1305 key",30        "Reuse prepared initial words through all payload blocks",31        "Verify every complete tag before writing plaintext; failed lanes are wiped without writing unauthenticated plaintext",32        "One shared raw key is decoded within the cohort call, rather than an earlier message"33      ]34    }35  ],36  "specifications": [37    "https://www.rfc-editor.org/rfc/rfc8439#section-2.5",38    "https://www.rfc-editor.org/rfc/rfc8439#section-2.8"39  ],40  "carry_bounds": {41    "invariant": "After each block h0/h2/h3/h4 < 2^26; h1 < 2^26 + 2^12",42    "after_input": "Each limb < 2^28, including the high AEAD block bit",43    "key": "Each r < 2^26 and each 5*r < 2^29",44    "products": "Each product < 2^57; sum of five products < 2^60",45    "propagation": "Adding a preceding carry preserves d_i < 2^61",46    "fold": "d4 >> 26 < 2^35; folded h0 < 2^38; its carry < 2^12 restores the invariant",47    "final": "Only branchless conditional subtraction deliberately wraps; all product/carry additions remain below 2^64. SIMD operations carry only within each lane."48  },49  "api": {50    "keys": "ChaChaKeySet::Shared(&[u8;32]) or Distinct(&[[u8;32]])",51    "records": "Borrowed nonce/AAD/mutable body/tag per record",52    "results": "One Result<(), Error> per record; count/length errors precede all mutation",53    "fallback": "Unequal sizes and tails use existing per-record SIMD4 Wide"54  },55  "qualification": {56    "native": "27 symmetric tests and 44 fixture tests pass; one pre-existing ignored fixture test. Paired arithmetic covers public RFC AEAD framing, arbitrary/partial lengths, all-ones keys/messages and long carries. Exact 100-record groups cover primary sizes, shared/distinct keys, valid/invalid/mixed verdicts and complete wiping.",57    "wasm": "Not executed by family agent. Root central build must check actual SIMD load/shuffle outputs and compare observed whole-call/body/page fees.",58    "memory": "Algorithm uses bounded stack scratch, no heap. Timed benchmark carrier Vec and ciphertext restoration are included in all matched variants. Source-level scratch is not a measured stack high-water mark."59  }60}