core/crypto/blake: Remove, use BLAKE2b/BLAKE2s

This commit is contained in:
Yawning Angel
2023-11-17 19:31:51 +09:00
parent 41fdcfeecf
commit 44c8da7bf2
4 changed files with 0 additions and 790 deletions
-61
View File
@@ -26,7 +26,6 @@ import "core:crypto/keccak"
import "core:crypto/shake"
import "core:crypto/whirlpool"
import "core:crypto/ripemd"
import "core:crypto/blake"
import "core:crypto/blake2b"
import "core:crypto/blake2s"
import "core:crypto/tiger"
@@ -86,10 +85,6 @@ main :: proc() {
test_gost(&t)
test_streebog_256(&t)
test_streebog_512(&t)
test_blake_224(&t)
test_blake_256(&t)
test_blake_384(&t)
test_blake_512(&t)
test_blake2b(&t)
test_blake2s(&t)
test_ripemd_128(&t)
@@ -571,62 +566,6 @@ test_streebog_512 :: proc(t: ^testing.T) {
}
}
@(test)
test_blake_224 :: proc(t: ^testing.T) {
test_vectors := [?]TestHash {
TestHash{"7dc5313b1c04512a174bd6503b89607aecbee0903d40a8a569c94eed", ""},
TestHash{"304c27fdbf308aea06955e331adc6814223a21fccd24c09fde9eda7b", "ube"},
TestHash{"cfb6848add73e1cb47994c4765df33b8f973702705a30a71fe4747a3", "BLAKE"},
}
for v, _ in test_vectors {
computed := blake.hash_224(v.str)
computed_str := hex_string(computed[:])
expect(t, computed_str == v.hash, fmt.tprintf("Expected: %s for input of %s, but got %s instead", v.hash, v.str, computed_str))
}
}
@(test)
test_blake_256 :: proc(t: ^testing.T) {
test_vectors := [?]TestHash {
TestHash{"716f6e863f744b9ac22c97ec7b76ea5f5908bc5b2f67c61510bfc4751384ea7a", ""},
TestHash{"e802fe2a73fbe5853408f051d040aeb3a76a4d7a0fc5c3415d1af090f76a2c81", "ube"},
TestHash{"07663e00cf96fbc136cf7b1ee099c95346ba3920893d18cc8851f22ee2e36aa6", "BLAKE"},
}
for v, _ in test_vectors {
computed := blake.hash_256(v.str)
computed_str := hex_string(computed[:])
expect(t, computed_str == v.hash, fmt.tprintf("Expected: %s for input of %s, but got %s instead", v.hash, v.str, computed_str))
}
}
@(test)
test_blake_384 :: proc(t: ^testing.T) {
test_vectors := [?]TestHash {
TestHash{"c6cbd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706", ""},
TestHash{"8f22f120b2b99dd4fd32b98c8c83bd87abd6413f7317be936b1997511247fc68ae781c6f42113224ccbc1567b0e88593", "ube"},
TestHash{"f28742f7243990875d07e6afcff962edabdf7e9d19ddea6eae31d094c7fa6d9b00c8213a02ddf1e2d9894f3162345d85", "BLAKE"},
}
for v, _ in test_vectors {
computed := blake.hash_384(v.str)
computed_str := hex_string(computed[:])
expect(t, computed_str == v.hash, fmt.tprintf("Expected: %s for input of %s, but got %s instead", v.hash, v.str, computed_str))
}
}
@(test)
test_blake_512 :: proc(t: ^testing.T) {
test_vectors := [?]TestHash {
TestHash{"a8cfbbd73726062df0c6864dda65defe58ef0cc52a5625090fa17601e1eecd1b628e94f396ae402a00acc9eab77b4d4c2e852aaaa25a636d80af3fc7913ef5b8", ""},
TestHash{"49a24ca8f230936f938c19484d46b58f13ea4448ddadafecdf01419b1e1dd922680be2de84069187973ab61b10574da2ee50cbeaade68ea9391c8ec041b76be0", "ube"},
TestHash{"7bf805d0d8de36802b882e65d0515aa7682a2be97a9d9ec1399f4be2eff7de07684d7099124c8ac81c1c7c200d24ba68c6222e75062e04feb0e9dd589aa6e3b7", "BLAKE"},
}
for v, _ in test_vectors {
computed := blake.hash_512(v.str)
computed_str := hex_string(computed[:])
expect(t, computed_str == v.hash, fmt.tprintf("Expected: %s for input of %s, but got %s instead", v.hash, v.str, computed_str))
}
}
@(test)
test_blake2b :: proc(t: ^testing.T) {
test_vectors := [?]TestHash {