Skip to content

Commit

Permalink
update sha3(keccak)
Browse files Browse the repository at this point in the history
  • Loading branch information
wakiyamap committed Jun 29, 2024
1 parent 88b0ff3 commit ebf35d7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 18 deletions.
36 changes: 23 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ keywords = ["lyra2", "Lyra2RE", "Lyra2REv2", "Lyra2REv3"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
sha3 = "0.9.1"
sha3 = "0.10.8"
blake-hash = "0.4.1"
groestl = "0.10.1"
byteorder = { version = "1.3.4", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions src/lyra2re.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::lyra2;
use digest::generic_array::typenum::U32;
use blake_hash::Digest as BlakeDigest;
use groestl::Digest;
use sha3::Digest;

/// Returns the calculation result of lyra2re.
/// # Examples
Expand All @@ -23,7 +23,7 @@ use groestl::Digest;
pub fn sum(input: Vec<u8>) -> Vec<u8> {
let result_blake = blake_hash::Blake256::digest(&input).to_vec();

let result_keccak256_1 = sha3::Keccak256::digest(&result_blake).to_vec();
let result_keccak256_1 = sha3::Keccak256::digest(result_blake).to_vec();

let result_keccak256_2 = result_keccak256_1.clone();

Expand Down
5 changes: 3 additions & 2 deletions src/lyra2rev2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use crate::bmw;
use crate::cubehash;
use crate::lyra2;
use digest::generic_array::typenum::U32;
use blake_hash::Digest;
use blake_hash::Digest as BlakeDigest;
use sha3::Digest;

/// Returns the calculation result of lyra2rev2.
/// # Examples
Expand All @@ -24,7 +25,7 @@ use blake_hash::Digest;
pub fn sum(input: Vec<u8>) -> Vec<u8> {
let result_blake = blake_hash::Blake256::digest(&input).to_vec();

let result_keccak256 = sha3::Keccak256::digest(&result_blake);
let result_keccak256 = sha3::Keccak256::digest(result_blake);

let result_cube = cubehash::sum(result_keccak256.to_vec());

Expand Down

0 comments on commit ebf35d7

Please sign in to comment.