diff options
Diffstat (limited to 'tests/unit_tests/crypto.cpp')
-rw-r--r-- | tests/unit_tests/crypto.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/unit_tests/crypto.cpp b/tests/unit_tests/crypto.cpp index 4cac0b89f..e41f3955f 100644 --- a/tests/unit_tests/crypto.cpp +++ b/tests/unit_tests/crypto.cpp @@ -32,8 +32,15 @@ #include <sstream> #include <string> +extern "C" +{ +#include "crypto/crypto-ops.h" +} +#include "crypto/generators.h" #include "cryptonote_basic/cryptonote_basic_impl.h" #include "cryptonote_basic/merge_mining.h" +#include "ringct/rctOps.h" +#include "ringct/rctTypes.h" namespace { @@ -312,3 +319,20 @@ TEST(Crypto, tree_branch) } } } + +TEST(Crypto, generator_consistency) +{ + // crypto/generators.h + const crypto::public_key G{crypto::get_G()}; + const crypto::public_key H{crypto::get_H()}; + const ge_p3 H_p3 = crypto::get_H_p3(); + + // crypto/crypto-ops.h + ASSERT_TRUE(memcmp(&H_p3, &ge_p3_H, sizeof(ge_p3)) == 0); + + // ringct/rctOps.h + ASSERT_TRUE(memcmp(G.data, rct::G.bytes, 32) == 0); + + // ringct/rctTypes.h + ASSERT_TRUE(memcmp(H.data, rct::H.bytes, 32) == 0); +} |