diff options
author | Shen Noether <Shen.Noether@gmx.com> | 2016-06-02 19:04:10 +0100 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2016-08-28 21:28:01 +0100 |
commit | 53cdf4df5e7178a5c1f6237f0f6db2f166534f13 (patch) | |
tree | 97b732473c143f511e7b63eb8ae65dc150f01d73 /tests/unit_tests/ringct.cpp | |
parent | ringct: cosmetic fixes (diff) | |
download | monero-53cdf4df5e7178a5c1f6237f0f6db2f166534f13.tar.xz |
tests: new ringct test for checking H2 values
Ported from Shen's RingCT repo
Diffstat (limited to 'tests/unit_tests/ringct.cpp')
-rw-r--r-- | tests/unit_tests/ringct.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp index f2ad75edd..13dc313dd 100644 --- a/tests/unit_tests/ringct.cpp +++ b/tests/unit_tests/ringct.cpp @@ -457,6 +457,17 @@ TEST(ringct, range_proofs_accept_very_long) EXPECT_TRUE(range_proof_test(true, NELTS(inputs), inputs, NELTS(outputs), outputs)); } +TEST(ringct, HPow2) +{ + key G = scalarmultBase(d2h(1)); + + key H = hashToPointSimple(G); + for (int j = 0 ; j < ATOMS ; j++) { + ASSERT_TRUE(equalKeys(H, H2[j])); + addKeys(H, H, H); + } +} + static const xmr_amount test_amounts[]={0, 1, 2, 3, 4, 5, 10000, 10000000000000000000ull, 10203040506070809000ull, 123456789123456789}; TEST(ringct, ecdh_roundtrip) |