diff --git a/Cargo.lock b/Cargo.lock index 8267240..f3969f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,6 +85,18 @@ dependencies = [ "password-hash", ] +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "ascon" version = "0.3.1" @@ -205,6 +217,20 @@ dependencies = [ "digest", ] +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "digest", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -319,6 +345,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "core-foundation" version = "0.9.4" @@ -1155,7 +1187,7 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustgenhash" -version = "0.9.3" +version = "0.9.4" dependencies = [ "argon2", "ascon-hash", @@ -1164,6 +1196,7 @@ dependencies = [ "bcrypt-pbkdf", "belt-hash", "blake2", + "blake3", "clap", "clap_complete", "digest", diff --git a/Cargo.toml b/Cargo.toml index 73bd400..f2f481f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rustgenhash" -version = "0.9.3" +version = "0.9.4" license = "MIT" authors = ["Volker Schwaberow "] description = "A tool to generate hashes from the command line." @@ -35,6 +35,7 @@ base64 = "0.13.0" bcrypt-pbkdf = "0.9.0" belt-hash = "0.1.0" blake2 = "0.10.4" +blake3 = { version = "1.5.0", features = ["traits-preview"] } clap = { version = "4.0.10", features = ["derive", "cargo"] } clap_complete = "4.0.2" digest = { version = "0.10.5", features = ["std"] } diff --git a/src/rgh/app.rs b/src/rgh/app.rs index b4caee5..4695b5b 100644 --- a/src/rgh/app.rs +++ b/src/rgh/app.rs @@ -39,6 +39,7 @@ pub enum Algorithm { Belthash, Blake2b, Blake2s, + Blake3, Fsb160, Fsb224, Fsb256, diff --git a/src/rgh/hash.rs b/src/rgh/hash.rs index 16bdf5a..da6da09 100644 --- a/src/rgh/hash.rs +++ b/src/rgh/hash.rs @@ -154,6 +154,7 @@ impl RHash { "BELTHASH" => Box::new(belt_hash::BeltHash::new()), "BLAKE2B" => Box::new(blake2::Blake2b512::new()), "BLAKE2S" => Box::new(blake2::Blake2s256::new()), + "BLAKE3" => Box::new(blake3::Hasher::new()), "FSB160" => Box::new(fsb::Fsb160::new()), "FSB224" => Box::new(fsb::Fsb224::new()), "FSB256" => Box::new(fsb::Fsb256::new()), @@ -301,4 +302,3 @@ impl RHash { } } } -