s3: smbd: Duplicate smb_file_link_information() hardlink handling as smb2_file_link_i...
[Samba.git] / testdata / compression / README
blob24c4d4619c9366188d61e8c5bd946621f7ae276b
1 # Test vectors for MS-XCA [de-]compression
3 There are currently two supported varients of the Xpress Compression
4 Algorithm, "Plain LZ77" and "LZ77 + Huffman". For each we two
5 directories of files compressed on Windows, corresponding to the two
6 compression levels that Windows offers.
8 The subdirectories are
10 ./decompressed            - test files to compress with .decomp extension.
11 ./compressed-huffman      - LZ77+Huffman compressed, with .lzhuff extension.
12 ./compressed-more-huffman - LZ77+Huffman compressed, with .lzhuff extension.
13 ./compressed-plain        - Plain LZ77 compressed, with .lzplain extension.
14 ./compressed-more-plain   - Plain LZ77 compressed, with .lzplain extension.
16 where the more-compressed-* versions have the files that Windows put
17 more effort into compressing (largely in vain -- they are similar in
18 size). Windows probably does not use this more effortful compression
19 in network protocols, but these files must be decompressible.
21 The compressed files were made using the Windows Compression API,
22 which uses the same underlying code as MS-XCA, but which puts some
23 annoying hurdles in the way. In particular, it won't perform
24 LZ77+Huffman compression on any file smaller than 300 bytes. The
25 relationship between the two is covered in various messages in
27 https://lists.samba.org/archive/cifs-protocol/2022-October/
28 https://lists.samba.org/archive/cifs-protocol/2022-November/
30 To recreate these files or add more, use
31 lib/compression/tests/scripts/generate-windows-test-vectors.c under
32 Cygwin or MSYS2. This file is also in the decompressed directory.
34 Some of the decompressed files were found via fuzzing, some are designed
35 to test one aspect or another of the format, while others are public
36 domain texts.
38 These are used in compression and decompression tests.
40 - For decompression tests, we need the decompressed versions to
41   compare against.
43 - For compression tests, we do not assert that the compressed file is
44   identical to the Windows compressed file. Exact equality is not
45   expected by MS-XCA, which leaves room for implementation tricks, but
46   the size of the compressed file allows us to make ballpark
47   assertions about expected compression ratios.