aboutsummaryrefslogtreecommitdiff
path: root/tests/test_olm_sha256.cpp
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-07-24 14:29:52 +0100
committerMark Haines <mark.haines@matrix.org>2015-07-24 14:29:52 +0100
commit39c1f3b3559d7fe659a6fe05d5ac5c752501ed37 (patch)
treec2ce2b9edbe0ebca2716004785f3a53d06d90842 /tests/test_olm_sha256.cpp
parent411109d8930fca33fc491c62ec6d136e23a86cb6 (diff)
Add methods for computing sha256 hashes and validating ed25519 signatures
Diffstat (limited to 'tests/test_olm_sha256.cpp')
-rw-r--r--tests/test_olm_sha256.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_olm_sha256.cpp b/tests/test_olm_sha256.cpp
new file mode 100644
index 0000000..fe5bf42
--- /dev/null
+++ b/tests/test_olm_sha256.cpp
@@ -0,0 +1,20 @@
+#include "olm/olm.hh"
+#include "unittest.hh"
+
+int main() {
+{
+TestCase("Olm sha256 test");
+
+
+std::uint8_t utility_buffer[::olm_utility_size()];
+::OlmUtility * utility = ::olm_utility(utility_buffer);
+
+assert_equals(std::size_t(43), ::olm_sha256_length(utility));
+std::uint8_t output[43];
+::olm_sha256(utility, "Hello, World", 12, output, 43);
+
+std::uint8_t expected_output[] = "A2daxT/5zRU1zMffzfosRYxSGDcfQY3BNvLRmsH76KU";
+assert_equals(output, expected_output, 43);
+
+}
+}