Data compression
Compression algorithms are used in a vast number of protocols and file formats throughout all of computing. Implemented in C, these libraries encounter regular security issues despite receiving extensive industry-wide scrutiny.
Our initiative creates memory-safe implementations of compression libraries:
- zlib: a widely-used compression library, used primarily on the web to provide gzip compression.
- zstd: a modern successor to zlib, providing better compression faster.
- bzip2: a file compression program that is widely deployed and supported e.g. as part of zip.
- xz: a compression format that is commonly used for large file downloads.
The high-level goals for the four projects are:
- provide on-par performance with C/C++ counterparts
- provide a dynamic library that is a drop-in replacement, but has compiled memory-safe rust code inside
- dramatically reduce attack surface through memory safety, improved tooling and a robust build system
- provide a pure rust implementation to rust users that integrates with the existing ecosystem
Please get in touch with us, if you are interested in financially supporting us. We offer technical support services for organizations wanting to adopt our data compression software.
What We've Done
For zlib, we've created an implementation based on zlib-ng, called zlib-rs
, with a focus on maintaining excellent performance while introducing memory safety. The initial development of zlib-rs
was started and partly funded by Prossimo and Tweede golf.
In April 2024, an early release of zlib-rs was integrated in flate2. In Nov 2024 an audit by ISRG was succesfully completed, and optimizations for Webassembly were included in a new release.
During 2025, zlib-rs was adopted by many projects and we achieved our goal of on-par performance, see /blog/zlib-rs-is-faster-than-c/.
The development of bzip2, started Oct 2024. Unlike in zlib-rs
we use c2rust
to translate the original bzip2 C code to Rust. Releases are available on GitHub, and also through the bzip2 crate we now maintain.
In June of 2025 we released version 0.6.0 of the bzip2 crate, that uses our 100% Rust implementation, /blog/bzip2-crate-switches-from-c-to-rust/.
What's Next
Development of zstd began in July 2025, with the first release of the decoder planned for December 2025. Meanwhile, work on zlib-rs and bzip2-rs continues to improve the implementations, enhance performance, and expand adoption.
We're currently seeking funding to complete work on zlib-rs
and zstd
and to start work on xz
.
Work plan
For per project details, see the workplan.
Please get in touch with us, if you are interested in financially supporting the development of memory-safe zlib, zstd or xz.
Links
Blog and news
-
bzip2 crate switches from C to 100% rust
Today we published bzip2 version 0.6.0, which uses our rust implementation of the bzip2 algorithm, libbz2-rs-sys, by default. The bzip2 crate is now faster and easier to cross-compile.
Read more ... -
SIMD in zlib-rs (part 2): compare256
In part 1 of the "SIMD in zlib-rs" series, we've seen that, with a bit of nudging, autovectorization can produce optimal code for some problems. But that does not always work: with SIMD clever programmers can still beat the compiler.
Read more ... -
SIMD in zlib-rs (part 1): Autovectorization and target features
I'm fascinated by the creative use of SIMD instructions. When you first learn about SIMD, it is clear that doing more multiplications in a single instruction is useful for speeding up matrix multiplication. But how can all of these weird instructions be used to solve problems that aren't just arithmetic?
Read more ... -
Translating bzip2 with c2rust
Over the past couple of months we've been hard at work on libbzip2-rs, a 100% Rust drop-in compatible implementation the bzip2 compression and decompression functionality.
Read more ... -
zlib-rs is faster than C
We've released version 0.4.2 of zlib-rs, featuring a number of substantial performance improvements. We are now (to our knowledge) the fastest api-compatible zlib implementation for decompression, and beat the competition in the most important compression cases too.
Read more ... -
The fastest WASM zlib
This year we started work on zlib-rs, an implementation of Zlib in Rust, with the goal of maintaining excellent performance while introducing memory safety.
Read more ... -
Trifecta Tech Foundation is the new home for memory safe zlib
Today we're pleased to announce that the recently developed open source memory safe implementation of zlib – zlib-rs – initiated by ISRG's Prossimo project now has a new long-term home at our Trifecta Tech Foundation.
Read more ... -
Current zlib-rs performance
Our zlib-rs project implements a drop-in replacement for libz.so, a dynamic library that is widely used to perform gzip (de)compression.
Read more ... -
flate2 release v1.0.29 with new `zlib-rs` feature
With the new zlib-rs feature, a new backend is enabled that brings in a SIMD-accelerated Rust implementation.
Read more ... -
xz incident shows the need for structural change
At Sovereign Tech Fund, we're following the xz incident closely and listening to the many voices in the FOSS maintainer community.
Read more ...