ZXC 0.9.0

ZXC 0.9.0 ZXC 0.9.0 ZXC 0.9.0 ZXC 0.9.0

The release of version 0.9.0 of the library and cross-platform console utility has taken place. ZXC (github.com), implementing high-performance multithreading asymmetric compression without loss and optimized for game resources, firmware, and application packages. The format is designed based on the principle of 'write once, read multiple times' (WORM).

Unlike codecs such as LZ4, ZXC sacrifices compression speed for maximum throughput during decompression.

It is claimed that the decompression speed is 40%+ higher than LZ4 on Apple Silicon, 25%+ higher on Google Axion (ARM64), and 5%+ higher on x86_64, while in all cases providing a higher compression ratio.

This release features an API for reusable contexts, the ability to configure block sizes, a complete API and ABI reference guide, as well as several security-related fixes, including the removal of a heap buffer overflow vulnerability discovered during fuzzing of the compression module.

This release contains changes that break ABI compatibility, therefore SOVERSION has been increased to 2.

The project is written in C and released under the BSD 3 license.

Details
  • Changes leading to incompatibility:
    • SOVERSION 2: The ABI version of the library has been increased. Binaries compiled under SOVERSION 1 need to be recompiled.
    • Option structures: the functions zxc_compress() and zxc_decompress() now accept zxc_compress_opts_t* and zxc_decompress_opts_t* instead of positional parameters. To maintain default behavior, pass NULL.
    • Block size encoding: The file header now stores the block size as an exponent log2 [12..21] instead of the previous two-scale encoding. The old value of 64 is still accepted for backward compatibility.
  • New features:
    • Opaque compression and decompression contexts allocated on the heap, eliminating memory allocation overhead on each call; ideal for file system plugins (squashfs, dwarfs) and batch processing:
      • zxc_create_cctx(), zxc_free_cctx(), and zxc_compress_cctx() for compression;
      • zxc_create_dctx(), zxc_free_dctx(), and zxc_decompress_dctx() for decompression;
      • internal buffers are only reallocated if the block_size or level value changes between calls.
  • Configurable block sizes:
    • the block size can now be configured using the block_size field in the zxc_compress_opts_t structure;
    • valid range: from 4 KB to 2 MB (power of two);
    • default value remains 256 KB;
    • the console utility zxc has a new parameter —block-size (or -B) with support for unit suffixes (4K, 1M or 4KB, 1MB, etc.).
  • Fast direct decompression:
    • when the destination buffer is sufficiently filled, the intermediate copying to the working buffer is skipped during unpacking, reducing memory load and latency.
  • Security and stability:
    • fixed heap buffer overflow in zxc_bitpack_stream_32: packing loop could write up to 4 bytes beyond the output buffer if the last packed value crossed the byte boundary;
    • fixed stream check during unpacking (in zxc_decompress.c): added a check to ensure that the stream size of sequences is sufficient for the declared number of sequences, preventing reading out of the valid range.
    • block size check: now in the functions zxc_cctx_init() and zxc_read_file_header() it checks that block sizes are within the range [ZXC_BLOCK_SIZE_MIN, ZXC_BLOCK_SIZE_MAX] and that they are powers of two;
    • C++ compatibility: all public header files now contain protective extern "C" constructs for seamless use in C++;
    • test case storage for fuzz testing: configured permanent storage for CluesterFuzzLite CI.
  • Documentation:
    • docs/API.md: a new comprehensive API and ABI reference describing all 21 exported symbols, type definitions, visibility strategy, ABI versioning, thread safety guarantees, and error handling patterns;
    • updated man and README file with installation instructions and package status information (vcpkg, Conan, Homebrew);
    • updated file docs/FORMAT.md with a description of block size encoding based on exponent.
  • Updated wrappers for Python, Rust, and Node.js.

Source: linux.org.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster