dymokomi/luce-crypto
Source of release 0.6.1
0.6.1 / NOTICE.md
# Provenance
Original Luce Base SHA-2/HMAC/HKDF/BLAKE2b/Argon2id and memory implementation, Copyright 2026 Dy Mokomi,
MIT OR Apache-2.0. No C/C++/Rust cryptographic engine is included or linked.
Algorithm definitions and numeric constants: NIST FIPS 180-4 (August 2015),
sections 4–6, https://doi.org/10.6028/NIST.FIPS.180-4.
`tests/vectors/*.rsp` are unmodified NIST CAVP public byte-oriented SHA-256,
SHA-384 and SHA-512 ShortMsg/LongMsg response files, downloaded September 15,
2026 UTC from:
https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Algorithm-Validation-Program/documents/shs/shabytetestvectors.zip
Original ZIP SHA-256:
`929ef80b7b3418aca026643f6f248815913b60e01741a44bba9e118067f4c9b8`.
Individual original-byte hashes are retained in `tests/vectors/SHA256SUMS`.
The NIST files are US government test data, separately attributed rather than
claimed as original project source. They are test-only data, not an engine.
Informal use of these vectors is **not** NIST/CAVP/FIPS certification.
Build/test/bootstrap/bundle scaffolding follows the MIT OR Apache-2.0
`dymokomi/luce-compress` and `dymokomi/luce-pkg-server` patterns by the same author.
HMAC is implemented from RFC 2104; HKDF from RFC 5869. Numeric input/output facts
in `tests/rfc_keyed.py` come from RFC 4231 section 4 (SHA-256/384/512 cases 1–7)
and RFC 5869 appendix A.1–A.3 (SHA-256). These fixtures are separately attributed;
no RFC prose, implementation code or foreign engine is included. RFC 4231 case 5
provides a truncated prefix, checked against the full independent oracle tag.
Standards: https://www.rfc-editor.org/rfc/rfc2104.html,
https://www.rfc-editor.org/rfc/rfc4231.html,
https://www.rfc-editor.org/rfc/rfc5869.html.
Python `hashlib`/`hmac` are independent development-test oracles only. The Base/Luce
toolchains and their existing runtime/OS bindings remain separate dependencies.
Sequential unkeyed BLAKE2b follows RFC 7693; Argon2id version 0x13, its variable
length H' and numeric known-answer/intermediate-state facts follow RFC 9106.
Standards: https://www.rfc-editor.org/rfc/rfc7693.html and
https://www.rfc-editor.org/rfc/rfc9106.html (section 5.3).
The upstream Argon2 reference's indexing and compression were inspected as a
cross-check: https://github.com/P-H-C/phc-winner-argon2/tree/20190702/src.
No upstream implementation source or RFC prose is copied into this package.
`tests/vectors/argon2id.json` is deterministic public test data generated by
`tests/argon_oracle.py`. Its test-only oracle is argon2-cffi 25.1.0 with
argon2-cffi-bindings 25.1.0 (CFFI 2.0.0, pycparser 3.0), wrapping the independent
Argon2 reference. Both serial and parallel reference results must agree. The
generator also checks the RFC 9106 result before writing any fixture. Dependencies
are installed only in an ignored build environment; none are runtime dependencies
or shipped in the prebuilt VPS test bundle. Python hashlib separately checks
BLAKE2b and H'. Numeric test facts are not claimed as original cryptographic design.
SHAKE128/SHAKE256 follow FIPS 202; ML-DSA-65 follows FIPS 204. Independent
known-answer checks use Python hashlib for SHAKE and OpenSSL 3.6 ML-DSA-65
(`hexseed` key generation and `pkeyutl` signatures) as test-only oracles.
No OpenSSL, liboqs or pqcrystals object is linked into production builds.
NTT zeta constants match the public Dilithium reference table for q=8380417;
they are field elements specified by FIPS 204, not copied engine source.
AES (FIPS 197) and AES-GCM (NIST SP 800-38D) are original Luce code whose
bitsliced structure follows Thomas Pornin's BearSSL (MIT license,
https://www.bearssl.org/): `aes_ct64.c`/`aes_ct64_enc.c` (orthogonalization,
round functions and key schedule) and `ghash_ctmul64.c` (carry-less multiply
with holes). The S-box is the Boyar–Peralta circuit,
https://eprint.iacr.org/2009/191. No BearSSL source is included.
BearSSL copyright notice: Copyright (c) 2016 Thomas Pornin <pornin@bolet.org>,
permission granted under the MIT license.
RSA verification follows RFC 8017 (§8.1.2, §8.2.2, §9.1.2, §9.2, §B.2.1); the
Montgomery multiplication is the CIOS method (Koç, Acar, Kaliski 1996).
`tests/vectors/wycheproof/*.txt` are converted by `tools/wycheproof.py` from
Project Wycheproof (https://github.com/C2SP/wycheproof, Apache-2.0), revision
3fa63dd0344abb611f1fb1d77e119938603ea230, retrieved 2026-10-02. Every test of
each listed file is kept. SHA-256 sums of the source JSON files are in
`tests/vectors/wycheproof/SOURCE-SHA256SUMS`. Test data only.
`tests/vectors/bearssl/*.txt` are extracted by `tools/bearssl_vectors.py` from
BearSSL `test/test_crypto.c` (https://www.bearssl.org/, revision
7bea48e5e850ab4cafbe68d3765cdaba13a86d6f, retrieved 2026-10-02; MIT license,
Copyright (c) 2016 Thomas Pornin). Only the known-answer data is taken; the
modpow inputs come from the same HMAC_DRBG seed BearSSL uses, with results
computed by Python. SHA-256 sums: `tests/vectors/bearssl/SOURCE-SHA256SUMS`.
Test data only; no BearSSL code is included.
`tests/vectors/rfc/*.txt` are extracted by `tools/rfc_vectors.py` from RFC 8439
(Appendix A) and RFC 7748 (sections 5.2 and 6.1), retrieved 2026-10-02 from
https://www.rfc-editor.org/; source checksums in
`tests/vectors/rfc/SOURCE-SHA256SUMS`. IETF Trust test data, used as test data.
`tests/vectors/cavp/*.txt` are converted by `tools/cavp_vectors.py` from NIST
CAVP `gcmtestvectors.zip` (gcmEncryptExtIV and gcmDecrypt, a subset of three
cases per parameter set; the tool can emit all 47,250) and
`186-4ecdsatestvectors.zip` (SigVer.rsp), retrieved 2026-10-02 from
https://csrc.nist.gov/Projects/Cryptographic-Algorithm-Validation-Program;
source checksums in `tests/vectors/cavp/SOURCE-SHA256SUMS`. US government test
data; informal use is not CAVP validation.
`tests/vectors/openssl/*.txt` are converted by `tools/openssl_vectors.py` from
OpenSSL `test/recipes/30-test_evp_data/*.txt` (https://github.com/openssl/openssl,
branch openssl-3.5, revision adb795d9b166b7342ad1227b6241f3d31d973438, retrieved
2026-10-02; Apache License 2.0, Copyright The OpenSSL Project Authors). Every
stanza of an implemented family is kept; `SUMMARY.txt` counts the rest. Source
checksums are in `tests/vectors/openssl/SOURCE-SHA256SUMS`. Test data only; no
OpenSSL code is included.
X25519 (RFC 7748) is original Luce code whose field representation and ladder
follow BearSSL `ec_c25519_m31.c` (MIT, Copyright (c) 2016 Thomas Pornin); it
replaces an earlier port of the public-domain TweetNaCl routine.
P-256 is original Luce code whose point layer (Jacobian formulas, 2-bit
variable-base window with masked selection, 4-bit fixed-base window with a
constant-time table scan) follows BearSSL `ec_p256_m31.c` (MIT, Copyright (c)
2016 Thomas Pornin); `src/p256_table.lucb` is recomputed from the
curve constants by `tools/p256_table.py`. ECDSA nonces follow RFC 6979 §3.2,
as BearSSL's `ecdsa_i31_sign_raw` does. Verification uses a joint two-bit
window (Straus); P-384 multiplication uses CIOS Montgomery products.
RSA verification checks follow BearSSL `rsa_i31_pkcs1_vrfy.c`/`rsa_i31_pss_vrfy.c`
and OpenSSL `crypto/rsa/rsa_pss.c` (`RSA_verify_PKCS1_PSS_mgf1`); the
exponentiation reuses a per-key Montgomery context and computes R^2 mod n
from R mod n by doublings and Montgomery squarings.