mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
All 23 lux-crypto-* crates now have: - README.md with algorithm description, build instructions (CRYPTO_DIR / CRYPTO_BUILD_DIR), source attribution - workspace-inherited authors/homepage/repository/documentation - crates.io-ready metadata (description, keywords, categories) cargo publish --dry-run --no-verify passes for all 23 crates. PUBLISHING.md documents the publish runbook: license decision required before upload, cargo login flow, name reservation order, dry-run sweep, ordered upload, native-archive dependency (Option C documented), docs.rs follow-up, versioning policy, source attribution table. This prepares the crates for a human with a crates.io token to run the real cargo publish step. No upload happens automatically -- the LICENSE decision (BSD-3-Clause vs Lux Ecosystem License) must be confirmed first.
lux-crypto-poseidon
Canonical Rust binding for Poseidon2 hash with t=2 over BN254 scalar field.
Wraps the C-ABI exposed by luxcpp/crypto/poseidon. Round constants and
permutation match gnark-crypto v0.20.1 for byte-for-byte cross-stack
compatibility.
Algorithm
- Poseidon2 -- ZK-friendly hash, BN254 scalar field
- Width: t=2 (compression mode)
- gnark-crypto v0.20.1 compatible
Build
Set CRYPTO_DIR (install prefix) or CRYPTO_BUILD_DIR (cmake build dir) so
the build script can find libposeidon_cpu.a.
git clone https://github.com/luxfi/crypto
cd crypto && cmake -S . -B build-cto && cmake --build build-cto
export CRYPTO_BUILD_DIR=$(pwd)/build-cto
cargo build -p lux-crypto-poseidon
Attribution
Round constants and permutation derived from gnark-crypto v0.20.1
(Apache 2.0).
License
See LICENSE at the repository root.