zupt/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Cristian Cezar Moisés 862f4a2df6 crypto: make ML-KEM-768 genuinely FIPS 203-conformant (validated vs OpenSSL)
The in-tree ML-KEM-768 was round-3 CRYSTALS-Kyber mislabelled "FIPS 203" and
was NOT interoperable with a compliant ML-KEM. Discovered and fixed by
validating against OpenSSL 3.5's FIPS 203 ML-KEM-768 as an oracle.

Three deviations, all fixed in src/zupt_mlkem.c:
1. Matrix  transpose convention. FIPS 203 K-PKE.KeyGen samples
   Â[i][j] = SampleNTT(XOF(ρ, j, i)) and K-PKE.Encrypt uses (ρ, i, j); the
   code had both index orders swapped. It was self-consistent (encaps/decaps
   round-tripped) but transposed vs the standard — which is exactly why a
   self-consistency-only round-trip test never caught it. With the same seed,
   keygen now produces a byte-identical ek to OpenSSL.
2. Shared-secret KDF. FIPS 203 returns K = G(m‖H(ek))[0:32] directly; removed
   the round-3 final K = KDF(K̄‖H(c)) step (encaps + decaps success key).
3. Implicit rejection. Now K̄ = J(z‖c) = SHAKE256(z ‖ full-ciphertext) instead
   of the round-3 KDF(z‖H(c)).

Validation (tests/test_mlkem_fips203.sh + mlkem_fips203_harness.c, wired into
make check): against OpenSSL 3.5 ML-KEM-768 —
  - deterministic keygen (same d‖z seed) -> byte-identical ek
  - our encaps -> OpenSSL decap: shared secret matches
  - OpenSSL encap -> our decaps: shared secret matches
The harness feeds a fixed random stream (MLKEM_RAND) so the FIPS 203 seed is
reproducible; the test skips gracefully without an ML-KEM-capable openssl.

BREAKING: --pq / --pq-only keys and archives from <= 4.2.1 no longer decrypt
(the KEM math changed). Regenerate keys and re-encrypt. Password mode and plain
compression are unaffected; wire format stays v1.6. make check 16/16.
2026-07-10 13:27:37 -03:00
..
fuzz_decompress.c v2.2.2 2026-05-01 09:58:47 -03:00
fuzz_format.c v2.2.2 2026-05-01 09:58:47 -03:00
fuzz_vv_decompress.c v2.2.2 2026-05-01 09:58:47 -03:00
mlkem_fips203_harness.c crypto: make ML-KEM-768 genuinely FIPS 203-conformant (validated vs OpenSSL) 2026-07-10 13:27:37 -03:00
regression.sh v2.2.2 2026-05-01 09:58:47 -03:00
run_quick.sh v4.2.0: full (pure) post-quantum mode + critical dedup nonce fix 2026-07-09 21:15:14 -03:00
test_arg_order.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_audit.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_audit_flake.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_block_swap.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_codec_exact_size.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_codec_exact_size.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_completions_manpage.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_ct_timing.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_ct_timing.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_dedup_nonce.sh v4.2.0: full (pure) post-quantum mode + critical dedup nonce fix 2026-07-09 21:15:14 -03:00
test_dedup_props.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_dist_reproducible.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_f06_hmac.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_f08_topmac.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_f09_preface.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_f10_kdf_default.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_f11_authfail_message.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_f12_comment.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_gui_branding.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_help_consistency.sh GUI rework for source-only builds + CLI security fixes + packaging + cross-platform scaffolding 2026-07-10 12:45:46 -03:00
test_hmac_incremental.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_hmac_incremental.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_kdf_transparency.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_kdf_transparency.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_mlkem_fips203.sh crypto: make ML-KEM-768 genuinely FIPS 203-conformant (validated vs OpenSSL) 2026-07-10 13:27:37 -03:00
test_packaging_syntax.sh docs: complete zupt → vaptvupt rename; README v4.0.0 refresh 2026-06-11 22:32:31 -03:00
test_path_traversal.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_pq.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_pqbox.sh tests: make 'make check' pass on the source-only (WITH_SDK=0) build 2026-07-08 16:15:04 -03:00
test_sdk.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_sha256_shani.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_sha256_shani.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_static_analysis.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_threaded.sh v2.2.2 2026-05-01 09:58:47 -03:00
test_vaptvupt.c v2.1.7: Zupt is now licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) + VaptVupt v2.46.1(GPLv3) 2026-04-26 01:47:45 -03:00
test_vectors.c v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00
test_vv_decode_slack.sh v4.0.0: codec 2.60.4 security release, --pq-box sealed-box mode, F-16 fix 2026-06-10 18:48:58 -03:00