aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorkoe <ukoe@protonmail.com>2022-12-01 17:32:40 -0600
committerkoe <ukoe@protonmail.com>2023-06-28 09:52:27 -0500
commit16d17f67072aee08ea787b0877db67a89d6db811 (patch)
tree5e2c76da1750e10dff37e6b22d985024195ff0cc /tests
parentMerge pull request #8884 (diff)
downloadmonero-16d17f67072aee08ea787b0877db67a89d6db811.tar.xz
add crypto/generators for direct access to canonical fixed generators
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/crypto.cpp24
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);
+}