From 30b43e3755afe8abd298864dfe05afc725ac01cf Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Thu, 10 Sep 2026 13:35:05 -0700 Subject: [PATCH 1/2] remove X6 huffman decoder from legacy v0.2 The fast loop in HUF_decompress4X6_usingDTable was an experiment, if did not prove successful and was removed in v0.3. Meanwhile, the code is complex, and adds to attack surface. The work is done by remaining decoders which produce identical output. --- lib/legacy/zstd_v02.c | 361 +----------------------------------------- 1 file changed, 1 insertion(+), 360 deletions(-) diff --git a/lib/legacy/zstd_v02.c b/lib/legacy/zstd_v02.c index d1e00385a23..0215641017a 100644 --- a/lib/legacy/zstd_v02.c +++ b/lib/legacy/zstd_v02.c @@ -749,7 +749,6 @@ extern "C" { ******************************************/ static size_t HUF_decompress4X2 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* single-symbol decoder */ static size_t HUF_decompress4X4 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* double-symbols decoder */ -static size_t HUF_decompress4X6 (void* dst, size_t dstSize, const void* cSrc, size_t cSrcSize); /* quad-symbols decoder */ #if defined (__cplusplus) @@ -2127,363 +2126,6 @@ static size_t HUF_decompress4X4 (void* dst, size_t dstSize, const void* cSrc, si } -/**********************************/ -/* quad-symbol decoding */ -/**********************************/ -typedef struct { BYTE nbBits; BYTE nbBytes; } HUF_DDescX6; -typedef union { BYTE byte[4]; U32 sequence; } HUF_DSeqX6; - -/* recursive, up to level 3; may benefit from