Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ categories = ["parser-implementations", "compression"]
# The only dependency. ZIP's Deflate payloads are raw deflate streams, and
# reimplementing inflate would be a genuinely bad trade: it is the one part of
# this crate where a subtle bug is both likely and hard to find.
flate2 = "1.1"
#
# Inflation runs on zlib-rs, a Rust port of zlib, rather than flate2's default
# miniz_oxide: 2.3-2.6x faster on Apple M4/M5 cores. Unlike miniz_oxide it uses
# `unsafe` internally, for its SIMD paths. `runtime_detection` lets it pick
# those paths (AVX2 and the like on x86-64) on the machine it runs on.
flate2 = { version = "1.1", default-features = false, features = ["zlib-rs", "runtime_detection"] }

[dev-dependencies]
# None. Test fixtures are built by tests/writer.rs, which writes archives byte
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ complete.

One dependency: `flate2`. Reimplementing inflate would be a bad trade — it is
the one part of this problem where a subtle bug is both likely and hard to find.
It runs on the `zlib-rs` backend, a Rust port of zlib, for speed: it inflates
2.3–2.6× faster than flate2's default `miniz_oxide` on Apple M4/M5 cores.

`#![forbid(unsafe_code)]`. Every field is read through bounds-checked helpers, so
a truncated or hostile archive yields `Err`, never a panic.
a truncated or hostile archive yields `Err`, never a panic. That covers this
crate's own code: `zlib-rs` uses `unsafe` internally for its SIMD paths, which
`miniz_oxide` does not.

- **The central directory is the only source of sizes and offsets.** Local
headers are checked for their signature and nothing else: a streamed entry
Expand Down
23 changes: 0 additions & 23 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
//!
//! Every field is read through bounds-checked helpers, so a truncated or
//! hostile archive yields `Err`, never a panic or an out-of-bounds read.
//! There is no `unsafe` in this crate.
//! There is no `unsafe` in this crate. Inflation is done by `flate2` on its
//! `zlib-rs` backend, which does use `unsafe` internally, for speed.
//!
//! - The central directory is the single source of truth for sizes and
//! offsets. Local headers are checked only for their signature; their size
Expand Down
Loading