summaryrefslogtreecommitdiff
path: root/test/buildtool/crypto
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2022-09-06 10:49:19 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2022-12-21 14:59:04 +0100
commit6ce8a51993e0dfd8feebb51ede67c479c8a78e96 (patch)
tree48ab9b7475c419be7347a1de5f6f4dc7c27e1194 /test/buildtool/crypto
parent22e6727e44d709f8591c425699abea19d1dd2394 (diff)
downloadjustbuild-6ce8a51993e0dfd8feebb51ede67c479c8a78e96.tar.gz
Crypto: Add SHA512 hasher
Needed by the content-in-CAS git map to check fetched archives' checksums. SHA1 and SHA256 hashers are already implemented.
Diffstat (limited to 'test/buildtool/crypto')
-rw-r--r--test/buildtool/crypto/hasher.test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/buildtool/crypto/hasher.test.cpp b/test/buildtool/crypto/hasher.test.cpp
index 594e4504..45f24db7 100644
--- a/test/buildtool/crypto/hasher.test.cpp
+++ b/test/buildtool/crypto/hasher.test.cpp
@@ -39,4 +39,12 @@ TEST_CASE("Hasher", "[crypto]") {
bytes,
"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08");
}
+
+ SECTION("SHA-512") {
+ // same as: echo -n test | sha512sum
+ test_increment_hash<Hasher::HashType::SHA512>(
+ bytes,
+ "ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27a"
+ "c185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff");
+ }
}