One Rust crate per algorithm, plus an `lux-crypto` umbrella that re-exports
each per-algorithm crate behind a Cargo feature.
5 working crates with verified spec vectors:
- lux-crypto-keccak (Ethereum keccak256)
- lux-crypto-secp256k1 (ecrecover precompile + batch)
- lux-crypto-sha256 (FIPS 180-4)
- lux-crypto-ripemd160 (Bitcoin/Ethereum address derivation)
- lux-crypto-blake2b (RFC 7693)
15 wired-but-NOTIMPL crates (canonical Rust binding shipped, body returns
CRYPTO_ERR_NOTIMPL today; spec-vector tests gated `#[ignore]` with FIXME):
blake3, ed25519, slhdsa, mldsa, mlkem, bls, kzg, bn254, aead, ipa,
pedersen, lamport, ntt, poly-mul, evm256.
cargo check --release --workspace --all-features OK
cargo test --release --workspace 55 pass / 0 fail / 25 ignored
cargo doc --no-deps --workspace clean
cargo publish --dry-run --no-verify OK for all 20 leaf crates
Workspace docs added at rust/{README,PUBLISHING,RUST_CRATE_STATUS}.md.
Per-crate README.md and `Cargo.toml` metadata (description, license,
repository, keywords, categories, readme) wired for crates.io publish.
Build directives normalized: link both `lib<alg>.a` (C-ABI shim) and
`lib<alg>_cpu.a` (CPU body); brand-neutral C symbols (no lux_ prefix) per
the prefix-uniform audit.
1.3 KiB
lux-crypto-keccak
Canonical Rust binding for Lux keccak256.
Wraps the keccak256 symbol exported by luxcpp/crypto/keccak. The C-ABI
header is luxcpp/crypto/include/lux/crypto/keccak.h. The body is a
first-party Keccak Reference v3.0 implementation with the Ethereum padding
byte 0x01 (NOT FIPS 202 SHA3-256, which uses 0x06).
Use
use lux_crypto_keccak::hash;
let digest = hash(b"abc");
Build
The build script discovers libkeccak.a and libkeccak_cpu.a in the order:
CRYPTO_DIRenvironment variable (install prefix; archive at$CRYPTO_DIR/lib/keccak/).CRYPTO_BUILD_DIRenvironment variable (cmake build dir; archive at$CRYPTO_BUILD_DIR/keccak/).- Default fallback to
../../../../luxcpp/crypto/build-cto/keccak/.
CRYPTO_BUILD_DIR=/path/to/luxcpp/crypto/build-cto cargo build --release
Test vectors
tests/spec_vectors.rs covers the standard reference vectors (empty input,
"abc", "The quick brown fox jumps over the lazy dog", a million 'a' bytes,
sponge-rate boundary cases). All vectors are independently verified against
eth_hash (PyPA) and the keccak.team reference.
License
Apache-2.0 OR MIT (workspace default is BSD-3-Clause; this crate inherits).
Source
C-ABI body: luxcpp/crypto/keccak/c-abi/c_keccak.cpp.