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)

This commit is contained in:
Cristian Cezar Moisés 2026-04-26 01:47:45 -03:00
commit d198dbb205
65 changed files with 2241 additions and 254 deletions

229
AUDIT.md
View file

@ -1,85 +1,101 @@
# Security Audit — Zupt v2.0.0
# Security Audit — Zupt v2.1.7
**Date:** March 29, 2026
**Date:** April 26, 2026
**Author:** Cristian Cezar Moisés
**Audit type:** Self-audit with formal verification (Jasmin CT proofs, ACSL contracts) and NIST/RFC test vectors
**Status:** No independent third-party audit performed
**License (audit covers):** AGPL-3.0-or-later (Zupt core), GPL-3.0-or-later (VaptVupt codec) — commercial: sac@securityops.co
---
## 1. Cryptographic Test Vector Verification
## 1. Cryptographic Test Vector Verification — re-validated on v2.1.7
All primitives tested against published reference vectors:
All primitives re-tested against published reference vectors after the v2.1.7 relicense. Identical results to v2.0.0 — as expected, since the relicense did not modify any cryptographic code paths.
| Primitive | Standard | Vectors | Status |
|-----------|----------|---------|--------|
| Primitive | Standard | Vectors | v2.1.7 Status |
|-----------|----------|---------|---------------|
| SHA-256 | FIPS 180-4 | 3 (empty, "abc", 448-bit) | **PASS** |
| HMAC-SHA256 | RFC 4231 | 2 (TC2: "Jefe", TC3: 20×0xAA) | **PASS** |
| SHA3-256 | FIPS 202 | 2 (empty, "abc") | **PASS** |
| SHAKE-128 | FIPS 202 | 1 (empty, 128-bit output) | **PASS** |
| X25519 | RFC 7748 §5.2 | 2 (both test vectors) | **PASS** |
| X25519 | RFC 7748 §6.1 | 2 (TV1, TV2) | **PASS** |
| ML-KEM-768 | FIPS 203 | 2 (5-trial roundtrip + implicit rejection) | **PASS** |
| XXH64 | xxHash spec | 1 (empty string, seed=0) | **PASS** |
| **Total** | | **13** | **13/13 PASS** |
Reproduction: `make test-vectors && ./test_vectors`
## 2. Jasmin Constant-Time Verification
| Function | Purpose | Status |
|----------|---------|--------|
| Function | Purpose | v2.1.7 Status |
|----------|---------|---------------|
| `zupt_mac_verify_ct` | HMAC comparison | **✅ Linked, CT-proven** |
| `zupt_ct_select_32` | ML-KEM FO select | **✅ Linked, CT-proven** |
| `zupt_fe_cswap` | X25519 conditional swap | **✅ Linked, CT-proven** |
| `zupt_aes256_blk` | AES-256 single-block (AES-NI) | **✅ Linked, CT by hardware** |
| `zupt_aes256_ctr4` | AES-256 4-block pipeline | **✅ Linked, CT by hardware** |
| `zupt_fe_cswap` | X25519 conditional swap | **⚠ Not yet linked** (limb representation mismatch: 5×u51 vs 4×u64) |
| `zupt_aes256_blk` | AES-256 single-block (AES-NI) | **⚠ Not yet linked** (Jasmin stack offset bug: `[rsp+1]` instead of `[rsp+16]`) |
The two unwired functions remain on the v1.6+ roadmap; their fallback implementations (C masked XOR for `fe_cswap`, C T-table AES for `aes256_blk`) are functionally correct and continue to be the production code path.
## 3. ACSL Formal Annotations
19 security-critical functions annotated with `requires/ensures/assigns` contracts.
Target: `frama-c -wp -wp-rte -wp-model Typed+Cast`
## 4. Security Hardening
## 4. Security Hardening — current status
| Feature | Status |
|---------|--------|
| mlock() key protection | **✅ Active** |
| Feature | v2.1.7 Status |
|---------|---------------|
| `mlock()` key protection | **✅ Active** |
| Buffer canaries (keyring) | **✅ Active** |
| Always-decrypt timing mitigation | **✅ Active** |
| AFL++ fuzz harnesses | **✅ Available** (`make fuzz-build`) |
| TOCTOU mitigation (`fstat` on fd, not `stat` on path) | **✅ Active** (since v2.1.4) |
| X25519 scalar wipe via `volatile` | **✅ Active** (since v2.1.4) |
| Password strength warnings | **✅ Active** (since v2.1.6) |
| Block-level deduplication with content verification | **✅ Active** (since v2.1.5) |
## 5. VaptVupt Codec Tests
## 5. VaptVupt Codec Tests — re-validated on v2.1.7
| Test | Status |
|------|--------|
| Roundtrip all 3 modes (UF/BAL/EXT) | **PASS** |
| Roundtrip + AES-256 encryption | **PASS** |
| Roundtrip + PQ hybrid encryption | **PASS** |
| Roundtrip + multi-threaded | **PASS** |
| Roundtrip + solid mode | **PASS** |
| Test | v2.1.7 Status |
|------|---------------|
| Roundtrip text mode 0 / 1 / 2 (each 64 KB) | **PASS** (3) |
| Roundtrip binary mode 1 (128 KB) | **PASS** |
| Incompressible fallback to store | **PASS** |
| Empty/small input | **PASS** |
| Multi-block (2 MB) | **PASS** |
| Empty / small input (3 bytes) | **PASS** (2) |
| `vv_xxh64``zupt_xxh64` alias | **PASS** |
| Roundtrip large 2 MB (mode 1) | **PASS** |
| RLE-like data roundtrip | **PASS** |
| `window_log=20` roundtrip | **PASS** |
| **Total** | **11/11 PASS** |
| Suite | Tests | Result | What It Covers |
|-------|-------|--------|----------------|
| Regression | 16 | **16/16 PASS** | All codecs, modes, encryption, edge cases, corruption detection |
| Multi-threaded | 14 | **14/14 PASS** | N=1/2/4/8 threads, large files, 1000 files, MT+encryption |
## 6. Test Suite Summary — v2.1.7
| Suite | Tests | v2.1.7 Result | What It Covers |
|-------|-------|---------------|----------------|
| NIST/RFC vectors | 13 | **13/13 PASS** | See §1 |
| VaptVupt unit | 11 | **11/11 PASS** | See §5 |
| Regression | 22 | **22/22 PASS** | All codecs, modes, encryption, edge cases, corruption detection |
| Multi-threaded | 14 | **13/14 PASS** ⚠ | N=1/2/4/8, large files, MT+encryption |
| Post-quantum | 10 | **10/10 PASS** | Keygen, PQ encrypt/decrypt, wrong key, password compat, PQ+MT, 2 MB |
| Quick smoke | 9 | **9/9 PASS** | Normal, solid, encrypted, wrong pw, MT, fast, store, PQ, integrity |
| NIST vectors | 13 | **13/13 PASS** | See table above |
| **Total** | **62** | **62/62 PASS** | |
| **Total** | **70** | **69/70 PASS** | |
**The single failing case is `Solid+N=8 (3 mismatches)` — see §11 (newly-recorded known limitation).**
Reproduction: `make test-all`
---
## 3. Memory Safety
## 7. Memory Safety — re-validated on v2.1.7
| Tool | Command | Result |
|------|---------|--------|
| AddressSanitizer | `make test-asan` | **Zero errors** |
| Tool | Command | v2.1.7 Result |
|------|---------|---------------|
| AddressSanitizer (plain) | `./zupt_asan compress` / `extract` | **Zero errors** |
| AddressSanitizer (encrypted, PBKDF2) | `./zupt_asan compress -p` | **Zero errors** |
| AddressSanitizer (PQ hybrid) | `./zupt_asan compress --pq` / `extract --pq` | **Zero errors** |
| AddressSanitizer (multi-threaded N=4) | `./zupt_asan compress -t 4` | **Zero errors** |
| AddressSanitizer (deduplication) | `./zupt_asan compress --dedup` | **Zero errors** |
| UndefinedBehaviorSanitizer | Built with `-fsanitize=address,undefined` | **Zero errors** |
| All code paths tested | Normal + solid + encrypted + PQ + MT | **Clean** |
Reproduction:
```bash
@ -87,94 +103,53 @@ make test-asan
./zupt_asan compress /tmp/t.zupt /path/to/data/
./zupt_asan extract -o /tmp/out/ /tmp/t.zupt
./zupt_asan keygen -o /tmp/k.key
./zupt_asan keygen --pub -o /tmp/pub.key -k /tmp/k.key
./zupt_asan compress --pq /tmp/pub.key /tmp/pq.zupt /path/to/data/
./zupt_asan extract --pq /tmp/k.key -o /tmp/pqout/ /tmp/pq.zupt
./zupt_asan compress -t 4 /tmp/mt.zupt /path/to/data/
./zupt_asan compress --dedup /tmp/d.zupt /path/to/data/
```
---
## 4. Compiler Warning Audit
## 8. Compiler Warning Audit
| Compiler | Flags | Warnings |
|----------|-------|----------|
| GCC 13.x | `-Wall -Wextra -Wpedantic -O2 -std=c11` | **Zero** |
| Clang 18.x | `-Wall -Wextra -Wpedantic -O2 -std=c11` | **Zero** |
| Compiler | Flags | v2.1.7 Warnings |
|----------|-------|-----------------|
| GCC 13.x | `-Wall -Wextra -O2 -std=c11` | **Zero** |
| GCC 13.x (pedantic) | `-Wall -Wextra -Wpedantic -O2 -std=c11` | **Zero** |
---
## 5. Constant-Time Analysis
## 9. Constant-Time Analysis — unchanged from v2.0.0
| Function | Location | CT Method | Jasmin Verified? | Risk Level |
|----------|----------|-----------|-----------------|------------|
| HMAC comparison | `zupt_crypto.c:252` | 4×u64 XOR accumulation | **Yes**`zupt_mac_verify_ct` linked | **None** (Jasmin proven) |
| ML-KEM FO select | `zupt_mlkem.c:593` | 4×u64 masked select | **Yes**`zupt_ct_select_32` linked | **None** (Jasmin proven) |
| HMAC comparison | `zupt_crypto.c` | 4×u64 XOR accumulation | **Yes**`zupt_mac_verify_ct` linked | **None** (Jasmin proven) |
| ML-KEM FO select | `zupt_mlkem.c` | 4×u64 masked select | **Yes**`zupt_ct_select_32` linked | **None** (Jasmin proven) |
| AES-256 CTR (4-block) | `zupt_aes256.c` (AES-NI dispatch) | Hardware AES-NI + AVX | **Yes**`zupt_aes256_ctr4` linked | **None** (CT by hardware) |
| ML-KEM NTT butterfly | `zupt_mlkem.c` | Montgomery reduction (branchless) | No | Low |
| ML-KEM CBD sampling | `zupt_mlkem.c` | Bitwise operations only | No | Low |
| X25519 fe_cswap | `zupt_x25519.c:95` | Masked XOR swap | No (limb mismatch) | Low (C is branchless) |
| X25519 Montgomery ladder | `zupt_x25519.c:243` | Fixed 255 iterations | No | Low |
| AES-256 encrypt | `zupt_aes256.c:59` | **Table-based S-box** | **No** | **HIGH on shared HW** |
| X25519 fe_cswap | `zupt_x25519.c` | Masked XOR swap | No (limb mismatch) | Low (C is branchless) |
| X25519 Montgomery ladder | `zupt_x25519.c` | Fixed 255 iterations | No | Low |
| AES-256 encrypt (C fallback) | `zupt_aes256.c` | Table-based S-box | No | **HIGH on shared HW without AES-NI** |
| SHA-256 | `zupt_sha256.c` | Table-based constants | No | Low (not secret-indexed) |
| Keccak-f[1600] | `zupt_keccak.c` | Bitwise XOR/ROT only | No | None |
| Key wipe | `zupt_crypto.c` | `explicit_bzero` / volatile | No | Low |
### Jasmin Assembly Verification
Two functions confirmed active in binary via `nm`:
Functions confirmed active in binary via `nm`:
```
0000000000014ae0 T zupt_mac_verify_ct ← Jasmin assembly, CT proven
0000000000014b20 T zupt_ct_select_32 ← Jasmin assembly, CT proven
T zupt_mac_verify_ct ← Jasmin assembly, CT proven
T zupt_ct_select_32 ← Jasmin assembly, CT proven
T zupt_aes256_ctr4 ← Jasmin assembly, CT by hardware
```
Assembly generated by `jasminc 2026.03.0`. Constant-time enforced by Jasmin type system: secret-typed variables cannot flow into branch conditions or memory indices.
### Not Wired (with reason)
| Function | Issue | Fallback |
|----------|-------|----------|
| `zupt_fe_cswap` | Jasmin: 4×u64 limbs, C: 5×u51 — incompatible | C masked XOR (branchless) |
| `zupt_aes256_blk` | Stack offset bug: `rk.[1]``[rsp+1]` not `[rsp+16]` | C table-based AES |
---
## 6. Key Material Lifecycle
| Phase | Method | Verified |
|-------|--------|----------|
| Generation | OS CSPRNG: `getrandom(2)` / `/dev/urandom` / `RtlGenRandom` | Hard fail if unavailable |
| Storage | Stack-local arrays (no heap allocation for keys) | ASAN verified |
| Usage | Passed by const pointer to AES-CTR / HMAC | No copies to heap |
| Wipe | `zupt_secure_wipe()`: `explicit_bzero` (glibc 2.25+), `SecureZeroMemory` (Win), volatile fallback | Compiler cannot optimize out |
| Scope exit | Stack frame destroyed | Keys were on stack |
All intermediate buffers in PBKDF2, hybrid KEM, ML-KEM encaps/decaps, and X25519 wiped before return.
---
## 7. Nonce Security
**Scheme:** `per_block_nonce = base_nonce XOR pad_le(block_seq, 8)`
- `base_nonce`: 128-bit random from CSPRNG, generated once per archive.
- `block_seq`: monotonically increasing 0, 1, 2, ... per archive.
- **Uniqueness within archive:** Guaranteed (distinct seq → distinct nonce).
- **Uniqueness across archives:** 2^-128 collision probability per pair (birthday bound on random base).
---
## 8. Encrypt-then-MAC Ordering
| Step | Action | Verified |
|------|--------|----------|
| 1 | Compute HMAC over `nonce ‖ ciphertext` | HMAC input is nonce+ct, not plaintext |
| 2 | Verify HMAC before any decryption | Code path: MAC check → early return if fail → decrypt only on success |
| 3 | Decrypt only authenticated data | No plaintext produced from unauthenticated ciphertext |
**Prevents:** Chosen-ciphertext attacks, padding oracles, ciphertext tampering.
---
## 9. Bugs Found and Fixed (v0.5.1 → v1.5.0)
## 10. Bugs Found and Fixed (v0.5.1 → v2.1.7)
| Bug | Severity | Version Fixed | Impact |
|-----|----------|---------------|--------|
@ -187,24 +162,62 @@ All intermediate buffers in PBKDF2, hybrid KEM, ML-KEM encaps/decaps, and X25519
| ML-KEM `inv_ntt` wrong table | High | v1.0.0 | NTT roundtrip failure |
| PQ nonce mismatch | High | v1.0.0 | Encrypt/decrypt used different nonces |
| X25519 `AA + a24*E` formula | High | v1.1.0 | Wrong curve, not interoperable |
| Dead `match_cost()` | Low | v1.1.0 | Clang warning |
| `const polyvec` qualifier | Low | v1.1.0 | Pedantic warnings |
| `__int128` pedantic | Low | v1.1.0 | Pedantic warning |
| `copy_match_scalar` overlap corruption | High | v2.0.0 | Silent corruption on offset 47 (8-byte bulk overlap) |
| `vva_encode_sequences` heap overflow | High | v2.0.0 | nseq×5+1 sizing insufficient on large literal runs |
| `SIGILL` on Linux Mint (AES dispatch) | High | v2.0.0 | Jasmin AES uses VEX → needs OSXSAVE+XCR0, not just AES-NI |
| TOCTOU race in `get_device_size` | High | v2.1.4 | Path swap between `stat` and `open`; CodeQL alert |
| LZHP prediction encoding desync | High | v2.1.3 | Data corruption on structured data |
---
## 10. Known Limitations
## 11. Known Limitations
| Limitation | Impact | Mitigation | Status |
|------------|--------|------------|--------|
| Table-based AES (C fallback) | Cache-timing on shared hardware | Jasmin AES-NI path exists but has offset bug | **Open** — fix `.jazz` source |
| **Solid mode + multi-threaded archives over ~3 MB** ⚠ NEW | Decompression error "Solid block N decompression failed" on extract. Reproduces on v2.1.6 and v2.1.7 (not introduced by relicense). Compression succeeds; extraction fails on a specific block. The CLI clamps `--solid` to N=1 with a stderr note; this bug appears in the inner solid-stream framing when the on-disk archive happens to span ≥4 blocks of ~512 KB each. | Use plain `--solid` (without `-t >1`) for solid archives; non-solid MT works correctly. Investigation in progress in `zupt_format.c:14281452` (block_seq accounting around encryption-header consumption). | **Open** — pre-existing, not relicense-induced |
| Table-based AES (C fallback) | Cache-timing on shared hardware | Jasmin AES-NI 4-block pipeline (`zupt_aes256_ctr4`) IS linked and is the default on x86_64+AVX. Single-block Jasmin (`zupt_aes256_blk`) has stack offset bug. | **Partial** — 4-block path covered |
| Table-based SHA-256 | Theoretical cache-timing | Not used on secret-indexed data | **Accepted** |
| PBKDF2 not quantum-safe | Quantum password brute-force | Use `--pq` mode | **Documented** |
| No `mlock()` | Keys swappable to disk | Short key lifetime + `zupt_secure_wipe` | **Planned** |
| No fuzzing performed | Undiscovered bugs | AFL++ setup in FUZZING.md | **Planned** |
| No independent audit | Self-assessed only | Open source + Jasmin proofs | **Planned** |
| X25519 Jasmin not linked | C fallback for fe_cswap | C is branchless but compiler-dependent | **Open** — limb mismatch |
| No fuzzing performed | Undiscovered bugs | AFL++ harnesses available via `make fuzz-build`; not yet executed in production | **Planned** |
| No independent audit | Self-assessed only | Open source under AGPL-3.0 + Jasmin formal proofs + commercial support available at sac@securityops.co | **Planned** |
| X25519 Jasmin not linked | C fallback for `fe_cswap` | C is branchless but compiler-dependent. Limb mismatch (Jasmin: 4×u64, C: 5×u51) is the blocker. | **Open** |
---
© 2026 Cristian Cezar Moisés — MIT License
## 12. v2.1.7 Relicense + VaptVupt Upgrade — Audit Implications
The v2.1.7 release does two distinct things, both of which were validated separately:
**(A) Relicense from MIT to AGPL-3.0-or-later (Zupt core only).** VaptVupt was already GPL-3.0-or-later in upstream and remains so. The relicense touches only license metadata (SPDX headers, copyright lines, `LICENSE` files, `--help` strings, README badges, packaging metadata). **No cryptographic, compression, threading, encryption, or control-flow code was modified by the relicense itself.**
**(B) Upgrade VaptVupt 2.40.0 → 2.46.1.** The 12 VaptVupt files (`src/vv_*.c`, `src/vaptvupt_api.c`, `include/vaptvupt*.h`, `include/vv_*.h`) were replaced from upstream master at `github.com/cristiancmoises/vaptvupt`. Public API and `vv_options_t` are byte-identical; no caller changes required. Most relevantly, **v2.46.1 includes a memory-safety fix** for a 16,384-byte leak on three decoder error paths in `vva_decode_sequences_impl` — closing a denial-of-service vector where many malformed compressed frames could exhaust memory.
Audit results on the upgraded + relicensed tree:
- **All NIST/RFC test vectors continue to pass on v2.1.7.**
- **All ASAN/UBSAN sweeps continue to be clean on v2.1.7.**
- **The single MT failing case (`Solid+N=8`) is verified pre-existing on v2.1.6** by stashing v2.1.7 changes, rebuilding the v2.1.6 tree, and reproducing the same failure on the same fixture — it is independent of both the relicense and the codec upgrade.
The relicense formally establishes a commercial-licensing channel at **sac@securityops.co** for users whose use case is incompatible with AGPL's source-disclosure obligations.
---
## 13. Reproduction
```bash
# Full validation
make clean && make
make test-all # NIST vectors + VV unit + regression + threaded + PQ
make test-asan # AddressSanitizer build
# (run ASAN sweep manually per §7)
# Spot-check the relicense
./zupt --version # should print: zupt 2.1.7
./zupt 2>&1 | grep -i lic # should print: License: AGPL-3.0-or-later (commercial: sac@securityops.co)
grep -c "SPDX-License-Identifier" src/*.c src/*.h include/*.h tests/*.c
# (should be > 30, all sources covered)
```
---
© 2026 Cristian Cezar Moisés — AGPL-3.0-or-later
Commercial licensing: sac@securityops.co

View file

@ -5,6 +5,68 @@ Format follows [Keep a Changelog](https://keepachangelog.com/).
---
## [2.1.7] — 2026-04-26
### Changed — License (MIT → AGPL-3.0-or-later)
- **Zupt is now licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).** All previous versions are also retroactively re-licensed under AGPL-3.0-or-later by the sole copyright holder. The MIT license under which v0.1.0 through v2.1.6 were originally released is hereby withdrawn for any future use; cached MIT-licensed copies of those versions remain valid under their original terms but are not authorized for redistribution under MIT going forward.
- **Rationale.** Years of work on post-quantum hybrid encryption (ML-KEM-768 + X25519), formally-verified Jasmin constant-time assembly, authenticated encryption (AES-256-CTR + HMAC-SHA256), and the custom VaptVupt compression codec were given to the world under MIT — and silent absorption into proprietary products is the foreseeable end-state of permissive licensing on infrastructure software. The AGPL closes the SaaS loophole specifically: anyone running a modified Zupt as a network service (cloud backup product, archival backend, etc.) must release the source code of their modifications. Personal use, internal corporate use, sysadmin use, research use, and academic use are unaffected and remain unrestricted.
- **Commercial licensing channel established.** Organizations whose use is incompatible with the AGPL (proprietary embedding, hosted SaaS without source disclosure, redistribution under closed terms, requirement of warranty/indemnification) can obtain a commercial license at: **sac@securityops.co**.
### Changed — VaptVupt License clarification (GPL-3.0-or-later, unchanged from upstream)
- **The VaptVupt compression codec is licensed under GPL-3.0-or-later** (`src/vv_*.c`, `src/vaptvupt_api.c`, `include/vaptvupt.h`, `include/vaptvupt_api.h`, `include/vv_huffman.h`, `include/vv_ans.h`, `include/vv_platform.h`). This matches the canonical upstream at [github.com/cristiancmoises/vaptvupt](https://github.com/cristiancmoises/vaptvupt) and was not changed in this sprint — VaptVupt has been GPL-3.0-or-later since its initial release.
- **Why a separate license from Zupt's AGPL-3.0.** VaptVupt has independent reuse value as a standalone compression codec. Anyone wishing to embed VaptVupt in another GPL-3.0 project should be able to do so without inheriting the network-clause obligations of Zupt's AGPL.
- **Compatibility with Zupt.** GPL-3.0-or-later is two-way compatible with AGPL-3.0-or-later via the explicit GPL/AGPL combination provision in section 13 of both licenses. The combined Zupt binary remains valid AGPL-3.0.
- Earlier sprint drafts briefly considered GPL-2.0-or-later for kernel-mergeability; that path was incorrect (the Linux kernel is GPL-2-only and rejects GPL-3+ code) and was withdrawn before release. VaptVupt is and remains GPL-3.0-or-later.
### Upgraded — VaptVupt 2.40.0 → 2.46.1
- **Pulled in upstream VaptVupt v2.46.1** (April 22, 2026), six minor versions ahead of the previously bundled v2.40.0. All 12 VaptVupt files (`src/vv_*.c`, `src/vaptvupt_api.c`, `include/vaptvupt*.h`, `include/vv_*.h`) replaced from `github.com/cristiancmoises/vaptvupt` `master`.
- **Public API and on-disk frame format are byte-identical** to v2.40.0 — confirmed by diffing the public `vv_compress`/`vv_decompress`/`vv_default_options`/`vv_compress_bound` declarations and the `vv_options_t` struct. **No caller changes required** in `zupt_lzh.c`, `zupt_format.c`, `zupt_main.c`, etc.
- **Improvements pulled in:**
- **v2.41v2.43** internal tightening (covered by upstream's "correctness release" v2.44.0 rollup).
- **v2.44.0** — correctness release ships over v2.43.0 (encoder ANS state recovery, decoder bounds tightening).
- **v2.45.0** — size-based window-log heuristic (better ratio on small inputs without manual tuning).
- **v2.46.0** — Huffman-in-SEQ literal coding (additional ratio gain on text-heavy streams).
- **v2.46.1****memory-safety patch:** fixes a 16,384-byte leak on three decoder error paths in `vva_decode_sequences_impl` (`src/vv_ans.c`). The `dec_ll` buffer was not freed on three malformed-input return paths. No behavior change on the success path; output byte-identical to v2.46.0 for valid inputs. **This is a correctness/safety fix that closes a denial-of-service vector** where an attacker controlling many malformed compressed frames could exhaust memory.
### Notes on the v2.46.1 upgrade
- VaptVupt 2.46.1 retains the same SPDX-License-Identifier headers (`GPL-3.0-or-later`); the Zupt-side commercial-licensing line (`Commercial licensing: sac@securityops.co`) was re-applied to each file's header block.
### Added — `LICENSE-VAPTVUPT`
- New top-level file containing the formal GPL-3.0-or-later notice, separate-codec rationale (independent reuse value), AGPL/GPL-3 compatibility explanation per section 13 of both licenses, commercial-license clause, pointer to upstream, and the full canonical GPLv3 text (~740 lines).
### Added — Formal Preamble in `LICENSE`
- The top-level `LICENSE` now opens with a formal AGPL preamble explaining why AGPL was chosen, what the SaaS clause means in practice for users vs. operators, and a commercial-licensing clause pointing to **sac@securityops.co**. The full canonical AGPL-3.0 text follows below the preamble.
### Added — SPDX-License-Identifier headers (full coverage)
- Every `.c` and `.h` source file now carries a machine-readable SPDX tag: `AGPL-3.0-or-later` for Zupt-core, `GPL-3.0-or-later` for VaptVupt. Each header also includes the commercial-license contact. This brings Zupt into REUSE 3.0 / SPDX 2.3 compliance and enables automated license scanning (FOSSology, ScanCode, etc.) to correctly classify the project.
### Changed — Sister projects relicensed
- `zupt-web` and `zupt-android` (separate repositories) are also relicensed to **AGPL-3.0-or-later** for the same reason. License files and README snippets prepared in this sprint can be applied to those repositories.
### Changed — Surface-level metadata
- `--help` and `--version` output: `License: MIT``License: AGPL-3.0-or-later (commercial: sac@securityops.co)`.
- Manpage `doc/zupt.1` `.SH LICENSE` section rewritten.
- README badge: `license-MIT-blue``license-AGPL--3.0-blue`. New commercial badge added.
- README: full License section rewrite + new "Commercial Licensing" section.
- README comparison table: license row updated.
- GUI About box: zupt credit "MIT" → "AGPL-3.0".
- `gui/setup.py`: `license="AGPL-3.0-or-later"` and OSI classifier updated.
- `gui/packaging/rpm/zupt-gui.spec`: `License: AGPL-3.0-or-later`, `Requires: zupt >= 2.1.7`.
- `gui/LICENSE-GUI`: rewritten as AGPL-3.0-or-later notice.
- `Makefile`: header banner updated to v2.1.7 with SPDX tag; comment "Apache-2.0, integrated under MIT" replaced with "GPL-3.0-or-later, separate copyleft".
### Audit — Security re-validation on the relicensed tree
- See `AUDIT.md` for the v2.1.7 refresh: full rebuild, NIST/RFC test vector re-run, ASAN re-run, regression suite re-run, and the updated table of known limitations.
### Notes for downstream packagers
- The SPDX tags are authoritative. If an automated license scanner produces a different result, the SPDX tags in the source file headers should be treated as the source of truth, supplemented by the `LICENSE` and `LICENSE-VAPTVUPT` files.
- Distributions that previously shipped Zupt under MIT should update their package metadata. The on-disk binary's behavior is unchanged; only the licensing terms have changed.
---
## [2.1.6] — 2026-04-22
### Added — Archive Info Command (`zupt info`)

765
LICENSE
View file

@ -1,9 +1,764 @@
MIT License
================================================================================
ZUPT — POST-QUANTUM AUTHENTICATED BACKUP COMPRESSION UTILITY
Copyright (c) 2026 Cristian Cezar Moisés
Copyright (C) 2026 Cristian Cezar Moisés
Contact for commercial licensing: sac@securityops.co
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
================================================================================
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Zupt is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Zupt is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
WHY AGPL-3.0
--------------------------------------------------------------------------------
This software is licensed under the GNU Affero General Public License v3.0
(AGPL-3.0-or-later) for one reason: to keep it free for everyone.
The author has invested years of personal effort developing post-quantum
hybrid encryption (ML-KEM-768 + X25519), formally verified constant-time
assembly (Jasmin), authenticated encryption (AES-256-CTR + HMAC-SHA256),
and a custom high-performance compression codec (VaptVupt). The intent is
that this work benefits users, researchers, students, and the wider free
software community — NOT that it be quietly absorbed into proprietary,
closed-source, or hosted commercial products without giving anything back.
The AGPL is specifically chosen (over the GPL or MIT) because it closes
the "Software-as-a-Service loophole": any organization that runs a
modified version of Zupt as a network service (for example, as a
backend for a backup-as-a-service product, a cloud archival service,
or any other commercial offering accessed over a network) MUST make
the corresponding source code of their modified version available to
the users of that service.
If you are an individual, a non-profit, a researcher, a student, a
sysadmin, or any business that simply USES Zupt (without redistributing
modifications and without operating it as a network service for third
parties), the AGPL imposes essentially no obligations on you. Use it
freely. Back up your data. Encrypt your archives.
--------------------------------------------------------------------------------
COMMERCIAL LICENSING
--------------------------------------------------------------------------------
If your intended use is incompatible with the AGPL — for example:
* You wish to incorporate Zupt or VaptVupt into a closed-source
product, appliance, or firmware.
* You wish to operate Zupt as a hosted/SaaS backend without releasing
your modifications to your end users.
* You wish to redistribute Zupt as part of a proprietary commercial
product without the AGPL's source-disclosure obligations.
* You require a warranty, indemnification, or written terms that the
AGPL does not provide.
A commercial license is available. Please contact:
sac@securityops.co
Commercial licensing terms, pricing, and the scope of the granted rights
are negotiated case-by-case. The author retains full copyright ownership
of all original Zupt source code (including the integrated VaptVupt
codec) and is therefore able to grant alternative licensing terms.
--------------------------------------------------------------------------------
THIRD-PARTY COMPONENTS
--------------------------------------------------------------------------------
The integrated VaptVupt compression codec (src/vv_*.c, include/vaptvupt*.h,
include/vv_*.h) is distributed under GPL-3.0-or-later — separate from
Zupt's AGPL-3.0 — because VaptVupt has independent reuse value as a
standalone compression codec. GPL-3.0-or-later is two-way compatible
with AGPL-3.0-or-later via the explicit AGPL/GPL combination provision
in section 13 of the AGPL.
The canonical upstream of VaptVupt is github.com/cristiancmoises/vaptvupt.
The version embedded in Zupt is kept in sync with that upstream; the
internal API and on-disk frame format are byte-compatible.
The XXH64 checksum implementation in src/zupt_xxh.c and src/vv_xxh64.c
is derived from xxHash by Yann Collet (BSD-2-Clause, public domain
fallback). This is permissively licensed and compatible with both
AGPL-3.0 and GPL-3.0.
The Jasmin formally-verified assembly files in jasmin/*.s are generated
by jasminc from .jazz sources written by the author and are covered by
the same AGPL-3.0-or-later license as the rest of Zupt.
================================================================================
THE FULL TEXT OF THE GNU AFFERO GENERAL PUBLIC
LICENSE VERSION 3 FOLLOWS BELOW.
================================================================================
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.

737
LICENSE-VAPTVUPT Normal file
View file

@ -0,0 +1,737 @@
================================================================================
VAPTVUPT — High-Performance Lossless Compression Codec
Copyright (C) 2026 Cristian Cezar Moisés
Contact for commercial licensing: sac@securityops.co
================================================================================
VaptVupt (the source files src/vv_encoder.c, src/vv_decoder.c, src/vv_ans.c,
src/vv_huffman.c, src/vv_simd.c, src/vv_xxh64.c, src/vaptvupt_api.c, and the
headers include/vaptvupt.h, include/vaptvupt_api.h, include/vv_huffman.h,
include/vv_ans.h, include/vv_platform.h) is free software: you can redistribute
it and/or modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the License,
or (at your option) any later version.
VaptVupt is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along
with this program. If not, see <https://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
WHY GPL-3.0-or-later (separately from Zupt's AGPL-3.0)
--------------------------------------------------------------------------------
VaptVupt is licensed under GPL-3.0-or-later — separate from Zupt's
AGPL-3.0-or-later — because VaptVupt is independently useful as a
standalone compression codec. Anyone wishing to embed VaptVupt in
another GPL-3.0 (or compatible) project should be able to do so without
inheriting the network-clause obligations of the AGPL.
GPL-3.0-or-later is two-way compatible with AGPL-3.0-or-later via the
explicit GPL/AGPL combination provision in section 13 of the AGPL-3.0
and the corresponding provision in section 13 of the GPL-3.0. This is
why VaptVupt can ship inside Zupt's AGPL-3.0 archive without conflict,
while remaining independently usable by GPL-3.0 projects on its own.
The canonical upstream of VaptVupt is at:
https://github.com/cristiancmoises/vaptvupt
The version embedded in Zupt is kept in sync with that upstream;
internal API and on-disk frame format are byte-compatible.
--------------------------------------------------------------------------------
COMMERCIAL LICENSING
--------------------------------------------------------------------------------
If you need to use VaptVupt in a proprietary, closed-source, or
otherwise GPL-incompatible product, a commercial license is available.
Please contact: sac@securityops.co
The author retains full copyright ownership of all original VaptVupt
source code and is therefore able to grant alternative licensing terms.
================================================================================
THE FULL TEXT OF THE GNU GENERAL PUBLIC
LICENSE VERSION 3 FOLLOWS BELOW.
================================================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View file

@ -1,4 +1,8 @@
# Zupt v2.1.1 — Makefile with VaptVupt codec + Jasmin integration
# Zupt v2.1.7 — Makefile with VaptVupt codec + Jasmin integration
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Copyright (C) 2026 Cristian Cezar Moisés
# Commercial licensing: sac@securityops.co
#
# Multi-architecture: builds on x86_64, aarch64, armhf, ppc64le, s390x, riscv64.
# Tested on: Linux, macOS, Windows (MSYS2), Termux (Android aarch64).
@ -52,7 +56,7 @@ ZUPT_SOURCES = src/zupt_main.c src/zupt_format.c src/zupt_lz.c src/zupt_lzh.c \
src/zupt_x25519.c src/zupt_mlkem.c src/zupt_cpuid.c src/zupt_mlock.c \
src/zupt_filetype.c src/zupt_disk.c src/zupt_dedup.c
# --- VAPTVUPT: VaptVupt codec sources (Apache-2.0, integrated under MIT) ---
# --- VAPTVUPT: VaptVupt codec sources (GPL-3.0-or-later, separate copyleft) ---
VV_SOURCES = src/vv_encoder.c src/vv_decoder.c src/vv_ans.c \
src/vv_huffman.c src/vv_simd.c src/vv_xxh64.c src/vaptvupt_api.c
@ -266,7 +270,7 @@ fuzz-build:
@echo " afl-fuzz -i corpus_vv -o findings_vv -- ./fuzz_vv_decompress"
help:
@echo "Zupt v2.0.0 build targets:"
@echo "Zupt v2.1.7 build targets:"
@echo " make Build zupt binary"
@echo " make V=1 Build with verbose output"
@echo " make test Quick test"

View file

@ -3,10 +3,11 @@
**Compress everything. Trust nothing. Encrypt always.**
![Build](https://img.shields.io/badge/build-passing-brightgreen)
![License](https://img.shields.io/badge/license-MIT-blue)
![Version](https://img.shields.io/badge/version-2.1.6-orange)
![License](https://img.shields.io/badge/license-AGPL--3.0-blue)
![Version](https://img.shields.io/badge/version-2.1.7-orange)
![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey)
![openSUSE](https://img.shields.io/badge/platform-openSUSE-73BA25?logo=opensuse&logoColor=white)
![Commercial](https://img.shields.io/badge/commercial-sac%40securityops.co-darkgreen)
Backup compression with hardware-adaptive codec selection, AES-256 authenticated encryption, post-quantum key encapsulation, and full-disk backup. Pure C11, zero dependencies, ~13,000 lines. Builds and runs on x86_64, aarch64, armhf, ppc64le, s390x, and riscv64.
@ -273,7 +274,7 @@ make install DESTDIR=/buildroot
| Multi-architecture | **6 arches** | ✓ | ✓ | ✓ |
| Zero dependencies | ✓ | ✓ | — | — |
| Codebase | ~12K lines | ~10K | ~75K | ~100K+ |
| License | MIT | GPL | BSD | LGPL |
| License | **AGPL-3.0** (commercial available) | GPL | BSD | LGPL |
---
@ -380,13 +381,37 @@ All codecs are forward-compatible: archives created with any codec can be read b
| **v2.1.3** | **LZHP prediction encoding fix (data corruption on structured data), shared write_enc_header, SOLID flag removed from disk, 78 tests** |
| **v2.1.4** | **CodeQL: 4 security fixes — TOCTOU races eliminated (fstat on fd), X25519 scalar wipe via volatile, 78 tests** |
| **v2.1.5** | **Block-level deduplication (`--dedup`), XXH64 fingerprint index, DEDUP_REF block type, 81 tests** |
| **v2.1.6** | **`zupt info` archive metadata command, password strength warnings, VaptVupt 2.40.0 (format_v2), GUI desktop application, 97 tests** |
| **v2.1.7** | **Relicense MIT → AGPL-3.0-or-later. VaptVupt remains GPL-3.0-or-later (kept in sync with upstream); upgraded VaptVupt 2.40.0 → 2.46.1. Full SPDX coverage, refreshed security audit, commercial-license channel via sac@securityops.co** |
See [CHANGELOG.md](CHANGELOG.md) for detailed per-version changes.
---
## License
MIT | [LICENSE](LICENSE).
**Zupt is licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).**
The full license text is in [LICENSE](LICENSE), preceded by a formal preamble explaining the rationale. In short:
- **You can use Zupt freely** — for personal backups, in your business, on your servers, in air-gapped environments, anywhere. The AGPL imposes essentially no obligations on simple use.
- **If you modify Zupt and run the modified version as a network service** (a backup-as-a-service product, a cloud archival backend, etc.), you must make the source code of your modifications available to the users of that service. This is the AGPL's "SaaS clause" and is the entire reason Zupt is AGPL rather than GPL or MIT.
- **If you redistribute Zupt** (modified or not), the AGPL travels with it.
The integrated **VaptVupt compression codec** (`src/vv_*.c`, `include/vaptvupt*.h`, `include/vv_*.h`) is licensed separately under **GPL-3.0-or-later** because VaptVupt is independently usable as a standalone compression codec (canonical upstream: [github.com/cristiancmoises/vaptvupt](https://github.com/cristiancmoises/vaptvupt)). GPL-3.0-or-later is two-way compatible with AGPL-3.0-or-later via the AGPL's section 13 compatibility clause, so the combined Zupt binary remains valid AGPL-3.0. See [LICENSE-VAPTVUPT](LICENSE-VAPTVUPT) for details.
### Commercial Licensing
If your intended use is incompatible with the AGPL — for example:
- Embedding Zupt or VaptVupt into a closed-source product, appliance, or firmware
- Operating Zupt as a hosted/SaaS backend without releasing your modifications
- Redistributing Zupt as part of a proprietary commercial product
- Requiring warranty, indemnification, or written terms
**A commercial license is available.** Contact: **sac@securityops.co**
The author retains full copyright ownership of all original Zupt and VaptVupt source code and is therefore able to grant alternative licensing terms.
Security vulnerabilities: see [SECURITY.md](SECURITY.md).

View file

@ -59,4 +59,4 @@ v2.0 Performance ← 4× AES throughput, parallel decompression
---
© 2026 Cristian Cezar Moisés — MIT License
© 2026 Cristian Cezar Moisés — AGPL-3.0-or-later (commercial: sac@securityops.co)

View file

@ -209,4 +209,4 @@ jasminc -arch x86-64 -o /dev/null jasmin/zupt_mlkem_select.jazz
---
© 2026 Cristian Cezar Moisés — MIT License
© 2026 Cristian Cezar Moisés — AGPL-3.0-or-later (commercial: sac@securityops.co)

View file

@ -124,7 +124,9 @@ ML-KEM-768 + X25519 keypair file.
.SH AUTHOR
Cristian Cezar Moisés <ethicalhacker@riseup.net>
.SH LICENSE
MIT License. VaptVupt codec files are dual-licensed MIT + Apache-2.0.
GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).
The integrated VaptVupt codec is licensed under GPL-3.0-or-later (canonical upstream: github.com/cristiancmoises/vaptvupt).
For commercial licensing inquiries, contact: sac@securityops.co.
.SH SEE ALSO
.BR gzip (1),
.BR zstd (1),

View file

@ -1,21 +1,34 @@
MIT License
================================================================================
ZUPT-GUI — Cross-Platform Desktop Frontend for Zupt
Copyright (c) 2026 Cristian Cezar Moisés
Copyright (C) 2026 Cristian Cezar Moisés
Contact for commercial licensing: sac@securityops.co
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
================================================================================
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Zupt-GUI is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation, either version 3 of the License, or (at your option)
any later version.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Zupt-GUI is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
--------------------------------------------------------------------------------
COMMERCIAL LICENSING
--------------------------------------------------------------------------------
For commercial licensing — including embedding into proprietary appliances,
hosted backup-as-a-service products, or any other use that is incompatible
with the AGPL's source-disclosure requirements — please contact:
sac@securityops.co
The full AGPL-3.0 text is available in the parent directory's LICENSE file
and at <https://www.gnu.org/licenses/agpl-3.0.txt>.
================================================================================

View file

@ -124,4 +124,6 @@ The GUI calls the zupt CLI binary — all cryptography runs in native C, not Pyt
## License
MIT
**AGPL-3.0-or-later** — see [LICENSE-GUI](LICENSE-GUI) and the project-root [LICENSE](../LICENSE).
For commercial licensing inquiries, contact: **sac@securityops.co**

0
gui/install.sh Executable file → Normal file
View file

0
gui/packaging/appimage/build-appimage.sh Executable file → Normal file
View file

View file

@ -2,14 +2,14 @@ Name: zupt-gui
Version: 1.0.0
Release: 1%{?dist}
Summary: Zupt GUI Post-Quantum Backup Utility
License: MIT
License: AGPL-3.0-or-later
URL: https://github.com/cristiancmoises/zupt
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
Requires: python3 >= 3.9
Requires: python3-pyside6
Requires: zupt >= 2.1.6
Requires: zupt >= 2.1.7
%description
Cross-platform graphical interface for the zupt backup compression

View file

@ -9,7 +9,7 @@ setup(
long_description_content_type="text/markdown",
author="Cristian Cezar Moisés",
url="https://github.com/cristiancmoises/zupt",
license="MIT",
license="AGPL-3.0-or-later",
packages=find_packages(where="src"),
package_dir={"": "src"},
py_modules=["zupt_gui"],
@ -23,7 +23,7 @@ setup(
"Development Status :: 4 - Beta",
"Environment :: X11 Applications :: Qt",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Security :: Cryptography",

View file

@ -462,7 +462,7 @@ class AboutTab(QWidget):
("SHA3/SHAKE FIPS 202 Hash / XOF", "color:#5a7a88;font-size:12px;font-family:monospace;"),
("", ""),
("CREDITS", "color:#00dde0;font-size:10px;font-weight:700;letter-spacing:2px;font-family:monospace;"),
("zupt Cristian Cezar Moises MIT", "color:#5a7a88;font-size:12px;font-family:monospace;"),
("zupt Cristian Cezar Moises AGPL-3.0", "color:#5a7a88;font-size:12px;font-family:monospace;"),
("github.com/cristiancmoises/zupt", "color:#3a5868;font-size:11px;font-family:monospace;"),
("", ""),
("libzupt Alessandro de Oliveira Faria MIT", "color:#5a7a88;font-size:12px;font-family:monospace;"),

0
gui/zupt-gui Executable file → Normal file
View file

View file

@ -3,7 +3,8 @@
* Public API and data structures
*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright 2026 Cristian.
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
* Zero dependencies. Pure C11.
*/
#ifndef VAPTVUPT_H

View file

@ -1,7 +1,8 @@
/*
* VaptVupt Zupt Integration API
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright 2026 Cristian.
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* ZUPT-COMPAT: This is the API that Zupt calls. It wraps the internal
* VaptVupt API with sensible defaults for backup workloads:

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt tANS Entropy Codec (v2: sparse header + 4-way interleaved)
*
* Standalone: define VV_ANS_STANDALONE to use without VaptVupt.

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt Canonical Huffman Codec
*
* Standalone header: can be used independently with VV_HUFFMAN_STANDALONE.

View file

@ -5,6 +5,8 @@
* the codebase. Supports GCC, Clang, MSVC, and Intel compilers.
*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*/
#ifndef VV_PLATFORM_H

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#ifndef ZUPT_H
#define ZUPT_H
@ -30,7 +30,7 @@
#define zupt_mkdir(p) mkdir(p, 0755)
#endif
#define ZUPT_VERSION_STRING "2.1.6"
#define ZUPT_VERSION_STRING "2.1.7"
#define ZUPT_FORMAT_MAJOR 1
#define ZUPT_FORMAT_MINOR 4

View file

@ -1,6 +1,7 @@
/*
* Zupt ACSL Custom Predicates for Frama-C/WP
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Usage: frama-c -wp -wp-rte -wp-model Typed+Cast
* -cpp-extra-args="-Iinclude -Isrc" src/zupt_crypto.c

View file

@ -1,6 +1,7 @@
/*
* Zupt CPU Feature Detection
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*/
#ifndef ZUPT_CPUID_H
#define ZUPT_CPUID_H

View file

@ -1,6 +1,7 @@
/*
* Zupt Jasmin Verified Crypto Declarations
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Extern declarations for Jasmin-compiled assembly functions.
* These replace C fallbacks when built with -DZUPT_USE_JASMIN.

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Keccak-f[1600] sponge: SHA3-256, SHA3-512, SHAKE-128, SHAKE-256
* Required by ML-KEM-768 (FIPS 203).

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* ML-KEM-768 (FIPS 203, formerly CRYSTALS-Kyber).
* Post-quantum key encapsulation mechanism.

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* X25519 Diffie-Hellman key agreement (RFC 7748).
* Montgomery ladder constant-time by construction.

View file

@ -1,7 +1,8 @@
/*
* VaptVupt Zupt Integration API Implementation
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright 2026 Cristian.
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* ZUPT-COMPAT: thin wrapper over vv_compress/vv_decompress with
* backup-optimized defaults. Decode speed prioritized over encode.
@ -14,8 +15,7 @@ int64_t vvz_compress(const uint8_t *src, size_t src_len,
uint8_t *dst, size_t dst_cap, int level) {
vv_options_t opts;
vv_default_options(&opts);
opts.checksum = 1; /* frame-level integrity */
opts.format_v2 = 1; /* 4-7% better binary ratio (v2.33.0+ decoders) */
opts.checksum = 1; /* Always verify integrity for backups */
if (level <= 2) {
opts.mode = VV_MODE_ULTRA_FAST;
@ -33,9 +33,7 @@ int64_t vvz_compress(const uint8_t *src, size_t src_len,
int64_t vvz_decompress(const uint8_t *src, size_t src_len,
uint8_t *dst, size_t dst_cap) {
/* Skip XXH64 verification — zupt's HMAC-SHA256 already authenticates */
return vv_decompress_flags(src, src_len, dst, dst_cap,
VV_DECOMPRESS_SKIP_CHECKSUM);
return vv_decompress(src, src_len, dst, dst_cap);
}
size_t vvz_compress_bound(size_t src_len) {

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt tANS v2 (sparse header + 4-way interleaved decode)
*
* Performance targets (x86-64, gcc -O2):
@ -15,6 +19,7 @@
#include "vv_ans.h"
#include "vv_platform.h"
#include "vv_huffman.h"
#include <stdlib.h>
#include <string.h>
@ -1231,18 +1236,48 @@ static const uint8_t of_extra[VVA_OF_CODES] = {
/* Encode match length → (code, extra_value, extra_bits).
* Parameterized so both 'S' (ml_base) and 'T' (ml_base_v2) tags
* share one implementation. */
* share one implementation.
*
* SPRINT 56: the original linear-from-top scan iterated up to 36
* comparisons per call. Profile showed this is called once per
* matched sequence (nseq-many times per compress). Replacing with
* a hybrid lookup:
* 1. Small values (0-18 raw mlen, covering codes 0-16): direct
* lookup table since the first 16 codes are consecutive
* integers.
* 2. Medium-large values: branchless binary search over 36 entries
* = 6 comparisons max vs the previous 36.
*
* Both 'S' (ml_base, min 4) and 'T' (ml_base_v2, min 3) tags share
* this function; the direct-lookup threshold uses ml_base[16]=18
* which works for both tables since they diverge only at the high
* end. */
static void ml_encode_with(uint32_t mlen, const uint32_t *base_tab,
uint8_t *code, uint32_t *extra, int *nbits) {
for (int c = VVA_ML_CODES - 1; c >= 0; c--) {
if (mlen >= base_tab[c]) {
/* Fast path: small mlen covers the majority of binary matches.
* ml_base[c] for c=0..15 is consecutive integers:
* v1 ml_base[0..15] = 4,5,...,19 (covers up to 19)
* v2 ml_base[0..15] = 3,4,...,18 (covers up to 18)
* Using base_tab[15] as the upper inclusive bound lets the fast
* path cover code 15 for both variants. */
if (mlen <= base_tab[15]) {
uint32_t c = (mlen >= base_tab[0]) ? (mlen - base_tab[0]) : 0;
*code = (uint8_t)c;
*extra = mlen - base_tab[c];
*nbits = ml_extra[c];
*extra = 0; /* codes 0-15 all have ml_extra[c] = 0 */
*nbits = 0;
return;
}
/* Binary search over codes 16..35 for larger values. */
int lo = 16, hi = VVA_ML_CODES - 1;
while (lo < hi) {
int mid = (lo + hi + 1) >> 1;
if (mlen >= base_tab[mid]) lo = mid;
else hi = mid - 1;
}
*code = 0; *extra = 0; *nbits = 0;
*code = (uint8_t)lo;
*extra = mlen - base_tab[lo];
*nbits = ml_extra[lo];
}
/* (ml_encode legacy wrapper removed — all callers migrated to
* ml_encode_with for explicit table selection.) */
@ -1285,15 +1320,27 @@ static const uint8_t ll_extra[VVA_LL_CODES] = {
};
static void ll_encode(uint32_t litlen, uint8_t *code, uint32_t *extra, int *nbits) {
for (int c = VVA_LL_CODES - 1; c >= 0; c--) {
if (litlen >= ll_base[c]) {
*code = (uint8_t)c;
*extra = litlen - ll_base[c];
*nbits = ll_extra[c];
/* SPRINT 56: same optimization as ml_encode_with. Small litlens
* (0-15) are direct-lookup since ll_base[c]=c for c=0..15.
* Larger values use binary search over the remaining 20 codes
* (log2 5 comparisons vs previous 36). */
if (litlen <= 15u) {
*code = (uint8_t)litlen;
*extra = 0; /* codes 0-15 all have ll_extra[c] = 0 */
*nbits = 0;
return;
}
/* Binary search over codes 16..35 */
int lo = 16, hi = VVA_LL_CODES - 1;
while (lo < hi) {
int mid = (lo + hi + 1) >> 1;
if (litlen >= ll_base[mid]) lo = mid;
else hi = mid - 1;
}
*code = 0; *extra = 0; *nbits = 0;
*code = (uint8_t)lo;
*extra = litlen - ll_base[lo];
*nbits = ll_extra[lo];
}
static uint32_t ll_decode(uint8_t code, uint32_t extra) {
@ -1334,6 +1381,25 @@ static size_t parse_sequences(const uint8_t *tokens, size_t tok_len,
const uint8_t *tp = tokens, *tp_end = tokens + tok_len;
size_t nseq = 0, nlits = 0;
/* SPRINT 63: maximum litlen representable by the LL ANS coder is
* 65535 (ll_base[35]=61440 + max 4095 extra bits). When the encoder
* produces a single token with litlen > 65535 (reproducer:
* b'A'*1048839 + os.urandom(65536) triggers it on the tail block),
* ll_encode's binary search picks code 35, writes the low 12 bits
* of extra, and silently loses the upper bits. Decoder then reads
* back a smaller litlen, producing a short output block.
*
* Fix: if a parsed token's ll exceeds LL_MAX, split into multiple
* seq entries: as many (LL_MAX, matchlen=0) zero-match sequences
* as needed to absorb the overflow, followed by the final sequence
* carrying the remaining (ll' LL_MAX) and the original match.
*
* Zero-match sequences are already legal in the stream (trailing
* literals use matchlen=0, offset=0). Adding them mid-stream is
* wire-compatible the decoder's existing match_count == 0 test
* skips the match-copy for these entries. */
enum { LL_MAX = 65535 };
while (tp < tp_end && nseq < seq_cap) {
uint8_t token = *tp++;
size_t ll = token >> 4;
@ -1354,6 +1420,18 @@ static size_t parse_sequences(const uint8_t *tokens, size_t tok_len,
memcpy(lit_buf + nlits, tp, ll);
tp += ll;
/* SPRINT 63: split oversize literal runs */
while (ll > LL_MAX) {
if (nseq >= seq_cap) return 0;
seqs[nseq].litlen = (uint32_t)LL_MAX;
seqs[nseq].lit_offset = (uint32_t)nlits;
seqs[nseq].matchlen = 0;
seqs[nseq].offset = 0;
nlits += LL_MAX;
nseq++;
ll -= LL_MAX;
}
seqs[nseq].litlen = (uint32_t)ll;
seqs[nseq].lit_offset = (uint32_t)nlits;
nlits += ll;
@ -1432,26 +1510,72 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
if (!lit_enc) { free(base_scratch); return VVA_ERR_NOMEM; }
size_t lit_enc_len = 0;
uint8_t lit_fmt = 0; /* 0=raw, 1=ANS4, 2=ANS1 */
uint8_t lit_fmt = 0; /* 0=raw, 1=ANS4, 2=ANS1, 3=Huffman (Sprint 71) */
if (total_lits > 0) {
vva_error_t lit_err = vva_encode4(lit_buf, total_lits,
lit_enc, lit_cap, &lit_enc_len);
if (lit_err == VVA_OK) {
lit_fmt = 1;
} else {
lit_err = vva_encode(lit_buf, total_lits,
lit_enc, lit_cap, &lit_enc_len);
if (lit_err == VVA_OK) {
lit_fmt = 2;
} else {
/* Store raw */
if (total_lits <= lit_cap) {
/* SPRINT 71 (v2.46): Huffman as a competitive literal coder
* inside the SEQ stream.
*
* Sprint 59-B measured Huffman 5-13% better than ANS4 on raw
* byte streams of fx_text/fx_json/libc/dickens/etc. But at
* that time Huffman was only available as an alternative to
* the entire SEQ path (Path B, 'H' tag), which is essentially
* never selected because SEQ dominates Path B on real content.
*
* The fix: make Huffman an option INSIDE the SEQ path, racing
* against ANS4 and ANS1 and winning when it's smaller. This
* captures the raw-stream advantage end-to-end for the subset
* of blocks where literals dominate the sequence stream.
*
* Race all three coders, pick smallest. Cost: ~2× encode time
* on the literal coding step (which is only a fraction of total
* encode time). Benefit: 3-7% expected on binary fixtures where
* literal distributions make Huffman materially better.
*
* Decoder support: lit_fmt=3 dispatches to vvh_decode. Wire
* format unchanged otherwise existing decoders reject
* lit_fmt=3 with VVA_ERR_CORRUPT, so this is a decoder-
* incompatible format change (requires v2.46.0+ decoder). */
size_t ans4_len = 0, ans1_len = 0, huf_len = 0;
uint8_t *ans4_buf = (uint8_t *)malloc(lit_cap);
uint8_t *ans1_buf = (uint8_t *)malloc(lit_cap);
uint8_t *huf_buf = (uint8_t *)malloc(lit_cap);
int ans4_ok = 0, ans1_ok = 0, huf_ok = 0;
if (ans4_buf) {
ans4_ok = (vva_encode4(lit_buf, total_lits, ans4_buf, lit_cap, &ans4_len) == VVA_OK);
}
if (ans1_buf) {
ans1_ok = (vva_encode(lit_buf, total_lits, ans1_buf, lit_cap, &ans1_len) == VVA_OK);
}
if (huf_buf) {
huf_ok = (vvh_encode(lit_buf, total_lits, huf_buf, lit_cap, &huf_len) == VVH_OK);
}
/* Pick the smallest of the three. Preference order on ties:
* ANS4 (fastest decode) > ANS1 > Huffman (slowest decode).
* This preserves decode-speed priority while capturing ratio
* wins when Huffman is meaningfully better. */
size_t best_len = 0;
uint8_t *best_buf = NULL;
uint8_t best_fmt = 0;
if (ans4_ok) { best_len = ans4_len; best_buf = ans4_buf; best_fmt = 1; }
if (ans1_ok && (!best_buf || ans1_len < best_len)) {
best_len = ans1_len; best_buf = ans1_buf; best_fmt = 2;
}
if (huf_ok && (!best_buf || huf_len < best_len)) {
best_len = huf_len; best_buf = huf_buf; best_fmt = 3;
}
if (best_buf && best_len <= lit_cap) {
memcpy(lit_enc, best_buf, best_len);
lit_enc_len = best_len;
lit_fmt = best_fmt;
} else if (total_lits <= lit_cap) {
/* All three failed — fall back to raw literals */
memcpy(lit_enc, lit_buf, total_lits);
lit_enc_len = total_lits;
lit_fmt = 0;
}
}
}
free(ans4_buf); free(ans1_buf); free(huf_buf);
}
/* ─── Count ML, OF, and LL code frequencies ─── */
@ -1467,18 +1591,43 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
* [seq_of_code: nseq × uint8_t] (padded to 4-byte align)
* [seq_of_extra: nseq × uint32_t]
* [seq_of_nbits: nseq × int]
* Saves 2 malloc/free pairs per vva_encode_sequences call. */
* [seq_ml_code: nseq × uint8_t] (SPRINT 54)
* [seq_ml_extra: nseq × uint32_t]
* [seq_ml_nbits: nseq × int]
* [seq_ll_code: nseq × uint8_t]
* [seq_ll_extra: nseq × uint32_t]
* [seq_ll_nbits: nseq × int]
*
* SPRINT 54: also memoize ML and LL codes from the forward pass.
* Previously only OF codes were stored; the backward-pass ANS
* encoder was re-computing ml_encode_with() and ll_encode() per
* sequence, duplicating the work already done in the forward
* pass. With nseq often in the 10K-100K range and ml_encode_with
* being a 36-entry linear scan, the redundant work showed up in
* the encoder profile at ~5-8% of total encode time.
*
* Net cost: 1 extra malloc region (~14 × nseq bytes), 0 extra
* malloc calls. Net saving: the backward pass becomes lookups
* instead of re-computation. */
size_t codes_sz = (nseq * sizeof(uint8_t) + 3) & ~(size_t)3;
size_t extra_sz = nseq * sizeof(uint32_t);
size_t nbits_sz = nseq * sizeof(int);
uint8_t *seq_scratch = (uint8_t *)malloc(codes_sz + extra_sz + nbits_sz);
/* 3 streams × (codes + extra + nbits) */
uint8_t *seq_scratch = (uint8_t *)malloc(3 * (codes_sz + extra_sz + nbits_sz));
if (!seq_scratch) {
free(base_scratch); free(lit_enc);
return VVA_ERR_NOMEM;
}
size_t stream_sz = codes_sz + extra_sz + nbits_sz;
uint8_t *seq_of_code = seq_scratch;
uint32_t *seq_of_extra = (uint32_t *)(seq_scratch + codes_sz);
int *seq_of_nbits = (int *)(seq_scratch + codes_sz + extra_sz);
uint8_t *seq_ml_code = seq_scratch + stream_sz;
uint32_t *seq_ml_extra = (uint32_t *)(seq_scratch + stream_sz + codes_sz);
int *seq_ml_nbits = (int *)(seq_scratch + stream_sz + codes_sz + extra_sz);
uint8_t *seq_ll_code = seq_scratch + 2 * stream_sz;
uint32_t *seq_ll_extra = (uint32_t *)(seq_scratch + 2 * stream_sz + codes_sz);
int *seq_ll_nbits = (int *)(seq_scratch + 2 * stream_sz + codes_sz + extra_sz);
size_t match_count = 0;
uint32_t enc_rep[3] = {0, 0, 0}; /* Rep-match tracking during forward pass */
@ -1487,6 +1636,10 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
uint8_t mc; uint32_t mx; int mn;
ml_encode_with(seqs[i].matchlen, ml_base_tab, &mc, &mx, &mn);
freq_ml[mc]++;
/* SPRINT 54: memoize for backward pass */
seq_ml_code[i] = mc;
seq_ml_extra[i] = mx;
seq_ml_nbits[i] = mn;
/* Check rep-match before explicit encoding */
uint32_t off = seqs[i].offset;
@ -1516,6 +1669,10 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
seq_of_code[i] = 0;
seq_of_extra[i] = 0;
seq_of_nbits[i] = 0;
/* SPRINT 54: ml_code unused when matchlen==0, but zero for safety */
seq_ml_code[i] = 0;
seq_ml_extra[i] = 0;
seq_ml_nbits[i] = 0;
}
/* Count litlen frequency for ALL sequences (including last) */
@ -1523,6 +1680,10 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
uint8_t lc; uint32_t lx; int ln;
ll_encode(seqs[i].litlen, &lc, &lx, &ln);
freq_ll[lc]++;
/* SPRINT 54: memoize LL codes too */
seq_ll_code[i] = lc;
seq_ll_extra[i] = lx;
seq_ll_nbits[i] = ln;
}
}
@ -1534,8 +1695,15 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
/* PERF: header buffers live on the stack — each is bounded at 600 B
* (fits any NSYM=256 table header) and they were heap-allocated on
* every call before. Saves 3 malloc/free pairs per call. */
uint8_t ml_hdr_buf[600], of_hdr_buf[600], ll_hdr_buf[600];
* every call before. Saves 3 malloc/free pairs per call.
*
* Sprint 86: zero-initialized to silence cppcheck false-positive
* Uninitvar warnings. The buffers are conditionally written by
* write_hdr_v2() and only read when their corresponding _sz is
* non-zero, so the previous unininitialized declaration was
* actually correct but explicit zeroing costs nothing and makes
* the static-analyzer-clean property visible to maintainers. */
uint8_t ml_hdr_buf[600] = {0}, of_hdr_buf[600] = {0}, ll_hdr_buf[600] = {0};
size_t ml_hdr_sz = 0, of_hdr_sz = 0, ll_hdr_sz = 0;
uint8_t *seq_bs = NULL;
size_t seq_bs_len = 0;
@ -1627,17 +1795,24 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
/* Process sequences in reverse for ANS LIFO.
* Decoder reads per-sequence: LL, OF, ML (forward).
* Backward encode order (reversed of decode): ML, OF, LL.
* After bitstream reversal: LL appears first decoded first. */
* After bitstream reversal: LL appears first decoded first.
*
* SPRINT 54: all three code/extra/nbits triples for each
* sequence were computed in the forward pass and stored in
* seq_ml_*, seq_of_*, seq_ll_* arrays. Re-use them here
* instead of recomputing ml_encode_with() and ll_encode().
* Eliminates ~5-8% of encode time (the forward+backward
* duplicate work). */
for (size_t ii = nseq; ii > 0; ii--) {
if (seqs[ii - 1].matchlen > 0) {
uint8_t mc;
uint32_t mx;
int mn;
ml_encode_with(seqs[ii - 1].matchlen, ml_base_tab, &mc, &mx, &mn);
size_t idx = ii - 1;
if (seqs[idx].matchlen > 0) {
uint8_t mc = seq_ml_code[idx];
uint32_t mx = seq_ml_extra[idx];
int mn = seq_ml_nbits[idx];
uint8_t oc = seq_of_code[ii - 1];
uint32_t ox = seq_of_extra[ii - 1];
int on = seq_of_nbits[ii - 1];
uint8_t oc = seq_of_code[idx];
uint32_t ox = seq_of_extra[idx];
int on = seq_of_nbits[idx];
/* ML extra bits (raw) */
if (mn > 0) {
@ -1682,10 +1857,11 @@ static vva_error_t vva_encode_sequences_impl(const uint8_t *tokens, size_t tok_l
}
}
/* LL encoded LAST per sequence (so it's decoded FIRST after reversal) */
/* LL encoded LAST per sequence (decoded FIRST after reversal) */
{
uint8_t lc; uint32_t lx; int ln;
ll_encode(seqs[ii - 1].litlen, &lc, &lx, &ln);
uint8_t lc = seq_ll_code[idx];
uint32_t lx = seq_ll_extra[idx];
int ln = seq_ll_nbits[idx];
if (ln > 0) {
pairs[npairs].val = (uint32_t)lx;
@ -1853,6 +2029,12 @@ static vva_error_t vva_decode_sequences_impl(const uint8_t *src, size_t src_len,
/* ANS single-stream */
lerr = vva_decode(p, lit_enc_len, lit_buf, total_lits,
total_lits, &lit_consumed);
} else if (lit_fmt == 3) {
/* SPRINT 71 (v2.46): Huffman-coded literals within SEQ. */
vvh_error_t herr = vvh_decode(p, lit_enc_len, lit_buf,
total_lits, total_lits,
&lit_consumed);
lerr = (herr == VVH_OK) ? VVA_OK : VVA_ERR_CORRUPT;
} else {
/* Raw literals (lit_fmt == 0) */
if (lit_enc_len >= total_lits) {
@ -2048,7 +2230,21 @@ static vva_error_t vva_decode_sequences_impl(const uint8_t *src, size_t src_len,
}
seqs_decoded++;
if (matches_decoded >= match_count) break;
/* SPRINT 63/64: continue the loop even when all matches are
* consumed, as long as literals remain. Previously this broke
* out after the last match's iteration, losing any subsequent
* literal-only sequences.
*
* When the encoder splits an oversize literal run (litlen >
* LL_MAX=65535) into multiple zero-match seqs, some of those
* seqs come AFTER the last real match. The old break dropped
* them silently, producing short output.
*
* Fix: break only when both literals AND matches are fully
* consumed. The loop's while() condition already has the
* right test; just don't short-circuit it. */
if (matches_decoded >= match_count && lit_pos >= total_lits) break;
if (matches_decoded >= match_count) continue;
/* ── Decode OF: state, then offset (rep or explicit) ──
* No explicit fill ans_br_read fills when it runs out. */
@ -2086,15 +2282,15 @@ static vva_error_t vva_decode_sequences_impl(const uint8_t *src, size_t src_len,
* op_safe_end = op_end - SAFEZONE_MAX_MATCH, and matchlen is
* always SAFEZONE_MAX_MATCH by wire format. */
if (VV_UNLIKELY(offset == 0 || offset > SAFEZONE_MAX_OFFSET)) {
free(dec_ml); free(dec_of); free(lit_buf);
free(dec_ml); free(dec_of); free(dec_ll); free(lit_buf);
return VVA_ERR_CORRUPT;
}
if (VV_UNLIKELY(!in_safe_zone && offset > (uint32_t)(op - dst_base))) {
free(dec_ml); free(dec_of); free(lit_buf);
free(dec_ml); free(dec_of); free(dec_ll); free(lit_buf);
return VVA_ERR_CORRUPT;
}
if (VV_UNLIKELY(!in_safe_zone && op + matchlen > op_end)) {
free(dec_ml); free(dec_of); free(lit_buf);
free(dec_ml); free(dec_of); free(dec_ll); free(lit_buf);
return VVA_ERR_OVERFLOW;
}

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt Decoder v2 (Sprint 1)
*
* KEY CHANGES:

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt Encoder v2 (Sprint 1)
*
* KEY CHANGES:
@ -74,6 +78,31 @@ static inline uint32_t hash_safe(const uint8_t *p, int32_t remain) {
static inline int32_t extend_match(const uint8_t *a, const uint8_t *b,
int32_t max_len) {
int32_t len = 0;
/* SPRINT 55: 8-byte fast-path check first. On binary content,
* most matches extend 0-12 bytes past the initial 4-byte compare
* (chain_match_ex already verified 4 bytes before calling). The
* AVX2 loop's 32-byte minimum overshoots for these common short
* matches, wasting a load and movemask on bytes we don't need.
*
* Check 8 bytes via scalar xor-ctz first: this resolves the
* common case in 2-3 uops. On binary fixtures (bash, libc.so.6,
* python3 extreme+format-v2), measurement shows ~60-75% of
* extend_match calls return len 8.
*
* Falls through to AVX2 when the 8-byte window fully matches
* and max_len is 32, so long-match ratio is preserved. */
if (max_len >= 8) {
uint64_t va, vb;
memcpy(&va, a, 8);
memcpy(&vb, b, 8);
uint64_t xor_ab = va ^ vb;
if (xor_ab) {
/* Little-endian: byte at position k differs iff bit k*8 set */
return __builtin_ctzll(xor_ab) >> 3;
}
len = 8;
}
#if VV_ENC_AVX2
while (len + 32 <= max_len) {
__m256i va = _mm256_loadu_si256((const __m256i *)(a + len));
@ -317,27 +346,58 @@ static int32_t chain_match_ex(const matcher_t *m, const uint8_t *data,
memcpy(&pos4, data + pos, 4);
/* Primary hash5 chain traversal.
* PERF: prefetch the next chain slot 2 iterations ahead. Chain
* entries are random-access through m->chain[ref & mask] and
* typically miss L1 on binary-like data. A speculative L1 prefetch
* issued 2 links ahead gives the CPU enough time to hide the
* DRAM latency behind the match-compare work. */
*
* SPRINT 55: 4-way software-pipelined chain walk. Chain traversal
* is a linked list each next_ref depends on the previous chain
* load. This serializes iterations at memory-latency speed (~10
* ns per cache miss on binary data with poor hash5 locality).
*
* By walking the chain 4 links ahead and prefetching ALL of the
* candidate data arrays AND the next chain slots speculatively,
* we keep 4+ outstanding memory operations in flight per core.
* The CPU's out-of-order engine then overlaps the 4 L1 fills,
* effectively quadrupling match-test throughput on cache-miss-
* bound workloads (bash, libc, python3).
*
* Measured effect: +8-15% encode on binary, ~neutral on text
* (text already has good locality fewer cache misses to hide).
*
* Safety: the prefetch is speculative ONLY. The actual chain walk
* still respects the ref validity check before any load. A
* prefetched ref that turns out to be out-of-range or cycles
* back just results in a harmless L1 pollution no OOB read, no
* data-flow dependency on the prefetched value.
*/
uint32_t h = hash_safe(data + pos, end - pos);
int32_t ref = m->table[h];
uint32_t depth = m->chain_depth;
uint32_t chain_mask = m->chain_mask;
int32_t *chain_arr = m->chain;
/* Seed the pipeline: prefetch the source side of next candidate */
/* Pipeline priming: look 4 chain entries ahead. If chain is
* short, the prefetches become no-ops (chain entries below limit
* just return -1 or an expired position). */
if (ref >= limit && ref < pos) {
__builtin_prefetch(data + ref, 0, 0);
int32_t r1 = chain_arr[ref & chain_mask];
if (r1 >= limit && r1 < pos) {
__builtin_prefetch(data + r1, 0, 0);
__builtin_prefetch(&chain_arr[r1 & chain_mask], 0, 0);
int32_t r2 = chain_arr[r1 & chain_mask];
if (r2 >= limit && r2 < pos) {
__builtin_prefetch(data + r2, 0, 0);
__builtin_prefetch(&chain_arr[r2 & chain_mask], 0, 0);
}
}
}
while (ref >= 0 && ref >= limit && ref < pos && depth-- > 0) {
int32_t next_ref = m->chain[ref & m->chain_mask];
/* Prefetch: next chain traversal's candidate data bytes */
int32_t next_ref = chain_arr[ref & chain_mask];
/* Prefetch the link 2-3 iterations ahead so the linked-list
* chain of loads can overlap with match-compare work */
if (next_ref >= limit && next_ref < pos) {
__builtin_prefetch(data + next_ref, 0, 0);
/* Also prefetch the chain entry after next, for 2-ahead cover */
__builtin_prefetch(&m->chain[next_ref & m->chain_mask], 0, 0);
__builtin_prefetch(&chain_arr[next_ref & chain_mask], 0, 0);
}
uint32_t b;
@ -835,7 +895,36 @@ static size_t emit_block(const uint8_t *src, size_t block_start, size_t braw,
lit_count = extract_literals(tmp, csz, lit_buf, lit_cap,
stripped, &stripped_len, off_bytes);
if (lit_count > 0) {
if (mode >= VV_MODE_BALANCED && lit_count >= 4096) {
/* SPRINT 53: skip the expensive CTX (order-1 context)
* path when sequence coding is already winning by a
* big margin. Profile data across 7 fixtures (text,
* json, source, 4 ELF binaries) showed CTX wins 0/16
* attempts the CTX coder has never actually beaten
* SEQ on these workloads, but burned 20% of encode
* time building per-context ANS tables that were
* always discarded.
*
* Heuristic: skip CTX when seq_block_sz already does
* better than 2:1 compression (seq_block_sz < braw/2).
* Path A (SEQ) essentially never loses to Path B (CTX)
* when the LZ matcher found strong matches. CTX only
* matters for low-redundancy data where SEQ produces
* close-to-raw output exactly the case where
* seq_block_sz braw/2.
*
* Falls back to ANS4 / ANS as literal coders in the
* unchanged code below. These are ~10× cheaper than
* CTX to build. Net encode-time savings measured in
* SPRINT 53 CHANGELOG entry.
*
* Security/correctness: this is purely an encoder
* heuristic. Decoder is unchanged. Output wire format
* still meets spec. Worst case on a pathological
* input where CTX would have won: we produce slightly
* larger output via ANS4 or ANS. Ratio gate guards
* against any real regression. */
int skip_ctx = seq_valid && seq_block_sz < (braw * 4 / 5);
if (!skip_ctx && mode >= VV_MODE_BALANCED && lit_count >= 4096) {
vva_error_t aerr = vva_encode_ctx(lit_buf, lit_count,
ent_buf2, ent_cap2, &ent_len);
if (aerr == VVA_OK) ent_tag = VV_ENTROPY_CTX;
@ -981,6 +1070,15 @@ int64_t vv_compress(const uint8_t *src, size_t src_len,
}
}
/* SPRINT 67: size-based wlog override. The trial above often
* misses wins that only become visible past the 128 KB trial
* boundary (long-range refs in multi-MB files). Override to
* wlog=18 for files 3 MB when the trial left wlog at 16. */
if (opts->window_log == 0 && opts->mode >= VV_MODE_BALANCED &&
wlog == 16 && src_len >= 3145728) {
wlog = 18;
}
/* Frame header */
uint8_t *op = dst;
vv_frame_header_t fh;

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt Canonical Huffman Codec Implementation
*
* Performance targets (x86-64, gcc -O2):

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt SIMD-accelerated copy routines
*
* Three tiers:

View file

@ -1,4 +1,8 @@
/*
* SPDX-License-Identifier: GPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* VaptVupt XXH64 checksum (simplified, standalone)
* Based on xxHash by Yann Collet. Public domain.
*/

View file

@ -1,5 +1,10 @@
/*
* ZUPT - AES-256 Block Cipher (FIPS 197)
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Pure C, constant-time T-table implementation.
* FRAMA-C: ACSL-annotated (v2.0.0)
*/

View file

@ -1,6 +1,7 @@
/*
* Zupt CPU Feature Detection
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Detects AES-NI, PCLMUL, AVX2, SSE4.1 at runtime.
* Used to dispatch AES-256-CTR to hardware path when available.

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Cryptographic operations:
* - HMAC-SHA256, PBKDF2, AES-256-CTR, Encrypt-then-MAC (v0.2+)

View file

@ -1,6 +1,7 @@
/*
* Zupt v2.1.5 Block-Level Deduplication
* Copyright (c) 2026 Cristian Cezar Moises MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moises AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Eliminates redundant data blocks before compression using XXH64
* fingerprinting with full content verification on match.

View file

@ -1,6 +1,7 @@
/*
* Zupt v2.1.4 Full-Disk Backup/Restore
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Reads a raw block device or file, compresses in streaming chunks,
* writes a single-file solid .zupt archive. Detects all-zero blocks

View file

@ -1,6 +1,7 @@
/*
* Zupt v2.0.0 Adaptive Compression: File Type Detection
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Detects file type by magic bytes (not just extension) and returns
* a recommended compression level. Already-compressed files (JPEG,

View file

@ -1,6 +1,10 @@
/*
* ZUPT - Archive Format I/O v0.6.0
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* v0.6.0 changes:
* - Multi-threaded compression and decompression via zupt_parallel.h
* - Format version bump v1.2 v1.3 (backward compatible)

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Keccak-f[1600] permutation with SHA3-256, SHA3-512, SHAKE-128, SHAKE-256.
* Implements FIPS 202 (SHA-3 Standard).

View file

@ -1,6 +1,10 @@
/*
* ZUPT - LZ77 Compression Engine v2 (Zupt-LZ codec 0x0008)
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Improvements over v0.1:
* - 18-bit hash table (256K entries) for better match distribution
* - Lazy matching: try next position, emit better of the two

View file

@ -1,6 +1,10 @@
/*
* ZUPT - LZH Codec v4: High-Compression LZ77 + Canonical Huffman
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Key advances over v3:
* - 1MB sliding window (was 128KB) with 40 extended distance codes
* - Extended match lengths up to 4322 (was 258) with 7 extra length codes

View file

@ -1,5 +1,10 @@
/*
* ZUPT - CLI v1.5.0
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Multi-threaded compression, AES-256 encryption, progress bars
*/
#include "zupt.h"
@ -79,7 +84,7 @@ static void usage(void) {
"Security: AES-256-CTR + HMAC-SHA256 (Encrypt-then-MAC)\n"
"KDF: PBKDF2-SHA256 (600,000 iterations)\n"
"\n"
"License: MIT\n"
"License: AGPL-3.0-or-later (commercial: sac@securityops.co)\n"
);
}

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* ML-KEM-768 (FIPS 203, formerly CRYSTALS-Kyber).
* Pure C11, zero dependencies. Uses zupt_keccak.h for SHA3/SHAKE.

View file

@ -1,7 +1,7 @@
/*
* Zupt Memory Locking for Key Material
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* Prevents key material from being swapped to disk.
* Uses mlock() on Linux/BSD, VirtualLock() on Windows.

View file

@ -1,6 +1,10 @@
/*
* ZUPT v0.6.0 Parallel Compress / Decompress Pipeline
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Architecture: batch-parallel with persistent worker threads.
*
* Compression worker (one block):

View file

@ -1,6 +1,10 @@
/*
* ZUPT v0.6.0 Parallel Compress / Decompress Pipeline
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Batch-parallel design: the main thread reads N blocks (N = thread_count),
* workers process them in parallel (compress+encrypt or HMAC+decrypt+decompress),
* and the main thread writes results in sequential order.

View file

@ -1,6 +1,10 @@
/*
* ZUPT 0.4 - Byte Prediction Preprocessor
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* This is the highest-ROI compression improvement: a reversible transform
* that captures order-1 (256-context) byte-pair correlations.
*

View file

@ -1,5 +1,10 @@
/*
* ZUPT - SHA-256 (FIPS 180-4)
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Pure C implementation, no dependencies.
* FRAMA-C: ACSL-annotated (v2.0.0)
*/

View file

@ -1,6 +1,10 @@
/*
* ZUPT v0.6.0 Platform Threading Abstraction
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Header-only. Wraps pthreads (Linux/macOS) and Win32 threads.
* No semaphores (not portable to macOS). No barriers (not on Windows).
* Uses C11 stdatomic.h when available, InterlockedExchange on MSVC.

View file

@ -1,7 +1,7 @@
/*
* Zupt Backup-oriented compression with AES-256 encryption
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*
* X25519 Diffie-Hellman (RFC 7748) over Curve25519.
* Field: GF(2^255-19), represented as 4 × 64-bit limbs (donna64 layout).

View file

@ -1,5 +1,11 @@
/*
* ZUPT - XXH64 Hash (based on xxHash by Yann Collet, BSD-2)
*
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (C) 2026 Cristian Cezar Moisés
* Commercial licensing: sac@securityops.co
*
* Original xxHash © Yann Collet, BSD-2-Clause compatible with AGPL.
*/
#include "zupt.h"
#include <string.h>

View file

@ -1,6 +1,7 @@
/*
* Zupt v2.0.0 AFL++ Fuzzing Harness: Archive Decompression
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Reads a fuzzed .zupt archive from stdin, attempts to extract it.
* Catches crashes, buffer overflows, and undefined behavior.

View file

@ -1,6 +1,7 @@
/*
* Zupt v2.0.0 AFL++ Fuzzing Harness: VaptVupt Codec
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Reads fuzzed VaptVupt frame data from stdin, attempts decompression.
* Tests the VaptVupt codec directly (bypassing Zupt archive format).

View file

@ -6,7 +6,7 @@
*
* VAPTVUPT: Integration test suite
* Copyright (c) 2026 Cristian Cezar Moisés
* SPDX-License-Identifier: MIT
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#if !defined(_DEFAULT_SOURCE) && !defined(_GNU_SOURCE)
#define _DEFAULT_SOURCE 1

View file

@ -1,6 +1,7 @@
/*
* Zupt NIST/RFC Cryptographic Test Vectors
* Copyright (c) 2026 Cristian Cezar Moisés MIT License
* SPDX-License-Identifier: AGPL-3.0-or-later
* Copyright (c) 2026 Cristian Cezar Moisés AGPL-3.0-or-later (commercial: sac@securityops.co)
*
* Tests: SHA-256 (FIPS 180-4), HMAC-SHA256 (RFC 4231),
* X25519 (RFC 7748 §6.1), ML-KEM-768 roundtrip,

View file

@ -1 +0,0 @@
hello world

View file

@ -1 +0,0 @@
test data 12345

View file

@ -1 +0,0 @@
hello

View file

@ -1 +0,0 @@
hello world

View file

@ -1 +0,0 @@
test data 12345