1
0
Fork 0
mirror of https://github.com/BLAKE3-team/BLAKE3 synced 2024-05-28 05:26:04 +02:00

fix b3sum and test_vectors tests

This commit is contained in:
Jack O'Connor 2023-07-10 01:18:15 -07:00
parent dbaca7518b
commit c66bff9369
6 changed files with 15 additions and 10 deletions

View File

@ -85,7 +85,6 @@ features = ["rayon"]
[dependencies]
arrayvec = { version = "0.7.4", default-features = false }
atomic = { version = "0.5.3", default-features = false }
blake3_guts = { path = "rust/blake3_guts" }
constant_time_eq = "0.3.0"
rayon = { version = "1.2.1", optional = true }

16
b3sum/Cargo.lock generated
View File

@ -57,12 +57,6 @@ version = "1.0.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8"
[[package]]
name = "arrayref"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545"
[[package]]
name = "arrayvec"
version = "0.7.4"
@ -81,6 +75,7 @@ version = "1.4.1"
dependencies = [
"anyhow",
"blake3",
"blake3_guts",
"clap",
"duct",
"hex",
@ -106,8 +101,8 @@ checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42"
name = "blake3"
version = "1.4.1"
dependencies = [
"arrayref",
"arrayvec",
"blake3_guts",
"cc",
"cfg-if",
"constant_time_eq",
@ -115,6 +110,13 @@ dependencies = [
"rayon",
]
[[package]]
name = "blake3_guts"
version = "0.0.0"
dependencies = [
"cfg-if",
]
[[package]]
name = "block-buffer"
version = "0.10.4"

View File

@ -16,6 +16,7 @@ pure = ["blake3/pure"]
[dependencies]
anyhow = "1.0.25"
blake3 = { version = "1", path = "..", features = ["rayon"] }
blake3_guts = { path = "../rust/blake3_guts" }
clap = { version = "4.0.8", features = ["derive", "wrap_help"] }
hex = "0.4.0"
memmap2 = "0.7.0"

View File

@ -1,4 +1,5 @@
use anyhow::{bail, ensure, Result};
use blake3_guts as guts;
use clap::Parser;
use std::cmp;
use std::fs::File;
@ -289,7 +290,7 @@ fn write_hex_output(mut output: blake3::OutputReader, args: &Args) -> Result<()>
// TODO: This computes each output block twice when the --seek argument isn't a multiple of 64.
// We'll refactor all of this soon anyway, once SIMD optimizations are available for the XOF.
let mut len = args.len();
let mut block = [0; blake3::guts::BLOCK_LEN];
let mut block = [0; guts::BLOCK_LEN];
while len > 0 {
output.fill(&mut block);
let hex_str = hex::encode(&block[..]);

View File

@ -12,6 +12,7 @@ pure = ["blake3/pure"]
# If you ever change these path dependencies, you'll probably need to update
# cross_test.sh, or CI will break. I'm sorry >.<
blake3 = { path = "../" }
blake3_guts = { path = "../rust/blake3_guts" }
hex = "0.4.0"
reference_impl = { path = "../reference_impl" }
serde = { version = "1.0", features = ["derive"] }

View File

@ -1,4 +1,5 @@
use blake3::guts::{BLOCK_LEN, CHUNK_LEN};
use blake3_guts as guts;
use guts::{BLOCK_LEN, CHUNK_LEN};
use serde::{Deserialize, Serialize};
// A non-multiple of 4 is important, since one possible bug is to fail to emit