1#define BOOST_TEST_MODULE cypher_suites
2#include <boost/test/included/unit_test.hpp>
12BOOST_AUTO_TEST_SUITE(cypher_suites)
14 auto private_key_string = std::string(
"5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3");
15 auto expected_public_key = std::string(
"SYS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV");
16 auto test_private_key =
private_key(private_key_string);
17 auto test_public_key = test_private_key.get_public_key();
19 BOOST_CHECK_EQUAL(private_key_string, test_private_key.to_string());
24 auto private_key_string = std::string(
"PVT_R1_iyQmnyPEGvFd8uffnk152WC2WryBjgTrg22fXQryuGL9mU6qW");
25 auto expected_public_key = std::string(
"PUB_R1_6EPHFSKVYHBjQgxVGQPrwCxTg7BbZ69H9i4gztN9deKTEXYne4");
26 auto test_private_key =
private_key(private_key_string);
27 auto test_public_key = test_private_key.get_public_key();
29 BOOST_CHECK_EQUAL(private_key_string, test_private_key.to_string());
34 auto payload =
"Test Cases";
37 auto pub = key.get_public_key();
38 auto sig = key.sign(
digest);
41 std::cout << recovered_pub << std::endl;
43 BOOST_CHECK_EQUAL(recovered_pub.to_string(),
pub.to_string());
47 auto payload =
"Test Cases";
50 auto pub = key.get_public_key();
51 auto sig = key.sign(
digest);
54 std::cout << recovered_pub << std::endl;
56 BOOST_CHECK_EQUAL(recovered_pub.to_string(),
pub.to_string());
61 auto pub = key.get_public_key();
62 auto pub_str =
pub.to_string();
65 std::cout <<
pub <<
" -> " << recycled_pub << std::endl;
67 BOOST_CHECK_EQUAL(
pub.to_string(), recycled_pub.to_string());
72 auto pub = key.get_public_key();
73 auto pub_str =
pub.to_string();
76 std::cout <<
pub <<
" -> " << recycled_pub << std::endl;
78 BOOST_CHECK_EQUAL(
pub.to_string(), recycled_pub.to_string());
82BOOST_AUTO_TEST_SUITE_END()
static private_key generate()
static sha256 hash(const char *d, uint32_t dlen)
const uint8_t expected_public_key[]
fc::sha256 digest(const T &value)
constexpr size_t const_strlen(const char *str)
BOOST_AUTO_TEST_CASE(test_k1)