add WHIRLPOOL
This commit is contained in:
@@ -13,6 +13,7 @@ use std::{
|
|||||||
use crypto::{
|
use crypto::{
|
||||||
digest::Digest,
|
digest::Digest,
|
||||||
ripemd160::Ripemd160,
|
ripemd160::Ripemd160,
|
||||||
|
whirlpool::Whirlpool,
|
||||||
md5::Md5,
|
md5::Md5,
|
||||||
sha1::Sha1,
|
sha1::Sha1,
|
||||||
sha2::{
|
sha2::{
|
||||||
@@ -125,13 +126,15 @@ Written by Hatter Jiang
|
|||||||
Supported algorithms:
|
Supported algorithms:
|
||||||
MD5, SHA1, SHA224, SHA256, SHA512, SHA512-224, SHA512-256,
|
MD5, SHA1, SHA224, SHA256, SHA512, SHA512-224, SHA512-256,
|
||||||
SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE-128, SHAKE-256,
|
SHA3-224, SHA3-256, SHA3-384, SHA3-512, SHAKE-128, SHAKE-256,
|
||||||
KECCAK-224, KECCAK-256, KECCAK-384, KECCAK-512, SM3, RIPEMD160
|
KECCAK-224, KECCAK-256, KECCAK-384, KECCAK-512,
|
||||||
|
SM3, RIPEMD160, WHIRLPOOL
|
||||||
"#, VERSION, &GIT_HASH[0..7]);
|
"#, VERSION, &GIT_HASH[0..7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_digest_by_algorithm(algo: &str) -> Option<Box<dyn Digest>> {
|
fn get_digest_by_algorithm(algo: &str) -> Option<Box<dyn Digest>> {
|
||||||
match algo {
|
match algo {
|
||||||
"RIPEMD160" => Some(Box::new(Ripemd160::new())),
|
"RIPEMD160" => Some(Box::new(Ripemd160::new())),
|
||||||
|
"WHIRLPOOL" => Some(Box::new(Whirlpool::new())),
|
||||||
"MD5" => Some(Box::new(Md5::new())),
|
"MD5" => Some(Box::new(Md5::new())),
|
||||||
"SHA1" | "SHA-1" => Some(Box::new(Sha1::new())),
|
"SHA1" | "SHA-1" => Some(Box::new(Sha1::new())),
|
||||||
"SHA224" | "SHA-224" => Some(Box::new(Sha224::new())),
|
"SHA224" | "SHA-224" => Some(Box::new(Sha224::new())),
|
||||||
|
|||||||
Reference in New Issue
Block a user