Add SHA224, SHA512, SHA512-256 tests
This commit is contained in:
parent
2f73d3148a
commit
ea5b399487
|
|
@ -437,6 +437,18 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sha224() {
|
||||
let tests = [(
|
||||
"616263",
|
||||
"23097d223405d8228642a477bda255b32aadbce4bda0b3f7e36c9da7",
|
||||
)];
|
||||
|
||||
for test in tests.iter() {
|
||||
hash_test(MessageDigest::sha224(), test);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sha256() {
|
||||
let tests = [(
|
||||
|
|
@ -449,6 +461,31 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sha512() {
|
||||
let tests = [(
|
||||
"616263",
|
||||
"ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2\
|
||||
192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f",
|
||||
)];
|
||||
|
||||
for test in tests.iter() {
|
||||
hash_test(MessageDigest::sha512(), test);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sha512_256() {
|
||||
let tests = [(
|
||||
"616263",
|
||||
"53048e2681941ef99b2e29b76b4c7dabe4c2d0c634fc6d46e0e2f13107e7af23",
|
||||
)];
|
||||
|
||||
for test in tests.iter() {
|
||||
hash_test(MessageDigest::sha512_256(), test);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn from_nid() {
|
||||
assert_eq!(
|
||||
|
|
|
|||
Loading…
Reference in New Issue