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
9c0d90e5933ee3ef167f1a11e93a77115e1ce015
Dominic
2021-06-06T22:01:26
re-export all necessary types from the regex crate
diff --git a/src/lib.rs b/src/lib.rs index 3d6125b..fb61949 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -148,6 +148,6 @@ pub use { regex_is_match, regex_replace_all, }, - regex::Regex, + regex::{Captures, Regex, RegexBuilder}, }; diff --git a/src/proc_macros/mod.rs b/src/proc_macros/mod....
2
9
14
eed1977953cba325baf3aae658e53ca4627819e0
Canop
2021-06-04T14:49:39
Introduce the `regex_replace_all` macro
diff --git a/examples/regexes/src/main.rs b/examples/regexes/src/main.rs index c35a088..20954d5 100644 --- a/examples/regexes/src/main.rs +++ b/examples/regexes/src/main.rs @@ -47,6 +47,34 @@ fn example_captures() { assert_eq!(version, "2.0"); } +fn examples_replace_all() { + let text = "Foo fuu"; + let t...
4
147
13
b910e045b3fb130af2e725f314aeb30a3662ebc2
AlephAlpha
2021-05-31T06:18:49
use the original name for lazy-regex-proc_macros
diff --git a/Cargo.toml b/Cargo.toml index 743f712..5d2142e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,8 +14,7 @@ readme = "README.md" once_cell = "1.7" regex = "1.5" -[dependencies.proc_macros] -package = "lazy-regex-proc_macros" +[dependencies.lazy-regex-proc_macros] path = "src/proc_macros" version = "2.0...
2
2
3
98cb3c3f22365b5a7f2f7df4fb3accc07ba69586
Canop
2021-05-17T09:53:46
add missing manifest things
diff --git a/src/proc_macros/Cargo.toml b/src/proc_macros/Cargo.toml index d0a358a..f929735 100644 --- a/src/proc_macros/Cargo.toml +++ b/src/proc_macros/Cargo.toml @@ -2,13 +2,15 @@ name = "lazy-regex-proc_macros" version = "2.0.0" authors = ["Canop <cano.petrole@gmail.com>"] +description = "proc macros for the laz...
1
3
1
3d1b179afde4b018ab525c456d37c57c54307627
Canop
2021-05-04T18:39:04
no reason not to be in 1.0.0 New features, if any, will go in 1.x
diff --git a/Cargo.toml b/Cargo.toml index 63f4215..d3405ab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lazy-regex" -version = "0.1.4" +version = "1.0.0" authors = ["Canop <cano.petrole@gmail.com>"] edition = "2018" description = "a macro to reduce regex creation boilerplate"
1
1
1
99dda685880fde8de31084a9b646a399d6d51dec
Canop
2020-07-10T06:38:19
add lib level documentation
diff --git a/Cargo.toml b/Cargo.toml index c275630..63f4215 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lazy-regex" -version = "0.1.3" +version = "0.1.4" authors = ["Canop <cano.petrole@gmail.com>"] edition = "2018" description = "a macro to reduce regex creation boilerplate" diff --...
2
29
1
c34e1c902fbd56ecf14f0c9a8b80f3e939e3ff9b
Canop
2020-05-18T15:27:04
import regex::Regex inside the macro call so that it's not necessary to do it outside
diff --git a/Cargo.toml b/Cargo.toml index d3ebdeb..c275630 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lazy-regex" -version = "0.1.2" +version = "0.1.3" authors = ["Canop <cano.petrole@gmail.com>"] edition = "2018" description = "a macro to reduce regex creation boilerplate" diff --...
2
2
1
1f98694ba87c1b566ad9e6a411bae805b4a43106
Canop
2019-10-07T20:05:51
add repository to manifest
diff --git a/Cargo.toml b/Cargo.toml index db8a5d1..d3ebdeb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "lazy-regex" -version = "0.1.1" +version = "0.1.2" authors = ["Canop <cano.petrole@gmail.com>"] edition = "2018" description = "a macro to reduce regex creation boilerplate" keyw...
1
2
1
2e3727d292dcffa9ecf8058b4d9f01a18df517bf
Jack O'Connor
2026-03-30T17:27:15
`cargo fmt` everywhere
diff --git a/benches/bench.rs b/benches/bench.rs index e89f04c..6c471d8 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -4,8 +4,8 @@ extern crate test; use arrayref::array_ref; use arrayvec::ArrayVec; -use blake3::platform::{Platform, MAX_SIMD_DEGREE}; use blake3::OUT_LEN; +use blake3::platform::{MAX_SIMD_...
17
23
21
0ebe469626502046557c644c01e4ed72f1b8b5fd
Liam Perlaki
2026-03-03T09:07:55
update to new rustcrypto trait releases
diff --git a/Cargo.toml b/Cargo.toml index 693ae87..bbae58d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -116,21 +116,21 @@ arrayref = "0.3.5" arrayvec = { version = "0.7.4", default-features = false } constant_time_eq = { version = "0.4.2", default-features = false } cfg-if = "1.0.0" -digest = { version = "0.10.1", ...
5
22
26
d4b005a9f51ac5290bc96a5706e1cf897f602567
YOUR_NAME
2026-03-14T19:36:31
wasm32_simd: use i8x16_shuffle for rot8 and rot16 Replace shift+OR (3 WASM instructions) with i8x16_shuffle (1 instruction) for byte-aligned 8-bit and 16-bit rotations. ~20% throughput improvement on WASM SIMD targets. Benchmarked on Chrome desktop (16 cores) and iPhone (A18 Pro).
diff --git a/src/wasm32_simd.rs b/src/wasm32_simd.rs index f0b5580..853f210 100644 --- a/src/wasm32_simd.rs +++ b/src/wasm32_simd.rs @@ -56,16 +56,16 @@ fn set4(a: u32, b: u32, c: u32, d: u32) -> v128 { i32x4(a as i32, b as i32, c as i32, d as i32) } -// These rotations are the "simple/shifts version". For the ...
1
9
9
6eebbbd67935cc6b8fe24da164ae968a2e3973cb
Jack O'Connor
2026-03-06T23:21:23
fix a struct size mismatch in tests The `blake3_c_rust_bindings` (test-only code) previously hardcoded a size of 1728 for `cv_stack`. That was correct at the time, but the stack grew by one entry later (to support "lazy merging"), and the bindings weren't updated. You'd need a near-maximum-length input to make the has...
diff --git a/c/blake3_c_rust_bindings/src/lib.rs b/c/blake3_c_rust_bindings/src/lib.rs index f5f7023..a54d0d2 100644 --- a/c/blake3_c_rust_bindings/src/lib.rs +++ b/c/blake3_c_rust_bindings/src/lib.rs @@ -130,7 +130,7 @@ pub mod ffi { pub key: [u32; 8usize], pub chunk: blake3_chunk_state, pub...
1
1
1
0b64ce2aa2772c6df8b9058104924020febfd889
silverstillisntgold
2025-08-09T10:32:03
bump constant_time_eq version to 0.4.2
diff --git a/Cargo.toml b/Cargo.toml index 61ca47f..8302b3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,9 @@ wasm32_simd = [] # enabled by default. (Previously this also controlled runtime CPU feature # detection on x86, but now we use the no-std-compatible `cpufeatures` crate # for that.) -std = [] +# Als...
1
4
2
308b95dfa15d5a0aa8cb3c5534ffd90d76122c46
Josh Triplett
2025-11-17T23:03:12
Add `Hash::as_slice()` for convenient serialization to bytes `Hash::as_bytes()` returns the hash as an array of bytes. However, sometimes it's useful to have the hash as a slice of bytes instead, such as for serialization via an API that takes `&[u8]`. While `.as_bytes().as_slice()` works for this, it'd be more conven...
diff --git a/src/lib.rs b/src/lib.rs index 217314c..f27f903 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -253,6 +253,14 @@ impl Hash { Self(bytes) } + /// The raw bytes of the `Hash`, as a slice. Useful for serialization. Note that byte arrays + /// don't provide constant-time equality checking, so...
2
11
0
eae9bf376a1c4797df7be6e49e735c0a5d91dcb0
Jack O'Connor
2025-11-12T16:35:11
Revert "pin `generic-array` to the un-deprecated version" Upstream `crypto-common` now does the pin itself: https://github.com/RustCrypto/traits/issues/2036#issuecomment-3522196740
diff --git a/Cargo.toml b/Cargo.toml index fd88a15..61ca47f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ zeroize = ["dep:zeroize", "arrayvec/zeroize"] # who use it should expect breaking changes between patch versions of this # crate. (The "*-preview" feature name follows the conventions of the RustCryp...
1
1
4
185f1db1273cff2bb7ca3adaaa76e5d542ca8d3b
Jack O'Connor
2025-11-11T15:41:31
pin `generic-array` to the un-deprecated version This is a temporary hack to fix warnings in CI. Upstream tracking issue: https://github.com/RustCrypto/traits/issues/2036
diff --git a/Cargo.toml b/Cargo.toml index 61ca47f..fd88a15 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ zeroize = ["dep:zeroize", "arrayvec/zeroize"] # who use it should expect breaking changes between patch versions of this # crate. (The "*-preview" feature name follows the conventions of the RustCryp...
1
4
1
f8dbfe0b18fd500fd5ae2647c76a5bbdcf49f348
Jack O'Connor
2025-09-30T01:18:27
some more unsafe blocks, in wasm32_simd.rs
diff --git a/src/wasm32_simd.rs b/src/wasm32_simd.rs index ff253aa..f0b5580 100644 --- a/src/wasm32_simd.rs +++ b/src/wasm32_simd.rs @@ -27,13 +27,13 @@ pub const DEGREE: usize = 4; #[inline(always)] unsafe fn loadu(src: *const u8) -> v128 { // This is an unaligned load, so the pointer cast is allowed. - v128...
1
60
51
2308ddc03f72ba78ded1fa32b01e257faee2b5df
Jack O'Connor
2025-09-30T00:05:08
one more unsafe block, in ffi_neon.rs
diff --git a/src/ffi_neon.rs b/src/ffi_neon.rs index 54d07a4..0b443c9 100644 --- a/src/ffi_neon.rs +++ b/src/ffi_neon.rs @@ -15,18 +15,20 @@ pub unsafe fn hash_many<const N: usize>( // array, but the C implementations don't. Even though this is an unsafe // function, assert the bounds here. assert!(out.l...
1
14
12
89537d968225007ee1490059c894fc89ab9b4863
Nazar Mokrynskyi
2025-08-12T11:05:37
Fix prefetch pointer addition that resulted in UB
diff --git a/src/rust_avx2.rs b/src/rust_avx2.rs index a37a4ca..7fe69e6 100644 --- a/src/rust_avx2.rs +++ b/src/rust_avx2.rs @@ -262,7 +262,10 @@ unsafe fn transpose_msg_vecs(inputs: &[*const u8; DEGREE], block_offset: usize) loadu(inputs[7].add(block_offset + 1 * 4 * DEGREE)), ]; for i in 0..DEGREE ...
3
12
3
feb303f38d9c814cfb78cddf7c88864262cddddb
kilavvy
2025-06-20T13:05:49
Update wasm32_simd.rs
diff --git a/src/wasm32_simd.rs b/src/wasm32_simd.rs index c4e2771..ff253aa 100644 --- a/src/wasm32_simd.rs +++ b/src/wasm32_simd.rs @@ -134,7 +134,7 @@ fn unpackhi_epi32(a: v128, b: v128) -> v128 { fn shuffle_epi32<const I3: usize, const I2: usize, const I1: usize, const I0: usize>( a: v128, ) -> v128 { - //...
1
1
1
529d536da241ed2c9fbc8c9eaf9b0958537876f2
leopardracer
2025-06-16T12:25:51
Update wasm32_simd.rs
diff --git a/src/wasm32_simd.rs b/src/wasm32_simd.rs index 1352491..c4e2771 100644 --- a/src/wasm32_simd.rs +++ b/src/wasm32_simd.rs @@ -134,7 +134,7 @@ fn unpackhi_epi32(a: v128, b: v128) -> v128 { fn shuffle_epi32<const I3: usize, const I2: usize, const I1: usize, const I0: usize>( a: v128, ) -> v128 { - //...
1
1
1
1229986d26a0d35eadc80c8c313e0fa9da95d2bb
Jack O'Connor
2025-06-04T22:14:09
remove a comma
diff --git a/src/lib.rs b/src/lib.rs index 280964b..217314c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,7 @@ //! //! The `rayon` feature (disabled by default, but enabled for [docs.rs]) adds //! the [`update_rayon`](Hasher::update_rayon) and (in combination with `mmap` -//! below) [`update_mmap_rayon`](Has...
1
1
1
33038828510d0ce83d5c1cbc1efb10e683c15aaa
Jack O'Connor
2025-05-07T21:04:05
update duct to v1.0.0
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index e09a52d..bfb8194 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -99,15 +99,16 @@ dependencies = [ "cc", "cfg-if", "constant_time_eq", + "cpufeatures", "memmap2", "rayon-core", ] [[package]] name = "cc" -version = "1.2.19" +version = "1.2.21"...
2
28
12
f813ff4b4ca0d6e74b12976048ac821948b765db
Jack O'Connor
2025-04-24T18:46:04
flesh out hash_derive_key_context and new_from_context_key docs
diff --git a/src/hazmat.rs b/src/hazmat.rs index 2fd2449..c5b5d48 100644 --- a/src/hazmat.rs +++ b/src/hazmat.rs @@ -157,7 +157,14 @@ pub trait HasherExt { /// Similar to [`Hasher::new_derive_key`] but using a pre-hashed [`ContextKey`] from /// [`hash_derive_key_context`]. /// - /// The [`hash_derive_...
1
14
3
f3e0184aaba8284bbab2ce434dd7ed337d3fbe05
Jack O'Connor
2025-04-24T16:32:50
update docs for the "std" feature Previously "std" enabled runtime CPU feature detection on x86, but as of https://github.com/BLAKE3-team/BLAKE3/pull/469 that's always on.
diff --git a/Cargo.toml b/Cargo.toml index bdd719f..61ca47f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,11 +24,11 @@ neon = [] # This may become the default in the future. wasm32_simd = [] -# This crate uses libstd for std::io trait implementations, and also for -# runtime CPU feature detection. This feature is...
2
10
12
ed3fd0da1d049ab531bcd358630da02ece504464
Nazar Mokrynskyi
2025-04-09T05:54:58
Check x86 features even in `no_std`
diff --git a/Cargo.toml b/Cargo.toml index 25ab345..bdd719f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,6 +120,9 @@ rayon-core = { version = "1.12.1", optional = true } serde = { version = "1.0", default-features = false, features = ["derive"], optional = true } zeroize = { version = "1", default-features = fals...
2
15
56
21afc1a02f79a1bc8fc14156b0e95c8711c03371
Nazar Mokrynskyi
2025-04-17T09:26:46
Remove `std` feature from `rayon` feature
diff --git a/Cargo.toml b/Cargo.toml index 46c7d74..5efda24 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ std = [] # # Implementation detail: We take a dependency on rayon-core instead of rayon, # because it builds faster and still includes all the APIs we need. -rayon = ["dep:rayon-core", "std"] +rayon...
1
2
2
2de3cb1a21d09cdee4c8b6b14513063198cf1b82
Jack O'Connor
2025-04-17T01:55:39
clarify a comment
diff --git a/src/lib.rs b/src/lib.rs index 027d4ba..d777896 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1125,11 +1125,11 @@ impl Hasher { // always merging 1 chunk at a time. Instead, each CV might represent any // power-of-two number of chunks, as long as the smaller-above-larger stack // order is main...
1
5
5
657c312945eb611ee149b9e331d8db93cad95c58
Jack O'Connor
2025-03-18T18:36:51
mention the "wasm32_simd" Cargo feature in the crate docs
diff --git a/src/lib.rs b/src/lib.rs index 0141347..92bdbdb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -66,6 +66,10 @@ //! enabling this feature will produce a binary that's not portable to CPUs //! without NEON support. //! +//! The `wasm32_simd` feature enables the WASM SIMD implementation for all `wasm32-` +//! ...
1
4
0
4ca3c6fb7fdecc4978c5075f89be3be8c0f38266
Jack O'Connor
2025-03-17T18:06:21
many_chunks and many_parents benchmarks for wasm
diff --git a/benches/bench.rs b/benches/bench.rs index dd9f498..94c4bb2 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -146,9 +146,13 @@ fn bench_many_chunks_avx512(b: &mut Bencher) { #[bench] #[cfg(feature = "neon")] fn bench_many_chunks_neon(b: &mut Bencher) { - if let Some(platform) = Platform::neon()...
1
14
6
91520df254a7cbc291756e1007e6c6ae5d8dd86d
Ivan Boldyrev
2025-03-04T15:31:35
Rust 1.80 compatibility form `blake3_wasm32_simd`
diff --git a/build.rs b/build.rs index 551b4e9..01b692f 100644 --- a/build.rs +++ b/build.rs @@ -311,6 +311,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { "blake3_avx2_rust", "blake3_avx512_ffi", "blake3_neon", + "blake3_wasm32_simd", ]; for cfg_name in all_cfgs {...
1
1
0
2f863422ec7c4c16475a7b58c0f14674db1ab8a5
Ivan Boldyrev
2023-09-21T16:24:04
Make some function safe Certain functions' unsafety comes from v128 loads and store. If argument types guarantee that these loads and stores are safe, function is declared safe, and internal unsafe blocks are commented.
diff --git a/src/platform.rs b/src/platform.rs index 1c82603..51b3b7b 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -149,11 +149,10 @@ impl Platform { // No NEON compress_in_place() implementation yet. #[cfg(blake3_neon)] Platform::NEON => portable::compress_in_place(cv, b...
2
25
20
268868bd1690aa5a5e13349670c559342807c542
Ivan Boldyrev
2023-09-11T18:50:59
Fix platform constants
diff --git a/src/platform.rs b/src/platform.rs index 9af6089..1c82603 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -13,7 +13,7 @@ cfg_if::cfg_if! { } else if #[cfg(blake3_neon)] { pub const MAX_SIMD_DEGREE: usize = 4; } else if #[cfg(blake3_wasm32_simd)] { - pub const MAX_SIMD_DEGREE:...
1
1
2
c27ba73939ecc6f1aedf1f68f2140701f53769f7
Ivan Boldyrev
2023-09-11T18:47:58
Fix comment
diff --git a/src/platform.rs b/src/platform.rs index 11da3e2..9af6089 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -401,7 +401,7 @@ impl Platform { #[cfg(blake3_wasm32_simd)] pub fn wasm32_simd() -> Option<Self> { - // Assumed to be safe if the "neon" feature is on. + // Assumed to be...
1
1
1
503c828d240ea20e89c1b21412bf7eaa24a4d134
Ivan Boldyrev
2023-09-11T17:03:02
Remove unsafe from functions that do not need it Wasm SIMD API has certain function safe.
diff --git a/src/wasm32_simd.rs b/src/wasm32_simd.rs index 531b600..39948e7 100644 --- a/src/wasm32_simd.rs +++ b/src/wasm32_simd.rs @@ -37,22 +37,22 @@ unsafe fn storeu(src: v128, dest: *mut u8) { } #[inline(always)] -unsafe fn add(a: v128, b: v128) -> v128 { +fn add(a: v128, b: v128) -> v128 { i32x4_add(a, b...
1
17
17
d4aed8145b5478d62308319d2ad849e2a1e371db
Ivan Boldyrev
2023-09-09T19:45:31
Wasm32 SIMD implementation This code is based on rust_sse2.rs of the same distribution, and is subject to further improvements. Some comments are left intact even if their applicability is questioned. SIMD implementation is gated by `wasm32-simd` feature, portable version is used otherwise. Performance measurements ...
diff --git a/Cargo.toml b/Cargo.toml index 11779d1..9436937 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,11 @@ default = ["std"] # implementation uses C intrinsics and requires a C compiler. neon = [] +# The WASM-SIMD implementation does not participate in dynamic feature detection, +# which is currently x...
5
859
0
0bdc6ca96c32d07e289527be7405d5dc57493539
Jack O'Connor
2025-03-13T23:14:23
@toothbrush7777777's fix for `use_msvc_asm` https://github.com/BLAKE3-team/BLAKE3/pull/230#issuecomment-2014908888
diff --git a/build.rs b/build.rs index 8e06376..3f23161 100644 --- a/build.rs +++ b/build.rs @@ -48,15 +48,29 @@ fn is_windows_target() -> bool { } fn use_msvc_asm() -> bool { - // cc assumes if it is passed .asm and targetting MSVC that it can use the - // Microsoft assemblers, which isn't true when we're no...
2
42
14
6da62fb314f48e81dea36649b1703e86c8a59b15
Sporif
2022-03-06T01:17:13
Fix cross compilation with clang-cl
diff --git a/build.rs b/build.rs index 2557120..8e06376 100644 --- a/build.rs +++ b/build.rs @@ -43,6 +43,23 @@ fn is_x86_64() -> bool { target_components()[0] == "x86_64" } +fn is_windows_target() -> bool { + env::var("CARGO_CFG_TARGET_OS").unwrap() == "windows" +} + +fn use_msvc_asm() -> bool { + // cc ...
2
91
40
daa66a6b261cedf9733778fa7a26fb4dea500ffd
Jack O'Connor
2025-03-09T21:31:12
use `ignore` to avoid overdoing rerun-if-changed in bindings
diff --git a/c/blake3_c_rust_bindings/Cargo.toml b/c/blake3_c_rust_bindings/Cargo.toml index 2576eaa..e70f16b 100644 --- a/c/blake3_c_rust_bindings/Cargo.toml +++ b/c/blake3_c_rust_bindings/Cargo.toml @@ -27,3 +27,4 @@ reference_impl = { path = "../../reference_impl" } [build-dependencies] cc = "1.0.48" +ignore = "...
2
9
6
715f87450eeed237aeb42cedd325bd2f7d67d8fd
Jack O'Connor
2025-03-01T01:32:37
use rsplit_once for parsing tagged lines, add test cases
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index 2d0ba5d..4479d4d 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -335,15 +335,19 @@ struct ParsedCheckLine { } fn split_untagged_check_line(line_after_slash: &str) -> Option<(&str, &str)> { + // Of the form "<hash> <file>". The file might contai...
2
35
1
7ff889e70f493da06630754c30eded23e61226fd
Jack O'Connor
2025-02-28T19:49:33
make anyhow::Result explicit in main.rs
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index ba386c7..2d0ba5d 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -1,4 +1,4 @@ -use anyhow::{bail, ensure, Result}; +use anyhow::{bail, ensure}; use clap::Parser; use std::cmp; use std::fs::File; @@ -104,7 +104,7 @@ struct Args { } impl Args { - ...
1
13
13
70e4ce484787d1d98d663504c97f97c13a5ea7a4
Jack O'Connor
2025-02-28T19:39:42
reduce code duplication in parse_check_line
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index 8d63688..ba9db13 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -334,6 +334,18 @@ struct ParsedCheckLine { expected_hash: blake3::Hash, } +fn split_untagged_check_line(line_after_slash: &str) -> Option<(&str, &str)> { + line_after_slash.spli...
1
42
57
582180eb09d0369f64502fef3bc37af84c2e1fce
Jack O'Connor
2025-02-28T18:50:13
combine test_check and test_check_tag
diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs index 8f3520c..3fe173d 100644 --- a/b3sum/tests/cli_tests.rs +++ b/b3sum/tests/cli_tests.rs @@ -18,7 +18,10 @@ fn test_hash_one() { #[test] fn test_hash_one_tag() { let expected = format!("BLAKE3 (-) = {}", blake3::hash(b"foo").to_hex()); - let ...
1
147
274
c721a95806173975d469a2260f57294fcc5a3dde
Leah Neukirchen
2025-02-28T16:10:39
add tests Adapted from https://github.com/BLAKE3-team/BLAKE3/pull/430/ by dbohdan.
diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs index cd48ac7..8f3520c 100644 --- a/b3sum/tests/cli_tests.rs +++ b/b3sum/tests/cli_tests.rs @@ -15,6 +15,13 @@ fn test_hash_one() { assert_eq!(&*expected, output); } +#[test] +fn test_hash_one_tag() { + let expected = format!("BLAKE3 (-) = {}",...
1
176
0
c3ad60d2b13d868d6da25c2587e915908c7066f4
Leah Neukirchen
2025-02-28T15:55:44
b3sum: add tag support for --check
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index b10cff8..8d63688 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -347,6 +347,42 @@ fn parse_check_line(mut line: &str) -> Result<ParsedCheckLine> { is_escaped = true; line = &line[1..]; } + + if line.starts_with("BLAKE3 (") { +...
1
36
0
cd6fdc3e03b0143f0e2a4d7537f58e595cf7cc0b
Leah Neukirchen
2025-02-28T15:38:16
b3sum: add --tag
diff --git a/b3sum/src/main.rs b/b3sum/src/main.rs index baa6b6c..b10cff8 100644 --- a/b3sum/src/main.rs +++ b/b3sum/src/main.rs @@ -16,6 +16,7 @@ const KEYED_ARG: &str = "keyed"; const LENGTH_ARG: &str = "length"; const NO_NAMES_ARG: &str = "no_names"; const RAW_ARG: &str = "raw"; +const TAG_ARG: &str = "tag"; con...
1
16
0
8f4928fa7bedb4f4517c99e2db421613b9cd0769
Jack O'Connor
2025-02-27T17:21:19
remove mmap from the default features list I committed this change accidentally in a12fa7b8a4131d77c35eda5c680b9307a0fc28d3. Thanks to @ArmoredPony for catching this in https://github.com/BLAKE3-team/BLAKE3/issues/452.
diff --git a/Cargo.toml b/Cargo.toml index 0f5a861..7bf3c4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" edition = "2021" [features] -default = ["std", "mmap"] +default = ["std"] # The NEON implementation does not participate in dynamic feature detection, # which is currently ...
1
1
1
2cb802b115aa248f6534f353f26cc9060378bc31
Jack O'Connor
2025-02-20T20:22:17
revert `unsafe extern "C"` blocks This will be necessary when we eventually move to the 2024 edition, but for now it's an unnecessary MSRV bump.
diff --git a/src/ffi_avx2.rs b/src/ffi_avx2.rs index ef954bd..43bf150 100644 --- a/src/ffi_avx2.rs +++ b/src/ffi_avx2.rs @@ -35,7 +35,7 @@ pub unsafe fn hash_many<const N: usize>( } pub mod ffi { - unsafe extern "C" { + extern "C" { pub fn blake3_hash_many_avx2( inputs: *const *const u8,...
4
4
4
eccd0e5379bacc1121e3550714f5a4d5690ba776
Jack O'Connor
2025-02-20T20:05:18
add `unsafe` annotations needed for the 2024 edition
diff --git a/src/ffi_avx2.rs b/src/ffi_avx2.rs index 33961e9..ef954bd 100644 --- a/src/ffi_avx2.rs +++ b/src/ffi_avx2.rs @@ -14,26 +14,28 @@ pub unsafe fn hash_many<const N: usize>( flags_end: u8, out: &mut [u8], ) { - // The Rust hash_many implementations do bounds checking on the `out` - // array, bu...
4
151
111
d4da2150c61944e3e353194335ee885bcc37a8f1
Jack O'Connor
2025-02-17T22:35:34
update b3sum/Cargo.lock
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 2904481..10adfc9 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -38,24 +38,25 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencie...
1
85
62
c0938ee148d511e63f702a6bbfbc336ad6c83322
Josh Triplett
2025-02-16T20:06:11
Add `Hash::from_slice` to handle conversion from `&[u8]` bytes This is a convenience method, to avoid having to first call `<[u8; 32]>::try_from(slice)?`.
diff --git a/src/lib.rs b/src/lib.rs index 37c2c0b..355668f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -236,6 +236,13 @@ impl Hash { Self(bytes) } + /// Create a `Hash` from its raw bytes representation as a slice. + /// + /// Returns an error if the slice is not exactly 32 bytes long. + pu...
2
17
0
41b5c02b5718e38d9ac50523f0724a867678b46a
Omer Cheri
2025-02-12T09:21:48
fix build.rs errors on win7 targets
diff --git a/build.rs b/build.rs index 57f72b7..2557120 100644 --- a/build.rs +++ b/build.rs @@ -80,7 +80,8 @@ fn is_big_endian() -> bool { // disabled by old compilers.) fn is_windows_msvc() -> bool { // Some targets are only two components long, so check in steps. - target_components()[1] == "pc" + let s...
1
4
2
a12fa7b8a4131d77c35eda5c680b9307a0fc28d3
Jack O'Connor
2025-02-06T19:04:10
remove checks that memmap2 does internally
diff --git a/Cargo.toml b/Cargo.toml index f1a1337..aec25a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ readme = "README.md" edition = "2021" [features] -default = ["std"] +default = ["std", "mmap"] # The NEON implementation does not participate in dynamic feature detection, # which is currently ...
2
4
19
96d90e67d077c4636ef6e792b82b3e11edaefbc6
Jack O'Connor
2025-02-04T00:56:36
replace a couple deprecated functions in benchmarks
diff --git a/benches/bench.rs b/benches/bench.rs index 3c32e51..dd9f498 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -27,7 +27,7 @@ impl RandomInput { b.bytes += len as u64; let page_size: usize = page_size::get(); let mut buf = vec![0u8; len + page_size]; - let mut rng = ra...
2
2
2
720eac9b52ac117cbc3d7adc87ef192ea1bf5ab6
Jack O'Connor
2025-02-04T00:43:30
upgrade rand to v0.9
diff --git a/Cargo.toml b/Cargo.toml index 8b1ff7f..f1a1337 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,8 +118,8 @@ zeroize = { version = "1", default-features = false, optional = true } hmac = "0.12.0" hex = "0.4.2" page_size = "0.6.0" -rand = "0.8.0" -rand_chacha = "0.3.0" +rand = "0.9.0" +rand_chacha = "0.9....
4
9
9
5c8b350b3531102359b89e9f0a3367e6de4a43f4
Jack O'Connor
2024-11-27T02:38:04
another Windows-style newlines test
diff --git a/b3sum/tests/cli_tests.rs b/b3sum/tests/cli_tests.rs index f501ca6..cd48ac7 100644 --- a/b3sum/tests/cli_tests.rs +++ b/b3sum/tests/cli_tests.rs @@ -419,6 +419,24 @@ fn test_check() { assert_eq!(expected_check_output, stdout); assert_eq!("", stderr); + // Check the same file, but with Windows...
1
18
0
c57d6b6ac25a08360f0adf82f7bbe87156a5fec0
Jack O'Connor
2024-11-27T01:56:34
add back an explicit "digest" feature, for back compat
diff --git a/Cargo.toml b/Cargo.toml index c5f8c99..e60b8d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,6 +55,15 @@ traits-preview = ["dep:digest"] # The following features are mainly intended for testing and benchmarking, and # they might change or disappear at any time without a major version bump. +# It wasn...
1
9
0
1170f023bf459ea3d0bedd285d6ae32309ee348c
Jack O'Connor
2024-11-25T21:37:52
add support for windows newlines in b3sum --check Fixes #222.
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 5cb9cfb..9363a7b 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89f...
4
96
144
95da6b5f4a04e694cf7a15a1c399cfba5fa66205
Jack O'Connor
2024-09-04T16:42:08
add xof benchmarks for non-power-of-2 lengths
diff --git a/benches/bench.rs b/benches/bench.rs index 4169ea7..3c32e51 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -526,7 +526,7 @@ fn bench_xof(b: &mut Bencher, len: usize) { #[bench] fn bench_xof_01_block(b: &mut Bencher) { - bench_xof(b, BLOCK_LEN); + bench_xof(b, 1 * BLOCK_LEN); } #[bench...
1
56
1
8e2e07e0222851a7f071eee9ffaca4c17fb7872c
Aaron Feickert
2024-08-22T18:15:24
Remove Miri equality workaround function
diff --git a/Cargo.toml b/Cargo.toml index 8531305..c5f8c99 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,7 @@ features = ["mmap", "rayon", "serde", "zeroize"] [dependencies] arrayref = "0.3.5" arrayvec = { version = "0.7.4", default-features = false } -constant_time_eq = "0.3.0" +constant_time_eq = { versio...
2
1
25
08cb01cfc60d592d7c9d098a7fddd169416596e0
Jack O'Connor
2024-08-22T18:18:27
put equivalent Hasher examples in the hash/keyed_hash/derive_key docs This was a good suggestion by @dhardy: https://github.com/rust-random/rand/issues/989#issuecomment-2303969094
diff --git a/src/lib.rs b/src/lib.rs index 9309249..52a7b42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -904,8 +904,17 @@ fn hash_all_at_once<J: join::Join>(input: &[u8], key: &CVWords, flags: u8) -> Ou /// The default hash function. /// -/// For an incremental version that accepts multiple writes, see -/// [`Hashe...
1
42
8
479eef82d756221abe9f93077b91ce8cf763c32a
Jack O'Connor
2024-08-19T18:10:11
test_compare_reference_impl_long_xof
diff --git a/src/test.rs b/src/test.rs index bb99d10..a7ac4fc 100644 --- a/src/test.rs +++ b/src/test.rs @@ -443,6 +443,21 @@ fn test_compare_reference_impl() { } } +#[test] +fn test_compare_reference_impl_long_xof() { + let mut reference_output = [0u8; 32 * BLOCK_LEN - 1]; + let mut reference_hasher = re...
1
15
0
ae4483cbf248f3b4caf9621e6f13f3f878fc7485
Jack O'Connor
2024-08-19T17:18:55
update b3sum/Cargo.lock
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 315be0f..2300573 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9...
1
60
63
4386d7f0baae5cf77e319f12256bd7c91fedc1ef
Jack O'Connor
2024-08-18T17:51:51
small cleanup in fill_one_block
diff --git a/src/lib.rs b/src/lib.rs index 7239edb..9309249 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1634,19 +1634,21 @@ impl OutputReader { } } - // It would be more natural if this helper took &mut &mut [u8], but that doesn't seem to be allowed. - fn fill_one_block<'a>(&mut self, mut buf: &'...
1
12
9
0fc4049e9385c7752859cbf901b48719cf0c9712
Jack O'Connor
2024-08-18T17:50:58
debug_assert that xof_many is always called with whole blocks
diff --git a/src/ffi_avx512.rs b/src/ffi_avx512.rs index 6794774..afa0221 100644 --- a/src/ffi_avx512.rs +++ b/src/ffi_avx512.rs @@ -70,6 +70,7 @@ pub unsafe fn xof_many( flags: u8, out: &mut [u8], ) { + debug_assert_eq!(0, out.len() % BLOCK_LEN, "whole blocks only"); ffi::blake3_xof_many_avx512( ...
3
3
0
bb2c530bb04786a53d51442b74880775bf92e37c
Jack O'Connor
2024-08-15T23:12:33
fix a warning in the blake3_c_rust_bindings tests
diff --git a/c/blake3_c_rust_bindings/src/test.rs b/c/blake3_c_rust_bindings/src/test.rs index e6baff1..ec11219 100644 --- a/c/blake3_c_rust_bindings/src/test.rs +++ b/c/blake3_c_rust_bindings/src/test.rs @@ -378,7 +378,6 @@ pub fn test_xof_many_fn(xof_many_function: XofManyFunction) { // when you're supposed to...
1
0
1
eb15bce0f1443b07fc45f151a72c840c19c4b2ae
Jack O'Connor
2023-05-28T20:02:48
test_fuzz_xof
diff --git a/src/test.rs b/src/test.rs index 39dfe46..6ce2e50 100644 --- a/src/test.rs +++ b/src/test.rs @@ -519,6 +519,42 @@ fn test_fuzz_hasher() { } } +#[test] +fn test_fuzz_xof() { + let mut input_buf = [0u8; 3 * BLOCK_LEN]; + paint_test_input(&mut input_buf); + + // Don't do too many iterations in...
1
36
0
cfb305d0ab8e20d40a555f5241e29e0f5db06917
Jack O'Connor
2023-05-28T19:24:45
add XOF benchmarks
diff --git a/benches/bench.rs b/benches/bench.rs index 5efb9e6..4169ea7 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -515,3 +515,46 @@ fn bench_two_updates(b: &mut Bencher) { hasher.finalize() }); } + +fn bench_xof(b: &mut Bencher, len: usize) { + b.bytes = len as u64; + let mut output =...
1
43
0
99d342a1eb0363bf0b3f6a96c0017dc4f4d1011d
Jack O'Connor
2024-08-15T20:20:39
update our required version of `cc` Fixes https://github.com/BLAKE3-team/BLAKE3/issues/416.
diff --git a/Cargo.toml b/Cargo.toml index 41bb1ff..78c05ca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -117,4 +117,4 @@ serde_json = "1.0.107" ciborium = "0.2.2" [build-dependencies] -cc = "1.0.4" +cc = "1.1.12"
1
1
1
d94882d66d060fb035b3cb7199011b6577bb99ee
Maksim Bondarenkov
2024-07-14T04:50:32
build(windows): add support for gnullvm targets
diff --git a/build.rs b/build.rs index af5805d..57f72b7 100644 --- a/build.rs +++ b/build.rs @@ -74,7 +74,7 @@ fn is_big_endian() -> bool { endianness() == "big" } -// Windows targets may be using the MSVC toolchain or the GNU toolchain. The +// Windows targets may be using the MSVC toolchain or the MinGW toolc...
1
6
2
84a4ec319a69682bb84efdcfd3ab376a310d4f6e
Gard Kylling
2024-07-08T07:54:05
Manually implement `Zeroize` Removes dependence on proc-macros when enabling the zeroize feature.
diff --git a/Cargo.toml b/Cargo.toml index 3235400..41bb1ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ digest = { version = "0.10.1", features = [ "mac" ], optional = true } memmap2 = { version = "0.9", optional = true } rayon-core = { version = "1.12.1", optional = true } serde = { version = "1.0"...
2
86
8
39e962e2bddf00a1786755c43c095c25b3b73a93
Benjamin A. Beasley
2024-07-15T15:29:02
Update the license field in b3sum/Cargo.toml
diff --git a/b3sum/Cargo.toml b/b3sum/Cargo.toml index 1ca9810..8aa63ee 100644 --- a/b3sum/Cargo.toml +++ b/b3sum/Cargo.toml @@ -4,7 +4,7 @@ version = "1.5.3" authors = ["Jack O'Connor <oconnor663@gmail.com>"] description = "a command line implementation of the BLAKE3 hash function" repository = "https://github.com/...
1
1
1
2ce9b51993b8054829a3246ec0caec27fb76fc74
Jack O'Connor
2024-07-15T04:54:30
update Cargo.lock
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 2ee0e94..153424e 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -104,9 +104,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.1" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907d858136076...
1
2
2
43ce639d136a41289595749710212ef4f67f5f7f
Jack O'Connor
2024-07-15T02:27:37
Revert "serialize Hash with serde_bytes" This mostly reverts commits 8416b1658c2690dc6351bdc7e0975b0d5f1a5282 and dd0afd640ad97b5ebcf887107162009a23ffdca0. Changing the serialization of Hash can only be backwards-compatible in self-describing formats like CBOR. In non-self-describing formats like bincode, the deseria...
diff --git a/Cargo.toml b/Cargo.toml index 0d304a4..71ac872 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,6 @@ mmap = ["std", "dep:memmap2"] # Implement the zeroize::Zeroize trait for types in this crate. zeroize = ["dep:zeroize", "arrayvec/zeroize"] -serde = ["dep:serde", "dep:serde_bytes"] - # This crate...
3
17
22
0c456b7f49a133462f9fe7094be0b43a70cd3fc4
Jack O'Connor
2024-07-12T16:40:56
update b3sum/Cargo.lock
diff --git a/b3sum/Cargo.lock b/b3sum/Cargo.lock index 4302772..9f1ca42 100644 --- a/b3sum/Cargo.lock +++ b/b3sum/Cargo.lock @@ -4,47 +4,48 @@ version = 3 [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe...
1
90
76
eaf7eb97bfd50ff7ca43d5b78007da0f457e8565
Michael Hinton
2024-07-11T19:02:32
Do not let cc-rs trigger a rebuild any time the env changes
diff --git a/build.rs b/build.rs index 886ff95..af5805d 100644 --- a/build.rs +++ b/build.rs @@ -97,6 +97,11 @@ fn new_build() -> cc::Build { if !is_windows_msvc() { build.flag("-std=c11"); } + // Do NOT trigger a rebuild any time the env changes (e.g. $PATH). + // This prevents all downstream ...
1
5
0
8416b1658c2690dc6351bdc7e0975b0d5f1a5282
Jack O'Connor
2024-07-10T17:00:17
update CBOR tests per @BurningEnlightenment's suggestions https://github.com/BLAKE3-team/BLAKE3/issues/412#issuecomment-2220970998
diff --git a/src/test.rs b/src/test.rs index b5bd4dc..9f73417 100644 --- a/src/test.rs +++ b/src/test.rs @@ -809,12 +809,14 @@ fn test_mmap_rayon() -> Result<(), std::io::Error> { #[cfg(feature = "std")] #[cfg(feature = "serde")] fn test_serde() { - let hash: crate::Hash = [255; 32].into(); + // Henrik suggest...
1
13
9
dd0afd640ad97b5ebcf887107162009a23ffdca0
Jack O'Connor
2024-07-10T02:13:32
serialize Hash with serde_bytes Closes #412.
diff --git a/Cargo.toml b/Cargo.toml index 036a39b..3ce2454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,8 @@ mmap = ["std", "dep:memmap2"] # Implement the zeroize::Zeroize trait for types in this crate. zeroize = ["dep:zeroize", "arrayvec/zeroize"] +serde = ["dep:serde", "dep:serde_bytes"] + # This crate...
3
37
4
4b3fdf51e404f0964b458fb2df4014982d3c5890
Jack O'Connor
2024-07-03T16:19:34
add a comment about depending on rayon-core
diff --git a/Cargo.toml b/Cargo.toml index eee0712..036a39b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,9 @@ std = [] # `update_rayon` and (in combination with `mmap` below) `update_mmap_rayon` # methods, for multithreaded hashing. However, even if this feature is enabled, # all other APIs remain single-th...
1
3
0
648a06043a6c29bc34c7bc68384054b75340ec88
silvanshade
2024-06-18T21:07:41
Switch to rayon-core for faster build
diff --git a/Cargo.toml b/Cargo.toml index 7011213..eee0712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ std = [] # `update_rayon` and (in combination with `mmap` below) `update_mmap_rayon` # methods, for multithreaded hashing. However, even if this feature is enabled, # all other APIs remain single-th...
5
7
23
454ee5a7c73583cb3060d1464a5d3a4e65f06062
Jack O'Connor
2024-06-01T18:47:20
add check-cfg directives in build.rs to silence nightly warnings See https://blog.rust-lang.org/2024/05/06/check-cfg.html.
diff --git a/build.rs b/build.rs index a5dfd06..886ff95 100644 --- a/build.rs +++ b/build.rs @@ -240,6 +240,23 @@ fn build_neon_c_intrinsics() { } fn main() -> Result<(), Box<dyn std::error::Error>> { + // As of Rust 1.80, unrecognized config names are warnings. Give Cargo all of our config names. + let all_c...
1
17
0
b5c6017ea74d7a8be302aefd710dd801c91088a2
Jack O'Connor
2024-06-01T18:10:23
update the license field in Cargo.toml
diff --git a/Cargo.toml b/Cargo.toml index 55eb8a4..7011213 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "1.5.1" authors = ["Jack O'Connor <oconnor663@gmail.com>", "Samuel Neves"] description = "the BLAKE3 hash function" repository = "https://github.com/BLAKE3-team/BLAKE3" -license = "CC0-1.0 O...
1
1
1
4ec3be8bfa6574fcd30619741390847ddc037d55
Jack O'Connor
2024-03-20T22:44:05
format the state matrix better in reference_impl.rs
diff --git a/reference_impl/reference_impl.rs b/reference_impl/reference_impl.rs index 72ad525..bc61383 100644 --- a/reference_impl/reference_impl.rs +++ b/reference_impl/reference_impl.rs @@ -78,23 +78,14 @@ fn compress( block_len: u32, flags: u32, ) -> [u32; 16] { + let counter_low = counter as u32; + ...
1
7
16
d57818afdcf9715aafb1eaf30a34c6fffdb6eed0
Jack O'Connor
2024-03-10T00:20:03
avoid using NamedTempFile under Miri
diff --git a/src/test.rs b/src/test.rs index fb1e849..2744d90 100644 --- a/src/test.rs +++ b/src/test.rs @@ -695,16 +695,10 @@ fn test_zeroize() { fn test_update_reader() -> Result<(), std::io::Error> { // This is a brief test, since update_reader() is mostly a wrapper around update(), which already // has s...
1
5
7
2435e29dbe57724ab3ae02fc5ea2a9cb83009f89
Jack O'Connor
2024-03-09T23:56:45
avoid using constant_time_eq under Miri
diff --git a/src/lib.rs b/src/lib.rs index 1fe47bf..d661cb2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -305,10 +305,28 @@ impl core::str::FromStr for Hash { } } +// A proper implementation of constant time equality is tricky, and we get it from the +// constant_time_eq crate instead of rolling our own. However...
1
24
0
e6e7f27336a9f21cb6d0f64ebf0d755bf0db0d3a
Ryo Onodera
2024-03-07T15:01:48
Support running inside miri
diff --git a/src/platform.rs b/src/platform.rs index ef910aa..79bc9a3 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -56,6 +56,11 @@ pub enum Platform { impl Platform { #[allow(unreachable_code)] pub fn detect() -> Self { + #[cfg(miri)] + { + return Platform::Portable; + ...
1
21
0
5558fa46239742720d84c46edb0544732adf4db8
Jack O'Connor
2024-01-22T04:09:53
add a guts docs example
diff --git a/rust/guts/src/lib.rs b/rust/guts/src/lib.rs index 3760fa8..e9b4914 100644 --- a/rust/guts/src/lib.rs +++ b/rust/guts/src/lib.rs @@ -1,3 +1,44 @@ +//! # The BLAKE3 Guts API +//! +//! See `readme.md`. +//! +//! The main entrypoint into this crate is [`DETECTED_IMPL`], which is a global [`Implementation`] +//...
1
41
0
6e519ea6b7e157ef1da89e39b660fe2aab8f6dcf
Jack O'Connor
2024-01-22T01:54:09
configure no_std for guts, but not for testing
diff --git a/rust/guts/src/lib.rs b/rust/guts/src/lib.rs index 67f7a05..3760fa8 100644 --- a/rust/guts/src/lib.rs +++ b/rust/guts/src/lib.rs @@ -1,3 +1,6 @@ +// Tests always require libstd. +#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] + use core::cmp; use core::marker::PhantomData; use core::mem;
1
3
0
6f3e6fc86c21a04e89791f6b6930a34f0b66bc6c
Jack O'Connor
2024-01-22T02:25:26
update memmap2 to v0.9
diff --git a/Cargo.toml b/Cargo.toml index a98cb6a..591a6e3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -97,7 +97,7 @@ arrayvec = { version = "0.7.4", default-features = false } constant_time_eq = "0.3.0" cfg-if = "1.0.0" digest = { version = "0.10.1", features = [ "mac" ], optional = true } -memmap2 = { version = "...
3
145
121
3d921ae703a492d7449228d29990c8bc9e768c40
Jack O'Connor
2023-10-02T15:36:29
allow(unreachable_code) in all the *_detected functions Previously we only disabled these warnings for SSE2, which is assumed enabled on x86-64, but it looks like new nightly compilers are also assuming SSE4.1 on macOS. Disabling these warnings across all the detection functions accounts for that, and it also gets rid...
diff --git a/src/platform.rs b/src/platform.rs index 00058b1..ef910aa 100644 --- a/src/platform.rs +++ b/src/platform.rs @@ -327,6 +327,7 @@ impl Platform { #[cfg(blake3_avx512_ffi)] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] #[inline(always)] +#[allow(unreachable_code)] pub fn avx512_detected() -> bo...
1
3
0
5e3eb949a78f767a5a458022afedeb3e66398659
Ralph Minderhoud
2023-09-09T16:15:51
Add serde support for Hash behind optional feature Added a new cargo feature `serde` that when enabled will derive `serde::Serialize` and `serde::Deserialize` for the `blake3::Hash` struct.
diff --git a/Cargo.toml b/Cargo.toml index d92fc6e..c3596eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,11 +95,12 @@ features = ["mmap", "rayon", "zeroize"] arrayref = "0.3.5" arrayvec = { version = "0.7.4", default-features = false } constant_time_eq = "0.3.0" -rayon = { version = "1.2.1", optional = true } cf...
2
7
2
4e25f2e094312b11cb9fa28305774696eb046058
Jack O'Connor
2023-09-20T00:15:17
don't default to NEON intrinsics in build.rs for big-endian targets
diff --git a/build.rs b/build.rs index ac1d6a6..a5dfd06 100644 --- a/build.rs +++ b/build.rs @@ -60,6 +60,20 @@ fn is_armv7() -> bool { target_components()[0] == "armv7" } +fn endianness() -> String { + let endianness = env::var("CARGO_CFG_TARGET_ENDIAN").unwrap(); + assert!(endianness == "little" || endi...
1
21
1
8cdfaa41ea5b1a0a11b0bf3b52fba60320f437f1
Jack O'Connor
2023-09-19T19:47:27
minor cleanup in Hasher docs
diff --git a/src/lib.rs b/src/lib.rs index 5b03ff9..5063b58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -922,12 +922,6 @@ fn parent_node_output( /// An incremental hash state that can accept any number of writes. /// -/// **Performance note:** The [`update`](#method.update) method can't take full -/// advantage of ...
1
9
23
b754033a2187c509ee1b29facea31ae13d122904
Jack O'Connor
2023-09-17T02:17:58
make update_reader/mmap/mmap_rayon return self This makes them consistent with how the existing update() and update_rayon() methods work, with the difference being that it's it's io::Result<&mut Self> instead of just &mut Self.
diff --git a/src/lib.rs b/src/lib.rs index 1a2d22d..5b03ff9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1346,8 +1346,9 @@ impl Hasher { /// # } /// ``` #[cfg(feature = "std")] - pub fn update_reader(&mut self, reader: impl std::io::Read) -> std::io::Result<u64> { - io::copy_wide(reader, self) ...
2
28
15
e0bb91564125407102af81e219399025aa2c24b9
Banyc
2023-07-17T16:48:52
move file operations from b3sum to blake3
diff --git a/Cargo.toml b/Cargo.toml index e9ab95e..74aed30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,6 +81,8 @@ no_avx2 = [] no_avx512 = [] no_neon = [] +file = ["memmap2", "rayon", "std"] + [package.metadata.docs.rs] # Document Hasher::update_rayon on docs.rs. features = ["rayon", "zeroize"] @@ -93,6 +95...
6
101
56
12b368541f917d69b6169a4d895e206144acd44f
Jack O'Connor
2023-09-16T21:11:27
document the `zeroize` Cargo feature As part of this change, I don't think we need the `zeroize_crate` workaround anymore if we use the relateively new `dep:` syntax in Cargo.toml.
diff --git a/Cargo.toml b/Cargo.toml index b0c7882..e9ab95e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,10 @@ std = [] # The "rayon" feature (defined below as an optional dependency) enables the # `Hasher::update_rayon` method, for multithreaded hashing. However, even if # this feature is enabled, all othe...
2
9
8
02dec6e9a655348995a35cb0de81edeb955cfc8d
Jack O'Connor
2023-09-10T21:04:57
fix a build break in the blake3_c tests
diff --git a/c/blake3_c_rust_bindings/src/test.rs b/c/blake3_c_rust_bindings/src/test.rs index 1fc077c..0730d93 100644 --- a/c/blake3_c_rust_bindings/src/test.rs +++ b/c/blake3_c_rust_bindings/src/test.rs @@ -485,7 +485,7 @@ fn test_fuzz_hasher() { let mut total_input = 0; // For each test, write 3 in...
1
1
1
d6265dafc9366d59de273a831339dafe0058ceb7
Jack O'Connor
2023-09-10T20:40:12
update dev-dependencies
diff --git a/Cargo.toml b/Cargo.toml index e05bd1a..b0c7882 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ zeroize_crate = { package = "zeroize", version = "1", default-features = false, [dev-dependencies] hex = "0.4.2" -page_size = "0.5.0" +page_size = "0.6.0" rand = "0.8.0" rand_chacha = "0.3.0" re...
3
67
149
e302cdf36f1a8f3b9833b151c6c57964053cd587
Elichai Turkel
2023-07-09T16:34:55
Remove unneeded digest/std in std feature
diff --git a/Cargo.toml b/Cargo.toml index 7c2e7a3..e05bd1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ neon = [] # --no-default-features, 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.g. RUSTFLAGS...
1
1
1
8e92fc6929a984508fc542b99bac302439cba0fb
Elichai Turkel
2023-06-06T15:06:17
Implement Zeroize on exported types
diff --git a/Cargo.toml b/Cargo.toml index 8df1387..7c2e7a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -77,17 +77,20 @@ no_avx2 = [] no_avx512 = [] no_neon = [] +zeroize = ["zeroize_crate", "arrayvec/zeroize"] + [package.metadata.docs.rs] # Document Hasher::update_rayon on docs.rs. features = ["rayon"] [depe...
2
15
1