Skip to content

Wave 2: make default build MIT-clean (public-domain Blowfish, opt-in GPL for Kogado/WARC RNG) - #2

Merged
Alex123666tw merged 3 commits into
mainfrom
fix/wave2-mit
Jul 1, 2026
Merged

Wave 2: make default build MIT-clean (public-domain Blowfish, opt-in GPL for Kogado/WARC RNG)#2
Alex123666tw merged 3 commits into
mainfrom
fix/wave2-mit

Conversation

@Alex123666tw

Copy link
Copy Markdown
Owner

Summary — Wave 2: make the default release binary truly MIT

Builds on #1. Removes GPL code from the default build so the released ArcFormats.dll is MIT-clean, while keeping the GPL-dependent format paths available behind an opt-in build flag.

Replaced GPLv2 Blowfish with a public-domain implementation

ArcFormats/Blowfish.cs was Novell's GPLv2 file. Rewrote it from the public-domain Blowfish reference (Schneier / Kocher), preserving the exact public API and per-path byte order.

Verified byte-identical to the old implementation:

  • 34/34 standard ECB test vectors (cross-checked against an independent Blowfish implementation to rule out a bad vector table).
  • Differential test of all three code paths — Decipher(byte[]), CreateDecryptor().TransformBlock, Decipher(ref,ref) — at 20,000 random cases each: 0 mismatches; round-trip 0 failures.

So the engines that use Blowfish (CatSystem2, TanukiSoft, Tamamo, Musica, Aims) are unaffected.

Excluded the remaining GPLv2 file from the default build

ArcFormats/KogadoCocotte.cs (GPLv2 — Schindler qsmodel range coder, ported by morkt) has no clean MIT replacement, so it is now compiled only when INCLUDE_GPL is defined. It provides CRangeCoder, used by two format paths, both gated behind #if INCLUDE_GPL (throwing a clear NotSupportedException otherwise):

  • Kogado Cocotte compression (Hypatia ArcKogado, compression type 2)
  • ShiinaRio WARC versions 120–169 RNG-compressed index (ArcWARC.UnpackRNG). WARC ≥170 uses ZLib and is unaffected.

Result: the default build produces an MIT-clean ArcFormats.dll — verified that KogadoCocotte.cs is not in the default compile set (MSBuild -getItem:Compile) and that no compiled source contains GPL text. Building with -p:DefineConstants="TRACE;INCLUDE_GPL" restores those two format paths (that binary is then GPLv2).

Docs

README.md / NOTICE updated (EN + 繁中): the default release is MIT-clean; the optional INCLUDE_GPL build adds one GPLv2 component (and which formats it enables). licenses/GPL-2.0.txt retained for that build.

Testing

  • Default build (GameRes + ArcFormats + Console): 0 errors. INCLUDE_GPL build: 0 errors.
  • SoftPal data.pac extraction regression: the 3 extracted files are SHA-256-identical to baseline (SoftPal uses none of the changed code; confirms the pipeline is intact).
  • Blowfish differential + standard vectors as above.

Depends on #1 (based on its branch; will retarget to main once #1 merges).

🤖 Generated with Claude Code

Alex123666tw and others added 3 commits July 1, 2026 14:14
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…pt-in via INCLUDE_GPL)

KogadoCocotte.cs (GPLv2) also defines the CRangeCoder used by ShiinaRio's
WARC RNG index decompression, so both consumers are guarded with
#if INCLUDE_GPL: ArcKogado (Cocotte, compression type 2) and ArcWARC
(UnpackRNG, WARC versions 120-169). Default build now contains zero GPLv2.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tte opt-in)

- Remove Blowfish from the GPL disclosure (now a public-domain reimplementation, MIT).
- Kogado Cocotte (KogadoCocotte.cs, GPLv2) is excluded from the default build and
  opt-in via INCLUDE_GPL; note it also gates older ShiinaRio WARC RNG decompression
  (shared range coder). Default ArcFormats.dll is MIT-clean.
- Keep KogadoCocotte.cs and licenses/GPL-2.0.txt for the opt-in build; keep the
  arm's-length non-infection note. Bilingual README + NOTICE updated consistently.
- Correct release.yml bundling comment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Alex123666tw
Alex123666tw changed the base branch from fix/security-and-license-audit to main July 1, 2026 16:02
@Alex123666tw
Alex123666tw merged commit 57c43f5 into main Jul 1, 2026
@Alex123666tw
Alex123666tw deleted the fix/wave2-mit branch July 1, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant