feat: add S2 compression and AEAD encryption for FileStore (Go parity)

Replace Deflate+XOR with IronSnappy S2 block compression and ChaCha20-Poly1305 / AES-256-GCM
AEAD encryption, matching golang/nats-server/server/filestore.go. Introduces FSV2 envelope
format alongside existing FSV1 for backward compatibility. Adds 55 new tests across
S2CodecTests, AeadEncryptorTests, and FileStoreV2Tests covering all 6 cipher×compression
permutations, tamper detection, and legacy format round-trips.
This commit is contained in:
Joseph Doherty
2026-02-24 06:29:34 -05:00
parent 2c9683e7aa
commit 9cc9888bb4
6 changed files with 944 additions and 0 deletions

View File

@@ -26,6 +26,9 @@
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.4" />
<!-- Compression -->
<PackageVersion Include="IronSnappy" Version="1.3.1" />
<!-- NATS Client (integration tests) -->
<PackageVersion Include="NATS.Client.Core" Version="2.7.2" />
</ItemGroup>