chacha-candidates.json

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

chacha-candidates.json99 lines← SDK documentation
1{2  "date": "2026-10-25",3  "status": "Explicit optimization candidates; no IC instruction or default-selection claim",4  "specifications": [5    {6      "title": "RFC 8439",7      "url": "https://www.rfc-editor.org/rfc/rfc8439",8      "sections": [9        "2.3",10        "2.4",11        "2.5",12        "2.8"13      ]14    },15    {16      "title": "XChaCha draft-irtf-cfrg-xchacha-03",17      "url": "https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha-03",18      "sections": [19        "2.2",20        "2.3",21        "A.2",22        "A.3"23      ]24    },25    {26      "title": "Rust wasm64 SIMD intrinsics",27      "url": "https://doc.rust-lang.org/core/arch/wasm64/index.html"28    }29  ],30  "adaptations": [31    {32      "file": "src/poly1305_wide.rs",33      "source_package": "poly1305-0.8.0",34      "source_file": "src/backend/soft.rs",35      "sha256": "fd77a8c9b0b35bb1514d8ce812caa2c89b8a1ccccb2394558e8471fb3201bf74",36      "vcs": "47a72962e8898fc70ab79d4ab40949efe61a23d2",37      "license": "MIT OR Apache-2.0",38      "license_files": [39        "poly1305-0.8.0-LICENSE-MIT",40        "poly1305-0.8.0-LICENSE-APACHE"41      ],42      "local_changes": [43        "Preserve poly1305-donna five-limb 26-bit arithmetic and branchless final reduction",44        "Keep bounded limbs/products as u64 to avoid repeated zero-extension on wasm64",45        "Retain fivefold r multiples across blocks",46        "Borrow complete blocks, pad partial raw/AEAD blocks separately",47        "No universal-hash dynamic backend dispatch; no message heap allocation"48      ]49    },50    {51      "file": "src/chacha.rs",52      "source_package": "chacha20-0.9.1",53      "source_file": "src/backends/soft.rs",54      "sha256": "c6d6fbf33f80262eb77a5a171ade2b06365cd84501479aec97a4e932046f0a14",55      "vcs": "b5d39c45c45df97335f4b6effb853cde97810de1",56      "license": "MIT OR Apache-2.0",57      "license_files": [58        "chacha20-0.9.1-LICENSE-MIT",59        "chacha20-0.9.1-LICENSE-APACHE"60      ],61      "local_changes": [62        "Existing adapted scalar rounds unchanged",63        "Decode nonce once per in-place message and XOR complete words directly",64        "Reject counter overflow before mutation; preserve final u32 counter block"65      ]66    },67    {68      "file": "src/chacha_simd.rs",69      "source": "Locally authored SIMD formulation of RFC 8439's standard 20 rounds",70      "local_changes": [71        "One-block row vectors with fixed lane permutations",72        "Four-block word vectors with fixed transpose",73        "SIMD byte shuffles for 8-/16-bit rotations, shifts and OR for other rotations",74        "Explicit addressable-state erasure; no claim that compiler register copies are erased"75      ]76    },77    {78      "file": "src/chachapoly_wide.rs",79      "source": "Locally authored RFC 8439 / XChaCha composition",80      "local_changes": [81        "Explicit Words/Simd/Simd4 candidates",82        "Derive a fresh one-time Poly1305 key from block zero",83        "Authenticate exact borrowed AAD/ciphertext and little-endian lengths before decrypting",84        "Full tag comparison with subtle; clear complete body on authentication failure",85        "Full standard body counter range instead of pinned stream wrapper's smaller bound"86      ]87    }88  ],89  "qualification": {90    "native": [91      "RFC 8439 block/Poly1305/AEAD and established XChaCha vectors",92      "Independent pinned Poly1305 differential cases covering every size 0..1025, all-ones carries and 65537-byte messages",93      "Independent pinned AEAD differential tests using exact 100-record groups with fresh/shared keys, varied AAD, malformed tags/ciphertexts and complete failure wiping",94      "Counter overflow preflight and exact last 1/2/4 counter blocks"95    ],96    "wasm": "Root build owner must compile/install/register the candidates; setup probes and full-output checks exercise actual SIMD. Native fallback tests do not validate SIMD machine execution.",97    "memory": "Caller-owned bodies; no message heap allocation in algorithm candidates. Bench fixture allocations and copies remain setup/explicit restore work."98  }99}