Files
crypto/rust/lux-crypto-poly_mul/Cargo.toml
T
Hanzo AI fe5fdbbca5 crypto/rust: add lux-crypto-ntt + lux-crypto-poly_mul bindings
Two new no_std crates wrapping the C-ABI from luxcpp/crypto/ntt and
luxcpp/crypto/poly_mul.

lux-crypto-ntt:
  * forward / inverse — generic-prime NTT (caller-supplied modulus + root)
  * Cyclone-FFT fast path engaged automatically when (modulus, root) ==
    (Q=998244353, PRIMITIVE_ROOT=629671588)
  * 6 spec-vector tests:
      - forward+inverse roundtrip across n in {2,4,...,1024}
      - q97/omega=28 generic-prime roundtrip (matches Go reference)
      - input rejection: empty, non-pow2, modulus=0

lux-crypto-poly_mul:
  * multiply / multiply_into — Z_Q[X]/(X^n+1) negacyclic convolution
  * Pinned to Cyclone-FFT prime (the C-ABI rejects other rings)
  * 4 spec-vector tests including the canonical 10-case KAT table
    (sum/first/last byte-equal to luxfi/crypto/poly_mul Go reference)
    and the (1+2X+3X^2+4X^3)*(5+6X+7X^2+8X^3) hand-written negacyclic case.

build.rs links statically against libntt_cpu.a / libpoly_mul_cpu.a
produced by luxcpp/crypto/ntt and luxcpp/crypto/poly_mul; CRYPTO_BUILD_DIR
or CRYPTO_DIR points at the cmake build / install layout.

Verified: cargo test -p lux-crypto-ntt -p lux-crypto-poly_mul
  6/6 ntt tests PASS, 4/4 poly_mul tests PASS.
2025-12-28 02:53:12 -08:00

18 lines
524 B
TOML

[package]
name = "lux-crypto-poly_mul"
version = "0.1.0"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
description = "Canonical Rust binding for Lux polynomial multiplication over Z_Q[X]/(X^n+1) with Q = 998244353. Calls into luxcpp/crypto/poly_mul via the C-ABI."
repository = "https://github.com/luxfi/crypto"
readme = "README.md"
keywords = ["polynomial", "ntt", "negacyclic", "lattice", "ffi"]
categories = ["cryptography"]
[lib]
name = "lux_crypto_poly_mul"
[lints]
workspace = true