mirror of
https://github.com/luxfi/crypto.git
synced 2026-10-30 16:59:13 +00:00
Adds lux-crypto-{sha256, ripemd160, blake2b, aead, lamport, mldsa,
mlkem, slhdsa, banderwagon, pedersen, ipa, verkle, evm256, kzg} on
top of the existing keccak + secp256k1 + umbrella, gated on
verified-real C-ABI dispatch (nm shows the extern "C" symbols and
spec-vector integration tests assert byte-equality vs published
reference values).
Workspace test sweep (CRYPTO_BUILD_DIR=.../build-cto):
182 passed, 0 failed, 4 ignored (slow SLH-DSA 192f/256f).
Per crate:
* sha256 - 12 tests (FIPS 180-4 / RFC 6234)
* ripemd160 - 14 tests (Dobbertin et al. 1996)
* blake2b - 13 tests (RFC 7693 App. A)
* aead - 11 tests (RFC 8439 §2.8.2)
* lamport - 5 tests / 10 KAT vectors (luxfi/crypto KAT corpus)
* mldsa - 13 tests (FIPS 204 modes 2/3/5)
* mlkem - 12 tests (FIPS 203 modes 2/3/5, implicit rejection)
* slhdsa - 9 + 4 ignored (FIPS 205 sha2/shake 128f)
* banderwagon - 14 tests (16 published 2^i*G doublings KAT)
* pedersen - 12 tests (Banderwagon SRS)
* ipa - 12 tests (576-byte multiproof)
* verkle - 12 tests (256-element SRS)
* evm256 - 4 tests / 12 KAT vectors (BLS Fr, secp256k1 N, etc)
* kzg - 12 tests (verify_proof real; blob ops surfaced as
Internal(-5) since c_kzg_blob.cpp is in a separate
TU not yet linked into libkzg.a)
Refused to ship:
* blake3, poseidon, ed25519, bls — c-abi entry points still return
CRYPTO_ERR_NOTIMPL in luxcpp/crypto/<alg>/c-abi/c_<alg>.cpp.
* poly_mul — c-abi file is empty, no extern "C" exports.
Build: CRYPTO_BUILD_DIR=/path/to/luxcpp/crypto/build-cto cargo test --workspace
Each crate's build.rs links lib<alg>.a (c-abi shim) + lib<alg>_cpu.a
(implementation body); shared dependencies (sha256 for kzg+lamport,
banderwagon for pedersen+ipa+verkle, ipa SRS for pedersen, blst for
kzg, banderwagon_metal stub on macOS) are explicitly linked.
COVERAGE.md updated: 17 member crates, 182/182 tests passing,
deferred algorithms documented with their current c-abi status.