test_olm_sha256.cpp 510 Bytes
Newer Older
Richard van der Hoff's avatar
Richard van der Hoff committed
1
#include "olm/olm.h"
2
3
#include "unittest.hh"

4
5
#include <vector>

6
7
8
9
10
int main() {
{
TestCase("Olm sha256 test");


11
12
std::vector<std::uint8_t> utility_buffer(::olm_utility_size());
::OlmUtility * utility = ::olm_utility(utility_buffer.data());
13
14
15
16
17
18
19
20
21
22

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);

}
}