commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
0c7add10c6a849611f43563a52b87bbcd66edac1 | Jack O'Connor | 2023-06-08T19:59:25 | update memmap2 to v0.7.0 | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 23cb6f8..072e594 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -322,9 +322,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.137"
+version = "0.2.146"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7fcc6... | 2 | 5 | 5 |
4108923f5284e0f8c3cf97b59041c2b6b2f601d3 | Jack O'Connor | 2023-06-07T02:38:26 | add b3sum --seek | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 2b61a67..fd35f68 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -26,6 +26,16 @@ struct Inner {
/// When no file is given, or when - is given, read standard input.
file: Vec<PathBuf>,
+ /// Use the keyed mode, reading the 32-byte key from... | 2 | 58 | 21 |
e6e32bc2b1e15ead9db7c6ee82a60f489cd2673d | Jack O'Connor | 2023-05-01T08:28:01 | small doc tweak | diff --git a/src/lib.rs b/src/lib.rs
index f1775b9..d046672 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -177,8 +177,8 @@ fn counter_high(counter: u64) -> u32 {
/// equality checking.
///
/// `Hash` implements [`From`] and [`Into`] for `[u8; 32]`, and it provides
-/// explicit [`from_bytes`], and [`as_bytes`] for con... | 1 | 2 | 2 |
8176a2202dfd3556949cbdab2b669a011231c63b | Eduardo Leegwater Simões | 2023-04-12T09:26:53 | add `from_bytes` for conversions from `[u8; 32]`
The function is `const`, so it is fundamentally different from the
`From` trait implementation by allowing compile-time instantiation of a
`Hash`. | diff --git a/src/lib.rs b/src/lib.rs
index aa61672..f1775b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -176,13 +176,13 @@ fn counter_high(counter: u64) -> u32 {
/// An output of the default size, 32 bytes, which provides constant-time
/// equality checking.
///
-/// `Hash` implements [`From`] and [`Into`] for `[u8;... | 2 | 39 | 8 |
ce48d79f38a8862b749ec6cc12ba5d1da69ab131 | Eduardo Leegwater Simões | 2023-04-18T08:59:19 | make `Hash::as_bytes` const | diff --git a/src/lib.rs b/src/lib.rs
index b3621c1..aa61672 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -204,7 +204,7 @@ impl Hash {
/// constant-time equality checking, so if you need to compare hashes,
/// prefer the `Hash` type.
#[inline]
- pub fn as_bytes(&self) -> &[u8; OUT_LEN] {
+ pub const... | 1 | 1 | 1 |
a9750c7fec924db6a20fc87fa90269cdecbe75bd | Jack O'Connor | 2023-03-25T23:02:01 | upgrade all Cargo.toml files to edition=2021
The MSRV is already 1.60, so this doesn't affect much. The only impact
to other code is that we no longer need to explicitly import TryInto. | diff --git a/Cargo.toml b/Cargo.toml
index d3e4371..40b1f81 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -7,7 +7,7 @@ repository = "https://github.com/BLAKE3-team/BLAKE3"
license = "CC0-1.0 OR Apache-2.0"
documentation = "https://docs.rs/blake3"
readme = "README.md"
-edition = "2018"
+edition = "2021"
[features]
... | 10 | 7 | 10 |
64747d48ffe9d1fbf4b71e94cabeb8a211461081 | Jack O'Connor | 2023-02-04T18:35:57 | do another saturating_add for consistency
This one is less security/correctness-critical than the other one I just
added, but I might as well be consistent. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index e3dbabf..0af88bb 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -578,7 +578,7 @@ fn main() -> Result<()> {
// errors we'll still return non-zero at the end.
let result = hash_one_input(path, &args);
if... | 1 | 1 | 1 |
697ca13550d70d858e81213876b91cf76c2e7e44 | Jack O'Connor | 2023-02-04T18:00:23 | suppress expected stderr prints in b3sum tests | diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs
index 1112cf8..62602ec 100644
--- a/b3sum/tests/cli_tests.rs
+++ b/b3sum/tests/cli_tests.rs
@@ -117,10 +117,18 @@ fn test_keyed() {
// Make sure that keys of the wrong length lead to errors.
for bad_length in [0, 1, blake3::KEY_LEN - 1, blake3::... | 1 | 11 | 3 |
4c51c06008d9338c3ea81f3ac031b81c0deead9b | Jack O'Connor | 2023-02-04T18:13:34 | add a colon to the b3sum warning format
This matches what md5sum does. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index c44e11b..e3dbabf 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -585,7 +585,7 @@ fn main() -> Result<()> {
}
if args.check() && files_failed > 0 {
eprintln!(
- "{}: WARNING {} computed checksum{} did NOT ma... | 2 | 17 | 8 |
f1dcbeadc238c940d0dcfa3608afee16c950685f | Jack O'Connor | 2023-02-04T17:59:01 | do a saturating_add for files_failed | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 8ef1bec..c44e11b 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -551,7 +551,9 @@ fn check_one_checkfile(path: &Path, args: &Args, files_failed: &mut u64) -> Resu
// return, so it doesn't return a Result.
let success = check_one_line(&... | 1 | 9 | 2 |
98135307bf00c8dee991b016c2117c913fc18a47 | joveian | 2023-01-22T00:57:04 | Use u64 instead of i64 | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 11aac5a..8ef1bec 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -537,7 +537,7 @@ fn check_one_line(line: &str, args: &Args) -> bool {
}
}
-fn check_one_checkfile(path: &Path, args: &Args, files_failed: &mut i64) -> Result<()> {
+fn check_one_ch... | 1 | 2 | 2 |
4c819d01bcea974bbac8199dafe9ab68a24f796b | joveian | 2023-01-13T01:33:06 | Add --check summary of failures
Add a warning to stderr at the end similar to other *sum utilities when --check is used and some files failed verification.
At least the last part of the comment above check_one_checkfile seemed to be incorrect so I removed that comment.
Fixes #283 | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 91a87a1..11aac5a 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -490,8 +490,8 @@ fn hash_one_input(path: &Path, args: &Args) -> Result<()> {
}
// Returns true for success. Having a boolean return value here, instead of
-// passing down the some_fil... | 2 | 30 | 20 |
e366618d225679e750232bfabe63191e14657289 | Jack O'Connor | 2022-12-13T23:56:08 | test `b3sum --keyed` with bad key lengths | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 0715024..91a87a1 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -304,13 +304,13 @@ fn read_key_from_stdin() -> Result<[u8; blake3::KEY_LEN]> {
.lock()
.take(blake3::KEY_LEN as u64 + 1)
.read_to_end(&mut bytes)?;
- if n < 3... | 2 | 11 | 2 |
2465e0a935416da86341813fd1f0d796ed66e22f | Jack O'Connor | 2022-12-13T23:50:30 | expand the short description of b3sum --keyed | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 6089df9..0715024 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -43,10 +43,7 @@ struct Inner {
#[arg(long, value_name("NUM"))]
num_threads: Option<usize>,
- /// Use the keyed mode
- ///
- /// The secret key is read from standard in... | 1 | 1 | 4 |
5dad698d3f89594012f355245a783607b6ffcc0c | Jack O'Connor | 2022-11-23T07:09:05 | test multiple initial counter values for hash_many
I'm adding the i32::MAX test case here because I personally screwed it
up while I was working on
https://github.com/BLAKE3-team/BLAKE3/issues/271. The correct
implementation of the carry bit is the ANDNOT of old high bit (1) and
the new high bit (0). Using XOR instead... | diff --git a/c/blake3_c_rust_bindings/src/test.rs b/c/blake3_c_rust_bindings/src/test.rs
index f4d4810..28ec34b 100644
--- a/c/blake3_c_rust_bindings/src/test.rs
+++ b/c/blake3_c_rust_bindings/src/test.rs
@@ -207,99 +207,107 @@ type HashManyFn = unsafe extern "C" fn(
// A shared helper function for platform-specific... | 2 | 173 | 156 |
afa717caf5bd6cbb90f5395e2642ffa679cac5be | Jack O'Connor | 2022-11-20T23:09:25 | downgrade os_str_bytes to v6.3.1 in b3sum/Cargo.lock
v6.4.0 has a bug where invalid UTF-16 filenames fail a debug_assert on
Windows. See https://github.com/dylni/os_str_bytes/issues/14. The vast
majority of b3sum users should be running a binary built in release mode
and shouldn't be affected by this. This lockfile ch... | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 41ecac7..a8246ab 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -358,9 +358,9 @@ dependencies = [
[[package]]
name = "os_str_bytes"
-version = "6.4.0"
+version = "6.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b5... | 1 | 2 | 2 |
f10d41924ae4f1759e1f9c5085806d7e883afbc6 | Jack O'Connor | 2022-11-20T20:20:57 | regenerate b3sum/Cargo.lock | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 2ec8f3f..41ecac7 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "anyhow"
-version = "1.0.65"
+version = "1.0.66"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98161a4e3e2184da... | 1 | 70 | 59 |
245ac798ce1a9f52011d5f48813fac9901a6a59f | Jack O'Connor | 2022-11-20T20:20:00 | upgrade constant_time_eq to v0.2 and page_size to v0.5 | diff --git a/Cargo.toml b/Cargo.toml
index 5985c6d..c8212e7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -84,14 +84,14 @@ features = ["rayon"]
[dependencies]
arrayref = "0.3.5"
arrayvec = { version = "0.7.0", default-features = false }
-constant_time_eq = "0.1.5"
+constant_time_eq = "0.2.4"
rayon = { version = "1.2.... | 1 | 2 | 2 |
0fb6410c90fb7d5638c9b6fbd88c1631449a4b7b | Ricardo Fernández Serrata | 2022-07-22T06:46:57 | Fix doc typo | diff --git a/src/lib.rs b/src/lib.rs
index 9fc71ae..b3621c1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -659,7 +659,7 @@ fn compress_parents_parallel(
// The wide helper function returns (writes out) an array of chaining values
// and returns the length of that array. The number of chaining values returned
-// is t... | 1 | 1 | 1 |
49a04ca23d10662cc7e5a38fb40f0955224852b5 | Jack O'Connor | 2022-06-23T17:07:53 | clarify unstable Cargo features | diff --git a/Cargo.toml b/Cargo.toml
index cdbcbfe..5985c6d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,7 +38,9 @@ std = ["digest/std"]
# "signature" crate.)
traits-preview = ["digest"]
-# ---------- Features below this line are for internal testing only. ----------
+# ---------- Features below this line are un... | 1 | 4 | 2 |
46cf7b73157516c9d3b63cd7d218ad8d0951c1cd | Jack O'Connor | 2022-06-08T04:52:51 | simplify a line in the docs example code
The same change was previously made in README.md. | diff --git a/src/lib.rs b/src/lib.rs
index a2418df..9fc71ae 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,7 +21,7 @@
//! let mut output = [0; 1000];
//! let mut output_reader = hasher.finalize_xof();
//! output_reader.fill(&mut output);
-//! assert_eq!(&output[..32], hash1.as_bytes());
+//! assert_eq!(hash1, outpu... | 1 | 1 | 1 |
4393a9b79c4d39c6836010a8b5f1a04d069e4521 | Jack O'Connor | 2022-03-27T20:47:34 | fix a deprecation warning from clap | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index f2f411a..0b692a2 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -1,5 +1,5 @@
use anyhow::{bail, ensure, Context, Result};
-use clap::{App, Arg};
+use clap::{Arg, Command};
use std::cmp;
use std::convert::TryInto;
use std::fs::File;
@@ -31,7 +31,7 @... | 1 | 2 | 2 |
d77a70f51215baf977bb949bf9f7e92e7b54c4c8 | Jack O'Connor | 2022-03-27T20:47:00 | refresh the Cargo.lock file for b3sum | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index e0553a6..212e492 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
[[package]]
name = "anyhow"
-version = "1.0.53"
+version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94a45b455c14666b... | 1 | 26 | 25 |
cd0775f8e62bb1d884bd563ce0fc0a90467e060d | Zach Crownover | 2022-03-26T01:53:05 | Update crossbeam-utils from yanked version | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 34991ff..e0553a6 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -149,9 +149,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
-version = "0.8.6"
+version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "... | 1 | 2 | 2 |
f7f535763cb5b2e0239292dafc45e7ae71bb3568 | Zach Crownover | 2022-03-26T01:52:44 | Update crossbeam-channel from yanked version | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index ed87832..34991ff 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -115,9 +115,9 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "crossbeam-channel"
-version = "0.5.2"
+version = "0.5.4"
source = "regis... | 1 | 2 | 2 |
be9ff324bd4cdba5125d6310cf90fa42fb889fae | Zach Crownover | 2022-03-26T01:50:55 | Update block-buffer from yanked version | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 0874b3b..ed87832 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -73,9 +73,9 @@ dependencies = [
[[package]]
name = "block-buffer"
-version = "0.10.0"
+version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1d... | 1 | 2 | 2 |
989c30e2498c5ef65949761764297f9df864d074 | Zach Crownover | 2022-03-26T01:48:20 | RUSTSEC-2020-0077
Migrate from the abandoned memmap library to the now maintained fork
of memmap2 | diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock
index 98b1b93..0874b3b 100644
--- a/b3sum/Cargo.lock
+++ b/b3sum/Cargo.lock
@@ -46,7 +46,7 @@ dependencies = [
"clap",
"duct",
"hex",
- "memmap",
+ "memmap2",
"rayon",
"tempfile",
"wild",
@@ -280,13 +280,12 @@ source = "registry+https://github.com/rust-lang/c... | 3 | 9 | 10 |
540f708a94e1a50e20d6dbf6921a59560645f342 | Jack O'Connor | 2022-01-25T01:47:37 | check the HMAC output bytes | diff --git a/src/traits.rs b/src/traits.rs
index 14b0f55..70b1c06 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -171,12 +171,57 @@ mod test {
assert_eq!(out1.as_bytes(), out2.into_bytes().as_slice());
}
+ fn expected_hmac_blake3(key: &[u8], input: &[u8]) -> [u8; 32] {
+ // See https://en.w... | 1 | 47 | 2 |
509e97ed9080e933fc1741811f5b61ef217107a1 | jbis9051 | 2022-01-25T00:29:33 | Adds test | diff --git a/Cargo.toml b/Cargo.toml
index a11608a..dbff115 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -93,6 +93,7 @@ page_size = "0.4.1"
rand = "0.8.0"
rand_chacha = "0.3.0"
reference_impl = { path = "./reference_impl" }
+hmac = "0.12.0"
[build-dependencies]
cc = "1.0.4"
diff --git a/src/traits.rs b/src/traits... | 2 | 10 | 0 |
e069e461166fa5bc6d569cf3792886e711ee44c5 | jbis9051 | 2022-01-23T20:46:04 | Add blocksize trait | diff --git a/src/traits.rs b/src/traits.rs
index 12c4e5f..668d372 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -5,7 +5,7 @@ pub use digest;
use crate::{Hasher, OutputReader};
use digest::crypto_common;
-use digest::generic_array::{typenum::U32, GenericArray};
+use digest::generic_array::{typenum::U32, typenum:... | 1 | 5 | 1 |
43ce77aaaf14c7879548655dbc3ed1d0803e3470 | Jack O'Connor | 2022-01-08T05:06:19 | add Samuel Neves as a listed author of the Rust crate
Samuel wrote all of the assembly implementations, with the sole
exception of the SSE2 port. | diff --git a/Cargo.toml b/Cargo.toml
index 30caf2d..f678595 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "blake3"
version = "1.2.0"
-authors = ["Jack O'Connor <oconnor663@gmail.com>"]
+authors = ["Jack O'Connor <oconnor663@gmail.com>", "Samuel Neves"]
description = "the BLAKE3 hash func... | 1 | 1 | 1 |
c7b5881928715429857d0b3e1bee7a4315cbf415 | Jack O'Connor | 2021-12-30T18:34:04 | a few more comment tweaks | diff --git a/src/lib.rs b/src/lib.rs
index a380543..8082dbf 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -49,9 +49,9 @@
//! without NEON support.
//!
//! The `traits-preview` feature enables implementations of traits from the
-//! RustCrypto [`digest`] crate, and re-exports those crates as
+//! RustCrypto [`digest`] ... | 1 | 3 | 3 |
61d6621ba51acc5dcef970b6f63725ba11446606 | Matthias Schiffer | 2021-12-22T23:16:09 | Update digest crate to 0.10 for traits-preview feature
Adjust to the following changes that happened in digest:
- The crypto-mac crate has been merged into digest (with "mac" feature
enabled)
- Various traits have been split up
- The Digest and Mac traits now share their update/finalize/reset
implementations
- Th... | diff --git a/Cargo.toml b/Cargo.toml
index 285171a..30caf2d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,7 +36,7 @@ std = ["digest/std"]
# who use it should expect breaking changes between patch versions of this
# crate. (The "*-preview" feature name follows the conventions of the RustCrypto
# "signature" crate.)... | 4 | 69 | 61 |
da4c792d8094f35c05c41c9aeb5dfe4aa67ca1ac | Jack O'Connor | 2021-11-30T19:03:32 | add an assert and remove an iter_mut in reference_impl
Suggested in https://github.com/rust-lang/rust-clippy/issues/8039. | diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs
index e669f36..83ac795 100644
--- a/reference_impl/reference_impl.rs
+++ b/reference_impl/reference_impl.rs
@@ -125,8 +125,9 @@ fn first_8_words(compression_output: [u32; 16]) -> [u32; 8] {
}
fn words_from_little_endian_bytes(bytes: &[... | 1 | 3 | 2 |
04571021fb5490d0f0008c5b5a968f221de159a0 | Jack O'Connor | 2021-11-05T00:37:05 | add Hasher::count | diff --git a/src/lib.rs b/src/lib.rs
index a5fbac9..4976c29 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1301,6 +1301,11 @@ impl Hasher {
pub fn finalize_xof(&self) -> OutputReader {
OutputReader::new(self.final_output())
}
+
+ /// Return the total number of bytes hashed so far.
+ pub fn count(... | 2 | 14 | 6 |
1042917e1625be7daf237a8ccfeba824eac68a89 | Jack O'Connor | 2021-10-29T18:44:42 | make field ordering more consistent in the reference impl | diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs
index 78715c9..e669f36 100644
--- a/reference_impl/reference_impl.rs
+++ b/reference_impl/reference_impl.rs
@@ -238,8 +238,8 @@ impl ChunkState {
Output {
input_chaining_value: self.chaining_value,
block_... | 1 | 1 | 1 |
600f0b51fe5072559060b1b879fabd4210a177ee | Jack O'Connor | 2021-10-29T18:04:22 | distinguish between key and key_words in the reference impl | diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs
index 2488343..78715c9 100644
--- a/reference_impl/reference_impl.rs
+++ b/reference_impl/reference_impl.rs
@@ -181,9 +181,9 @@ struct ChunkState {
}
impl ChunkState {
- fn new(key: [u32; 8], chunk_counter: u64, flags: u32) -> Self ... | 1 | 13 | 13 |
f35d0315781e81e9b4318f3764ff50aa5a6ac100 | Jack O'Connor | 2021-10-29T16:07:28 | remove an incorrect comment | diff --git a/src/lib.rs b/src/lib.rs
index 6cd2f6a..a5fbac9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -777,7 +777,6 @@ fn compress_subtree_to_parent_node<J: join::Join>(
// Hash a complete input all at once. Unlike compress_subtree_wide() and
// compress_subtree_to_parent_node(), this function handles the 1 chunk... | 1 | 0 | 1 |
1f2010d79e8aab541c665a5b3e3dd2814648d68e | Jack O'Connor | 2021-10-23T17:09:52 | update NEON docs in lib.rs | diff --git a/src/lib.rs b/src/lib.rs
index 31e5cd6..6cd2f6a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,19 +34,19 @@
//!
//! The `std` feature (the only feature enabled by default) is required for
//! implementations of the [`Write`] and [`Seek`] traits, and also for runtime
-//! CPU feature detection. If this f... | 1 | 8 | 8 |
6b9cbe5e23443eb05d5cbdf645cb54b3706ea0c6 | rsdy | 2021-10-09T18:46:07 | Match the C binding's target arch detection with the root crate's | diff --git a/c/blake3_c_rust_bindings/build.rs b/c/blake3_c_rust_bindings/build.rs
index d5dc47a..98f8396 100644
--- a/c/blake3_c_rust_bindings/build.rs
+++ b/c/blake3_c_rust_bindings/build.rs
@@ -22,6 +22,10 @@ fn is_armv7() -> bool {
target_components()[0] == "armv7"
}
+fn is_aarch64() -> bool {
+ target_c... | 1 | 12 | 4 |
20fd56ac0fe8c5f824cb7ce0375c6a63102a1ff1 | rsdy | 2021-10-08T10:34:35 | Add `no_neon` feature to disable NEON on aarch64 | diff --git a/Cargo.toml b/Cargo.toml
index a43f000..b2d8d0c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -73,6 +73,7 @@ no_sse2 = []
no_sse41 = []
no_avx2 = []
no_avx512 = []
+no_neon = []
[package.metadata.docs.rs]
# Document Hasher::update_rayon on docs.rs.
diff --git a/build.rs b/build.rs
index c5677f6..ac1d6a... | 2 | 10 | 1 |
0a0bb7126e9207d3bb3d9af0f0b5ae646d532cf2 | rsdy | 2021-10-07T11:23:36 | Implement better target detection for NEON | diff --git a/build.rs b/build.rs
index 4fd3bae..c5677f6 100644
--- a/build.rs
+++ b/build.rs
@@ -44,6 +44,14 @@ fn is_x86_32() -> bool {
arch == "i386" || arch == "i586" || arch == "i686"
}
+fn is_arm() -> bool {
+ is_armv7() || is_aarch64() || target_components()[0] == "arm"
+}
+
+fn is_aarch64() -> bool {
... | 3 | 20 | 11 |
c4582c977934aa691d14e85413f434b0bc457819 | Jack O'Connor | 2021-09-10T16:59:13 | clarify that OutputReader::position is equivalent to Seek::stream_position | diff --git a/src/lib.rs b/src/lib.rs
index 071b745..4123a0b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1393,10 +1393,13 @@ impl OutputReader {
}
}
- /// Return the current read position in the output stream. The position of
- /// a new `OutputReader` starts at 0, and each call to [`fill`] or
- ... | 1 | 6 | 3 |
3baa54476a34309875e27d131c43c78d7e93a23a | Jack O'Connor | 2021-09-10T16:48:58 | link to the paper in the derive_key docs | diff --git a/src/lib.rs b/src/lib.rs
index c3b1894..071b745 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -852,7 +852,8 @@ pub fn keyed_hash(key: &[u8; KEY_LEN], input: &[u8]) -> Hash {
/// another algorithm. You might need to do this if you're adding features to
/// an existing application, which does not yet use key ... | 1 | 2 | 1 |
037de38bfec4e813ab6189a50cb7c4cbae47268a | Jack O'Connor | 2021-05-18T16:28:29 | upgrade to arrayvec 0.7.0
This version uses const generics, which bumps our minimum supported
compiler version to 1.51. | diff --git a/Cargo.toml b/Cargo.toml
index 9d21b26..3c11c4c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -80,7 +80,7 @@ features = ["rayon"]
[dependencies]
arrayref = "0.3.5"
-arrayvec = { version = "0.5.1", default-features = false, features = ["array-sizes-33-128"] }
+arrayvec = { version = "0.7.0", default-featur... | 17 | 54 | 54 |
aa52ce3a4b211292ab2b59d0cb9bd4272d466eec | Jack O'Connor | 2021-05-18T16:28:09 | upgrade crypto-mac to 0.11.0 | diff --git a/Cargo.toml b/Cargo.toml
index 316cd09..9d21b26 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -85,7 +85,7 @@ constant_time_eq = "0.1.5"
rayon = { version = "1.2.1", optional = true }
cfg-if = "1.0.0"
digest = { version = "0.9.0", optional = true }
-crypto-mac = { version = "0.10.0", optional = true }
+cryp... | 1 | 1 | 1 |
4b7babbe99c04bd573aad49db24484d07c574ae9 | Jack O'Connor | 2021-03-29T00:01:18 | more cleaup of undocumented API | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 3810bfe..2a9b737 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -308,7 +308,7 @@ fn maybe_memmap_file(file: &File) -> Result<Option<memmap::Mmap>> {
fn write_hex_output(mut output: blake3::OutputReader, args: &Args) -> Result<()> {
// Encoding mu... | 5 | 12 | 14 |
dab97de401ea6734bfaca64d256bb6cfadf3cbe0 | Jack O'Connor | 2021-03-28T19:12:42 | update doc comments on guts module | diff --git a/src/guts.rs b/src/guts.rs
index 88dcc86..e06721c 100644
--- a/src/guts.rs
+++ b/src/guts.rs
@@ -1,7 +1,10 @@
-// This module is for incremental use cases like the `bao` crate, which need to
-// get their hands on internal chunk and parent chaining values. The vast
-// majority of users should ignore this a... | 1 | 7 | 4 |
f7088f24f8bf80ae613c793c23326ba711707330 | P.M | 2021-03-22T15:33:54 | comment cleanup in build.rs (#164) | diff --git a/build.rs b/build.rs
index ea657d8..4fd3bae 100644
--- a/build.rs
+++ b/build.rs
@@ -156,7 +156,7 @@ fn build_sse2_sse41_avx2_assembly() {
fn build_avx512_c_intrinsics() {
// This is required on 32-bit x86 targets, since the assembly
- // implementation doesn't support support those.
+ // impl... | 1 | 1 | 1 |
9ef2f4d9a8a50def1fea7096283f6a9408c1a0a6 | Jack O'Connor | 2021-03-22T00:42:58 | implement Display for Hash | diff --git a/src/lib.rs b/src/lib.rs
index 7376636..6ac32a1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -193,8 +193,7 @@ fn counter_high(counter: u64) -> u32 {
/// accidentally lost.
///
/// `Hash` provides the [`to_hex`] and [`from_hex`] methods for converting to
-/// and from hexadecimal. It also implements [`From... | 2 | 18 | 5 |
421745b033e9b3ccf21819d06528677aab9d083c | Paul Grandperrin | 2021-01-07T15:49:22 | Cargo.toml: update crypto-mac to 0.10.0 | diff --git a/Cargo.toml b/Cargo.toml
index 563375c..81d50a7 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -76,7 +76,7 @@ constant_time_eq = "0.1.5"
rayon = { version = "1.2.1", optional = true }
cfg-if = "1.0.0"
digest = "0.9.0"
-crypto-mac = "0.8.0"
+crypto-mac = "0.10.0"
[dev-dependencies]
hex = "0.4.2" | 1 | 1 | 1 |
7155e5bb71cf45faffac39bf8725fd7a49f72a68 | Jack O'Connor | 2021-03-20T18:16:19 | Rayon-related doc fixes | diff --git a/src/lib.rs b/src/lib.rs
index effa31a..267961d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -32,23 +32,27 @@
//!
//! # Cargo Features
//!
-//! The `rayon` feature provides [Rayon]-based multi-threading, via functions
-//! with the `_rayon` suffix. It is disabled by default, but enabled for
-//! [docs.rs]... | 1 | 65 | 84 |
b228f46e0308d9c48d19ee077a2f73a402fa26c3 | Jack O'Connor | 2021-03-01T02:11:21 | add *_rayon methods | diff --git a/Cargo.toml b/Cargo.toml
index 567a008..563375c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,10 +25,9 @@ neon = []
# entire build, with e.g. RUSTFLAGS="-C target-cpu=native".
std = ["digest/std"]
-# The "rayon" feature (defined below as an optional dependency) enables the
-# join::RayonJoin type, whi... | 6 | 137 | 55 |
ea72822620ba77e4f597bf6d6bd4bd8c3b4cc9dc | Jack O'Connor | 2021-03-01T01:52:23 | re-privatize the Join trait | diff --git a/src/join.rs b/src/join.rs
index 60932db..2435bc6 100644
--- a/src/join.rs
+++ b/src/join.rs
@@ -8,47 +8,18 @@
//! [`hash`] and [`Hasher::update`], always use `SerialJoin` internally.
//!
//! The `Join` trait is an almost exact copy of the [`rayon::join`] API, and
-//! `RayonJoin` is the only non-trivial... | 3 | 12 | 96 |
71d67e081028972790d4b56e23dc57805aa78a85 | Jack O'Connor | 2021-02-28T23:05:20 | make derive_key() return an array | diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs
index 51fbbba..7ecf8b9 100644
--- a/b3sum/tests/cli_tests.rs
+++ b/b3sum/tests/cli_tests.rs
@@ -121,9 +121,7 @@ fn test_derive_key() {
let f = tempfile::NamedTempFile::new().unwrap();
f.as_file().write_all(b"key material").unwrap();
f.as_fi... | 4 | 37 | 37 |
134bb24686f9a1cd02ad12fdf22a72d9c1071220 | Jack O'Connor | 2021-02-28T22:50:06 | impl PartialEq<[u8]> for Hash | diff --git a/src/lib.rs b/src/lib.rs
index e5f3eb6..9869ebb 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -293,6 +293,14 @@ impl PartialEq<[u8; OUT_LEN]> for Hash {
}
}
+/// This implementation is constant-time if the target is 32 bytes long.
+impl PartialEq<[u8]> for Hash {
+ #[inline]
+ fn eq(&self, other... | 1 | 8 | 0 |
0872f98c151892b3b417eccbf22bc023a30433fb | Paul Grandperrin | 2021-02-25T12:57:12 | Cargo.toml: upgrade all non API breaking dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 3df0fd2..567a008 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -75,15 +75,15 @@ arrayref = "0.3.5"
arrayvec = { version = "0.5.1", default-features = false, features = ["array-sizes-33-128"] }
constant_time_eq = "0.1.5"
rayon = { version = "1.2.1", optional = true }
-cfg-if =... | 2 | 4 | 4 |
0c26ed52a8be3b11e0cc7d8c43ffee237ae38583 | Jack O'Connor | 2021-02-03T18:41:51 | rename ParseError to HexError and update docs | diff --git a/src/lib.rs b/src/lib.rs
index f165814..e5f3eb6 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -182,21 +182,9 @@ fn counter_high(counter: u64) -> u32 {
/// conversion happens implicitly and the constant-time property is
/// accidentally lost.
///
-/// `Hash` provides the [`to_hex`] method for converting to ... | 2 | 40 | 39 |
cc21dd013254624c30fdf461b83a8822d877b9f6 | Jack O'Connor | 2021-02-03T18:27:46 | implement Error for ParseError, make it opaque, and support from_hex(&[u8]) | diff --git a/src/lib.rs b/src/lib.rs
index c8148fa..f165814 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -161,16 +161,6 @@ const KEYED_HASH: u8 = 1 << 4;
const DERIVE_KEY_CONTEXT: u8 = 1 << 5;
const DERIVE_KEY_MATERIAL: u8 = 1 << 6;
-/// Errors from parsing hex values
-#[derive(Debug, PartialEq)]
-pub enum ParseErro... | 2 | 58 | 31 |
35aa4259bd37457f15d5070957da4825bf64c838 | Jack O'Connor | 2020-10-01T13:41:08 | version 0.3.7
Changes since 0.3.6:
- BUGFIX: The C implementation was incorrect on big endian systems for
inputs longer than 1024 bytes. This bug affected all previous versions
of the C implementation. Little endian platforms like x86 were
unaffected. The Rust implementation was also unaffected.
@jakub-zwolako... | diff --git a/Cargo.toml b/Cargo.toml
index 5d5e23a..3df0fd2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "blake3"
-version = "0.3.6"
+version = "0.3.7"
authors = ["Jack O'Connor <oconnor663@gmail.com>"]
description = "the BLAKE3 hash function"
repository = "https://github.com/BLAKE3-te... | 2 | 2 | 2 |
3817999f17a249f58678c5aa0f5508c24367b821 | Jack O'Connor | 2020-09-29T15:05:49 | fix the short_test_cases loop in the C bindings tests | diff --git a/c/blake3_c_rust_bindings/benches/bench.rs b/c/blake3_c_rust_bindings/benches/bench.rs
index c6e821e..119bd20 100644
--- a/c/blake3_c_rust_bindings/benches/bench.rs
+++ b/c/blake3_c_rust_bindings/benches/bench.rs
@@ -251,7 +251,6 @@ fn bench_many_parents_sse2(b: &mut Bencher) {
);
}
-
#[bench]
#[c... | 2 | 4 | 2 |
5bdfd07666d29dd939e2a507209f21d0e4bbc80d | Jack O'Connor | 2020-09-29T14:59:56 | update the blake3_c_rust_bindings test cases also | diff --git a/c/blake3_c_rust_bindings/src/test.rs b/c/blake3_c_rust_bindings/src/test.rs
index f824ceb..ff4b35d 100644
--- a/c/blake3_c_rust_bindings/src/test.rs
+++ b/c/blake3_c_rust_bindings/src/test.rs
@@ -19,6 +19,19 @@ const KEYED_HASH: u8 = 1 << 4;
pub const TEST_CASES: &[usize] = &[
0,
1,
+ 2,
+ ... | 1 | 13 | 0 |
ac1da75bb9c65a0fcfe370b6e7ec8b1b7474786d | Jack O'Connor | 2020-09-10T20:47:56 | add a test for blake3_hasher_init_derive_key_raw | diff --git a/c/blake3_c_rust_bindings/src/lib.rs b/c/blake3_c_rust_bindings/src/lib.rs
index a695f01..f18fe12 100644
--- a/c/blake3_c_rust_bindings/src/lib.rs
+++ b/c/blake3_c_rust_bindings/src/lib.rs
@@ -64,6 +64,18 @@ impl Hasher {
}
}
+ pub fn new_derive_key_raw(context: &[u8]) -> Self {
+ ... | 2 | 25 | 0 |
004b39a350e0aba67bef02037dc1e76b569d4a1f | Jack O'Connor | 2020-09-10T19:55:02 | cargo fmt | diff --git a/src/lib.rs b/src/lib.rs
index 97f74d0..bf66b6d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -88,18 +88,18 @@ mod avx512;
#[path = "ffi_neon.rs"]
mod neon;
mod portable;
-#[cfg(blake3_sse41_rust)]
-#[path = "rust_sse41.rs"]
-mod sse41;
-#[cfg(blake3_sse41_ffi)]
-#[path = "ffi_sse41.rs"]
-mod sse41;
#[cfg... | 4 | 9 | 9 |
3c1db555293a85aa3c131b59904dcbe2dd8161ac | Jack O'Connor | 2020-08-31T21:37:09 | add the dynamic check for SSE2 support
It will be very rare that this actually executes, but we should include
it for completeness. | diff --git a/src/platform.rs b/src/platform.rs
index ee9c349..4bd67de 100644
--- a/src/platform.rs
+++ b/src/platform.rs
@@ -337,7 +337,7 @@ pub fn avx512_detected() -> bool {
{
return true;
}
- // Dyanmic check, if std is enabled.
+ // Dynamic check, if std is enabled.
#[cfg(feature = "st... | 1 | 11 | 4 |
8610ebda6a25b73dbebf656285725e3b1d255731 | Samuel Neves | 2020-08-31T17:38:58 | add sse2 tests and benchmarks | diff --git a/c/blake3_c_rust_bindings/benches/bench.rs b/c/blake3_c_rust_bindings/benches/bench.rs
index 4335a26..c6e821e 100644
--- a/c/blake3_c_rust_bindings/benches/bench.rs
+++ b/c/blake3_c_rust_bindings/benches/bench.rs
@@ -69,6 +69,18 @@ fn bench_single_compression_portable(b: &mut Bencher) {
);
}
+#[benc... | 2 | 60 | 0 |
324090b2c30b88463917e133f456af0d45ccbea9 | Nikolai Vazquez | 2020-08-27T06:11:32 | Implement `fmt::Debug` using builders
This enables pretty printing via `{:#?}`. The normal style for `{:?}` is
kept exactly the same. | diff --git a/src/lib.rs b/src/lib.rs
index 95d3e83..384bade 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -262,7 +262,13 @@ impl Eq for Hash {}
impl fmt::Debug for Hash {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f, "Hash({})", self.to_hex())
+ // Formatting field as `&str` to ... | 1 | 20 | 15 |
c32660099a86a574155a81767dc49ba08d05667d | Matthew Krupcale | 2020-08-25T01:09:56 | Fix unreachable expression compiler warning
SSE2 target_feature appears to always be present for x86_64. | diff --git a/src/platform.rs b/src/platform.rs
index 0fd9cbb..c0eb21d 100644
--- a/src/platform.rs
+++ b/src/platform.rs
@@ -403,14 +403,6 @@ pub fn sse2_detected() -> bool {
{
return true;
}
- // Dyanmic check, if std is enabled.
- #[cfg(feature = "std")]
- {
- if is_x86_feature_dete... | 1 | 0 | 8 |
09cc03614dc8edc9ffccad256178e84699fe4fc7 | Jack O'Connor | 2020-08-14T15:33:45 | the same hex example for rustdocs | diff --git a/src/lib.rs b/src/lib.rs
index 38112d1..95d3e83 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,6 +23,9 @@
//! output_reader.fill(&mut output);
//! assert_eq!(&output[..32], hash1.as_bytes());
//! # }
+//!
+//! // Print a hash as hex.
+//! println!("{}", hash1.to_hex());
//! # Ok(())
//! # }
//! ``` | 1 | 3 | 0 |
e0f193ddc9c0400262dae4118b0660ae8d70586e | Jack O'Connor | 2020-06-24T21:51:41 | put the file name in b3sum error output
This was previously there, but got dropped in
c5c07bb337d0af7522666d05308aaf24eef3709c. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index c799390..b01e5de 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -612,7 +612,7 @@ fn main() -> Result<()> {
let result = hash_one_input(path, &args);
if let Err(e) = result {
some_file_failed = true... | 2 | 32 | 1 |
4c41a893a00a3ebe7b24529531ccf96d8593a57c | Jack O'Connor | 2020-06-14T18:08:08 | a little bit of cleanup and more testing | diff --git a/src/traits.rs b/src/traits.rs
index d49b5e3..9704e01 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -34,14 +34,12 @@ impl digest::FixedOutput for Hasher {
#[inline]
fn finalize_into(self, out: &mut GenericArray<u8, Self::OutputSize>) {
- let bytes = self.finalize();
- out.as_mu... | 1 | 38 | 6 |
1ecb14ce34790bb7b882449c77c36131af61add6 | Justus K | 2020-06-12T23:03:41 | Replace std::io::copy with clone_from_slice | diff --git a/src/traits.rs b/src/traits.rs
index 72d121e..d49b5e3 100644
--- a/src/traits.rs
+++ b/src/traits.rs
@@ -35,14 +35,12 @@ impl digest::FixedOutput for Hasher {
#[inline]
fn finalize_into(self, out: &mut GenericArray<u8, Self::OutputSize>) {
let bytes = self.finalize();
- let mut byt... | 1 | 2 | 4 |
7eea9b4c75e19588bbaf1a0996f228b81cb4531a | Justus K | 2020-06-12T22:50:20 | Bump digest to 0.9.0 and crypto-mac to 0.8.0 | diff --git a/Cargo.toml b/Cargo.toml
index 0d77fc8..720e9a4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -75,8 +75,8 @@ arrayvec = { version = "0.5.1", default-features = false, features = ["array-siz
constant_time_eq = "0.1.5"
rayon = { version = "1.2.1", optional = true }
cfg-if = "0.1.10"
-digest = "0.8.1"
-crypto... | 2 | 46 | 27 |
f287b56bc6cc5110751664df27d8689459ad7434 | Jack O'Connor | 2020-05-26T01:22:29 | all-capitalize "FILE" in the b3sum help output | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index b829e99..c799390 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -12,7 +12,7 @@ mod unit_tests;
const NAME: &str = "b3sum";
-const FILE_ARG: &str = "file";
+const FILE_ARG: &str = "FILE";
const DERIVE_KEY_ARG: &str = "derive-key";
const KEYED_ARG... | 1 | 1 | 1 |
0215604c596e36e1e72871f38a06990310d53f40 | Jack O'Connor | 2020-05-26T01:20:43 | avoid repeating a string | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index b692824..b829e99 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -31,7 +31,7 @@ struct Args {
impl Args {
fn parse() -> Result<Self> {
- let inner = App::new("b3sum")
+ let inner = App::new(NAME)
.version(env!("CARGO_P... | 1 | 1 | 1 |
ca9687e36c0acf90f87b6e41130668a96e29e9b8 | Jack O'Connor | 2020-05-23T19:16:02 | fix another small mistake in the docs | diff --git a/src/lib.rs b/src/lib.rs
index e9480e8..c2a156e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -43,7 +43,8 @@
//! detection. If this feature is disabled, the only way to use the SIMD
//! implementations in this crate is to enable the corresponding instruction
//! sets statically for the entire build, with e... | 1 | 2 | 1 |
8d6f0f257457ec9847e5734d506a1cffc77ea5b4 | Jack O'Connor | 2020-05-23T18:56:43 | add a test comment | diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs
index 2f4b47c..07fcbb7 100644
--- a/b3sum/tests/cli_tests.rs
+++ b/b3sum/tests/cli_tests.rs
@@ -496,6 +496,15 @@ fn test_globbing() {
let foo_hash = blake3::hash(b"foo");
let bar_hash = blake3::hash(b"bar");
+ // NOTE: This assumes that the... | 1 | 9 | 0 |
cd093791ab44595ea3d59a579af9ceb850db807a | Jack O'Connor | 2020-05-23T18:28:10 | remove an extra space in some help text | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 5d82f40..b692824 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -34,7 +34,7 @@ impl Args {
let inner = App::new("b3sum")
.version(env!("CARGO_PKG_VERSION"))
.arg(Arg::with_name(FILE_ARG).multiple(true).help(
- ... | 1 | 1 | 1 |
48512ec4f06cffaa3b3fba7af344f4924c1e6b10 | Jack O'Connor | 2020-05-23T16:34:02 | use wild::args_os to support globbing on Windows | diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml
index a72450e..3b1368c 100644
--- a/b3sum/Cargo.toml
+++ b/b3sum/Cargo.toml
@@ -20,6 +20,7 @@ clap = "2.33.1"
hex = "0.4.0"
memmap = "0.7.0"
rayon = "1.2.1"
+wild = "2.0.3"
[dev-dependencies]
duct = "0.13.3"
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index... | 3 | 31 | 1 |
c9a1676942841973dc412f2b1e1f2d67b20949e2 | Jack O'Connor | 2020-05-23T16:18:54 | add support for --quiet to `b3sum --check`
Suggested by @llowrey:
https://github.com/BLAKE3-team/BLAKE3/issues/33#issuecomment-629853747 | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 29e20fa..10f19ea 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -21,6 +21,7 @@ const NO_NAMES_ARG: &str = "no-names";
const NUM_THREADS_ARG: &str = "num-threads";
const RAW_ARG: &str = "raw";
const CHECK_ARG: &str = "check";
+const QUIET_ARG: &str =... | 2 | 44 | 9 |
5651ce7ee0b0ad2f577beef7efcef87e2f39fbe2 | Jack O'Connor | 2020-05-14T15:32:05 | enable clap default features
These are nice to have. I used to think this would increase build times,
but in practice it doesn't. | diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml
index 86fa83c..a72450e 100644
--- a/b3sum/Cargo.toml
+++ b/b3sum/Cargo.toml
@@ -16,7 +16,7 @@ pure = ["blake3/pure"]
[dependencies]
anyhow = "1.0.25"
blake3 = { version = "0.3", path = "..", features = ["rayon"] }
-clap = { version = "2.33.0", default-features = false... | 1 | 1 | 1 |
86d5a13731a398d4785f7a0e8b57898559735910 | Jack O'Connor | 2020-05-14T15:29:28 | clarify that --no-mmap disables threading | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 9195c09..29e20fa 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -76,11 +76,10 @@ impl Args {
context string. Cannot be used with --keyed.",
),
)
- .arg(
- Arg::with_n... | 1 | 4 | 5 |
1d03c7d3faa90061e94f17cfe7bda006612c0c74 | Jack O'Connor | 2020-05-14T15:13:25 | print per-file errros more gracefuly in --check | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index ebcb928..9195c09 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -501,6 +501,51 @@ fn hash_one_input(path: &Path, args: &Args) -> Result<()> {
Ok(())
}
+// Returns true for success. Having a boolean return value here, instead of
+// passing down... | 2 | 81 | 27 |
11edfb76f388dcc5a200815659020496744579b3 | Jack O'Connor | 2020-05-13T22:45:39 | print more compiler version info in CI | diff --git a/tools/compiler_version/src/main.rs b/tools/compiler_version/src/main.rs
index 4506cf7..767cb31 100644
--- a/tools/compiler_version/src/main.rs
+++ b/tools/compiler_version/src/main.rs
@@ -1,12 +1,27 @@
+use std::process::Command;
+
fn main() {
- // Set in build.rs.
- let compiler_path = env!("COMPIL... | 1 | 19 | 4 |
c5c07bb337d0af7522666d05308aaf24eef3709c | Jack O'Connor | 2020-05-13T19:33:17 | refactor b3sum to support --check
This is an overall cleanup of everything that b3sum is doing, especially
file opening and memory mapping, which makes it easier for the regular
hashing mode to share code with the checking mode. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 04ed6b5..ebcb928 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -1,17 +1,17 @@
use anyhow::{bail, ensure, Context, Result};
use clap::{App, Arg};
-use std::borrow::Cow;
use std::cmp;
use std::convert::TryInto;
-use std::ffi::OsStr;
use std::fs::Fi... | 3 | 561 | 234 |
5030c0f1c345b8ccf40ecd7cf540d1bce562895c | Jack O'Connor | 2020-05-13T21:47:29 | switch from assert_cmd to CARGO_BIN_EXE_* | diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml
index 735e950..86fa83c 100644
--- a/b3sum/Cargo.toml
+++ b/b3sum/Cargo.toml
@@ -22,6 +22,5 @@ memmap = "0.7.0"
rayon = "1.2.1"
[dev-dependencies]
-assert_cmd = "0.12.0"
duct = "0.13.3"
tempfile = "3.1.0"
diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests... | 2 | 1 | 2 |
c6a99dbb239522b1f99950faefc2b072ee3b1a53 | Jack O'Connor | 2020-05-12T17:08:22 | add parse_check_line
As part of this, reorganize b3sum tests into src/unit_tests.rs and
tests/cli_tests.rs. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 16d2948..04ed6b5 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -1,11 +1,16 @@
-use anyhow::{bail, Context, Result};
+use anyhow::{bail, ensure, Context, Result};
use clap::{App, Arg};
+use std::borrow::Cow;
use std::cmp;
use std::convert::TryInto;
... | 3 | 252 | 1 |
584a66598d0e464cc2741dcac8a12d61023818e3 | Jack O'Connor | 2020-05-12T13:55:09 | stop printing the lossy warning
Rather than breaking the check parse with more output, we'll have a rule
that a Unicode replacement character (�) in a path name automatically
fails the check. | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index a87a486..16d2948 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -1,6 +1,5 @@
use anyhow::{bail, Context, Result};
use clap::{App, Arg};
-use std::borrow::Cow;
use std::cmp;
use std::convert::TryInto;
use std::ffi::OsStr;
@@ -223,14 +222,12 @@ fn r... | 2 | 9 | 23 |
4ad79ae457e826e6a74e91aaa0d3f4ec1562dc54 | Jack O'Connor | 2020-05-04T14:19:46 | lower our required version of `cc`
I've tested manually and found that 1.0.4 is the oldest version of `cc`
that builds successfully for us. (Version 1.0.3 is missing the
`is_flag_supported` method.)
This change might help with
https://github.com/BLAKE3-team/BLAKE3/issues/83. That said, the
underlying issue there is r... | diff --git a/Cargo.toml b/Cargo.toml
index bb0eb27..3114148 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -86,4 +86,4 @@ rand_chacha = "0.2.1"
reference_impl = { path = "./reference_impl" }
[build-dependencies]
-cc = "1.0.48"
+cc = "1.0.4" | 1 | 1 | 1 |
d5e26538fc70a6399bb9d32b06fee723afd374a5 | Jack O'Connor | 2020-04-13T21:55:29 | refactor build.rs
Two main changes:
- In https://github.com/BLAKE3-team/BLAKE3/issues/79 we learned that
older versions of Clang require AVX-512 flags even to compile AVX-512
assembly.
- If the C compiler doesn't support AVX-512, we'd still prefer to build
the SSE4.1 and AVX2 assembly implementations, on x86_64. | diff --git a/build.rs b/build.rs
index c2572aa..38fc722 100644
--- a/build.rs
+++ b/build.rs
@@ -74,7 +74,15 @@ fn new_build() -> cc::Build {
build
}
-fn c_compiler_exists_and_supports_avx512() -> bool {
+#[derive(PartialEq)]
+enum CCompilerSupport {
+ NoCompiler,
+ NoAVX512,
+ YesAVX512,
+}
+use CComp... | 1 | 87 | 56 |
86c3174d5b4bc98ccb65ca51402763e7ede15cb3 | Jack O'Connor | 2020-04-10T15:24:37 | unbreak neon benchmarks
A helper function was incorrectly restricted to x86-only. CI doesn't
currently cover this, because benchmarks are nightly-only, and it's kind
of inconvenient to set RUSTC_BOOTSTRAP=1 through `cross` (which normally
doesn't propagate env vars). But maybe we should start... | diff --git a/src/platform.rs b/src/platform.rs
index d2790a6..dafa934 100644
--- a/src/platform.rs
+++ b/src/platform.rs
@@ -276,7 +276,6 @@ impl Platform {
}
#[cfg(feature = "neon")]
- #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub fn neon() -> Option<Self> {
// Assumed to be... | 1 | 0 | 1 |
5fad419a8d9413bb0719e0502765556ab3f96865 | Jack O'Connor | 2020-03-29T05:42:17 | add a Windows GNU AVX-512 build break workaround
The break in question only repros under --release, and we didn't start
testing a release build of the prefer-intrinsics mode until just now. | diff --git a/build.rs b/build.rs
index 8d74f04..b7f7f7b 100644
--- a/build.rs
+++ b/build.rs
@@ -148,6 +148,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
avx512_build.flag("-mavx512f");
avx512_build.flag("-mavx512vl");
}
+ if is_windows_gnu() {
+ ... | 1 | 4 | 0 |
a0355ba8e075de0f552eae808e9445717943c996 | Jack O'Connor | 2020-03-16T16:06:16 | add the --num-threads flag
As part of this change, make the rayon and memmap dependencies
mandatory. This simplifies the code a lot, and I'm not aware of any
callers who build b3sum without the default dependencies.
If --num-threads is not given, or if its value is 0, b3sum will still
respect the RAYON_NUM_THREADS en... | diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml
index d930c19..fa77fe9 100644
--- a/b3sum/Cargo.toml
+++ b/b3sum/Cargo.toml
@@ -9,17 +9,17 @@ readme = "README.md"
edition = "2018"
[features]
-default = ["c", "rayon"]
+default = ["c"]
c = ["blake3/c"]
c_neon = ["blake3/c_neon"]
-rayon = ["blake3/rayon", "memmap"]... | 2 | 74 | 55 |
d925728aed79bcc81f68abb19f750f2df5b3e41a | Jack O'Connor | 2020-03-15T19:47:58 | wrap --help output to 80 columns | diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs
index 246f24d..3853249 100644
--- a/b3sum/src/main.rs
+++ b/b3sum/src/main.rs
@@ -24,13 +24,19 @@ fn clap_parse_argv() -> clap::ArgMatches<'static> {
.short("l")
.takes_value(true)
.value_name("LEN")
- .... | 1 | 17 | 8 |
1f529a841cad582dbd1310a9468d46ce9c6cc161 | Jack O'Connor | 2020-03-05T15:54:11 | add an example of parsing a Hash from a hex string
Suggested by @zaynetro:
https://github.com/BLAKE3-team/BLAKE3/pull/24#issuecomment-594369061 | diff --git a/Cargo.toml b/Cargo.toml
index 587b4e7..4dd1865 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -53,6 +53,7 @@ digest = "0.8.1"
crypto-mac = "0.7.0"
[dev-dependencies]
+hex = "0.4.2"
page_size = "0.4.1"
rand = "0.7.2"
rand_chacha = "0.2.1"
diff --git a/src/lib.rs b/src/lib.rs
index fef3ac8..c0915ee 10064... | 2 | 19 | 0 |
fdd329ba57896faac4ae797775c175ad880cbe42 | Jack O'Connor | 2020-02-14T16:59:59 | check for AVX-512 compiler support even when using assembly | diff --git a/build.rs b/build.rs
index 7112f94..8d74f04 100644
--- a/build.rs
+++ b/build.rs
@@ -66,7 +66,8 @@ re-enable with "--features=rayon".) Other crates might or might not support
this workaround.
"#;
-fn check_for_avx512_compiler_support(build: &cc::Build) {
+fn check_for_avx512_compiler_support() {
+ le... | 1 | 3 | 2 |
5dea88983480c117d21ea1c00e3e429e0baa98ca | Jack O'Connor | 2020-02-12T19:38:35 | add a performance note and a usage example for Hasher | diff --git a/src/lib.rs b/src/lib.rs
index 1016e16..d2c523b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -769,6 +769,36 @@ fn parent_node_output(
/// In addition to its inherent methods, this type implements several commonly
/// used traits from the [`digest`](https://crates.io/crates/digest) and
/// [`crypto_mac`](h... | 1 | 30 | 0 |
38a46ba8aeae41965fb49d79a2688a89a5270682 | Jack O'Connor | 2020-02-12T19:17:31 | document optional Cargo features on docs.rs | diff --git a/src/join.rs b/src/join.rs
index 8442172..60932db 100644
--- a/src/join.rs
+++ b/src/join.rs
@@ -45,6 +45,8 @@
//! [`rayon::join`]: https://docs.rs/rayon/1.3.0/rayon/fn.join.html
/// The trait that abstracts over single-threaded and multi-threaded recursion.
+///
+/// See the [`join` module docs](index.... | 2 | 24 | 2 |
1c5d4eea6a93f241bfd2b3eb4d5c525444766045 | Jack O'Connor | 2020-02-12T15:22:54 | test a couple more reset() cases | diff --git a/src/test.rs b/src/test.rs
index b8e5ce3..5a2b480 100644
--- a/src/test.rs
+++ b/src/test.rs
@@ -469,6 +469,25 @@ fn test_reset() {
hasher.reset();
hasher.update(&[42; CHUNK_LEN + 3]);
assert_eq!(hasher.finalize(), crate::hash(&[42; CHUNK_LEN + 3]));
+
+ let key = &[99; crate::KEY_LEN];
+ ... | 1 | 19 | 0 |
e0dc4d932ed81a985a1793251b5f61a3227d2dac | Jack O'Connor | 2020-02-12T04:45:41 | use a non-zero value for counter when testing hash_many with parents
We use a counter value that's very close to wrapping the lower word,
when we're testing the hash_many chunks case. It turns out that this is
a useful thing to do with parents too, even though parents 1) are
teeechnically supposed to always use a coun... | diff --git a/src/test.rs b/src/test.rs
index bc6f136..b8e5ce3 100644
--- a/src/test.rs
+++ b/src/test.rs
@@ -154,7 +154,7 @@ pub fn test_hash_many_fn(
crate::portable::hash_many(
&parents,
&TEST_KEY_WORDS,
- 0,
+ counter,
IncrementCounter::No,
crate::KEYED_HASH | c... | 1 | 2 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.