BLAKE3 验证流式传输的实现
Bao Spec — Rust Crate — Rust Docs
Bao is an implementation of BLAKE3 verified streaming, as described in Section 6.4 of the BLAKE3 spec. Tree hashes like BLAKE3 make it possible to verify part of a file without re-hashing the entire thing, using an encoding format that stores the bytes of the file together with all the nodes of its hash tree. Clients can stream this encoding, or do random seeks into it, while verifying that every byte they read matches the root hash. For the details of how this works, see the Bao spec.
This project includes two Rust crates, the
bao library crate and the
bao_bin binary crate. The latter
provides the bao command line utility.
Caution! Bao is beta cryptography software. It has not been formally audited yet.
Use case: A secure messaging app might support attachment files by including the hash of an attachment in the metadata of a message. With a serial hash, the recipient would need to download the entire attachment to verify it, but that can be impractical for things like large video files. With BLAKE3 and Bao, the recipient can stream a video attachment, while still verifying each byte as it comes in. (This scenario was the original motivation for the Bao project.)
…The bao command line utility is published on
crates.io as the
bao_bin crate. To install it, add
~/.cargo/bin to your PATH and then run:
cargo install bao_binTo build the binary directly from this repo:
git clone https://github.com/oconnor663/bao
cd bao/bao_bin
cargo build --release
./target/release/bao --helptests/bao.py is a fully functional second
implementation in Python, designed to be as short and readable as
possible. It's a good starting point for understanding the algorithms
involved, before diving into the Rust code.
暂无开放 Issues,或尚未同步最近议题。