|
|
|
@ -100,6 +100,17 @@ START_TEST(test_bignum_read_be)
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
START_TEST(test_bignum_write_be)
|
|
|
|
|
{
|
|
|
|
|
bignum256 a = { { 0x286d8bd5, 0x380c7c17, 0x3c6a2ec1, 0x2d787ef5, 0x14437cd3, 0x25a043f8, 0x1dd5263f, 0x33a162c3, 0x0000c55e } };
|
|
|
|
|
uint8_t tmp[32];
|
|
|
|
|
|
|
|
|
|
bn_write_be(&a, tmp);
|
|
|
|
|
|
|
|
|
|
ck_assert_mem_eq(tmp, fromhex("c55ece858b0ddd5263f96810fe14437cd3b5e1fbd7c6a2ec1e031f05e86d8bd5"), 32);
|
|
|
|
|
}
|
|
|
|
|
END_TEST
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// from https://github.com/bitcoin/bitcoin/blob/master/src/test/data/base58_keys_valid.json
|
|
|
|
|
START_TEST(test_base58)
|
|
|
|
@ -2347,6 +2358,7 @@ Suite *test_suite(void)
|
|
|
|
|
|
|
|
|
|
tc = tcase_create("bignum");
|
|
|
|
|
tcase_add_test(tc, test_bignum_read_be);
|
|
|
|
|
tcase_add_test(tc, test_bignum_write_be);
|
|
|
|
|
suite_add_tcase(s, tc);
|
|
|
|
|
|
|
|
|
|
tc = tcase_create("base58");
|
|
|
|
|