aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/core_tests/chaingen.cpp2
-rw-r--r--tests/core_tests/tx_validation.cpp4
-rw-r--r--tests/crypto/CMakeLists.txt3
-rw-r--r--tests/crypto/crypto.cpp12
-rw-r--r--tests/hash/main.cpp4
-rw-r--r--tests/performance_tests/generate_keypair.h2
6 files changed, 12 insertions, 15 deletions
diff --git a/tests/core_tests/chaingen.cpp b/tests/core_tests/chaingen.cpp
index 5e1525e3e..41256a4f1 100644
--- a/tests/core_tests/chaingen.cpp
+++ b/tests/core_tests/chaingen.cpp
@@ -521,7 +521,7 @@ bool construct_miner_tx_manually(size_t height, uint64_t already_generated_coins
keypair* p_txkey/* = 0*/)
{
keypair txkey;
- txkey = keypair::generate();
+ txkey = keypair::generate(hw::get_device("default"));
add_tx_pub_key_to_extra(tx, txkey.pub);
if (0 != p_txkey)
diff --git a/tests/core_tests/tx_validation.cpp b/tests/core_tests/tx_validation.cpp
index d6d5236aa..f0a385ee5 100644
--- a/tests/core_tests/tx_validation.cpp
+++ b/tests/core_tests/tx_validation.cpp
@@ -49,7 +49,7 @@ namespace
m_tx.version = version;
m_tx.unlock_time = unlock_time;
- m_tx_key = keypair::generate();
+ m_tx_key = keypair::generate(hw::get_device("default"));
add_tx_pub_key_to_extra(m_tx, m_tx_key.pub);
}
@@ -518,7 +518,7 @@ bool gen_tx_key_image_not_derive_from_tx_key::generate(std::vector<test_event_en
builder.step2_fill_inputs(miner_account.get_keys(), sources);
txin_to_key& in_to_key = boost::get<txin_to_key>(builder.m_tx.vin.front());
- keypair kp = keypair::generate();
+ keypair kp = keypair::generate(hw::get_device("default"));
key_image another_ki;
crypto::generate_key_image(kp.pub, kp.sec, another_ki);
in_to_key.k_image = another_ki;
diff --git a/tests/crypto/CMakeLists.txt b/tests/crypto/CMakeLists.txt
index c89049d50..df96c57cc 100644
--- a/tests/crypto/CMakeLists.txt
+++ b/tests/crypto/CMakeLists.txt
@@ -42,10 +42,7 @@ add_executable(cncrypto-tests
${crypto_headers})
target_link_libraries(cncrypto-tests
PRIVATE
- wallet
- cryptonote_core
common
- device
${Boost_SYSTEM_LIBRARY}
${EXTRA_LIBRARIES})
set_property(TARGET cncrypto-tests
diff --git a/tests/crypto/crypto.cpp b/tests/crypto/crypto.cpp
index 90212bd0b..6a1dd1b29 100644
--- a/tests/crypto/crypto.cpp
+++ b/tests/crypto/crypto.cpp
@@ -33,7 +33,7 @@
#include "crypto-tests.h"
bool check_scalar(const crypto::ec_scalar &scalar) {
- return sc_check(crypto::operator &(scalar)) == 0;
+ return crypto::sc_check(crypto::operator &(scalar)) == 0;
}
void random_scalar(crypto::ec_scalar &res) {
@@ -45,13 +45,13 @@ void hash_to_scalar(const void *data, std::size_t length, crypto::ec_scalar &res
}
void hash_to_point(const crypto::hash &h, crypto::ec_point &res) {
- ge_p2 point;
- ge_fromfe_frombytes_vartime(&point, reinterpret_cast<const unsigned char *>(&h));
- ge_tobytes(crypto::operator &(res), &point);
+ crypto::ge_p2 point;
+ crypto::ge_fromfe_frombytes_vartime(&point, reinterpret_cast<const unsigned char *>(&h));
+ crypto::ge_tobytes(crypto::operator &(res), &point);
}
void hash_to_ec(const crypto::public_key &key, crypto::ec_point &res) {
- ge_p3 tmp;
+ crypto::ge_p3 tmp;
crypto::hash_to_ec(key, tmp);
- ge_p3_tobytes(crypto::operator &(res), &tmp);
+ crypto::ge_p3_tobytes(crypto::operator &(res), &tmp);
}
diff --git a/tests/hash/main.cpp b/tests/hash/main.cpp
index 5a16284df..c7e1fe712 100644
--- a/tests/hash/main.cpp
+++ b/tests/hash/main.cpp
@@ -52,10 +52,10 @@ extern "C" {
tree_hash((const char (*)[32]) data, length >> 5, hash);
}
static void cn_slow_hash_0(const void *data, size_t length, char *hash) {
- return cn_slow_hash(data, length, hash, 0);
+ return cn_slow_hash(data, length, hash, 0/*variant*/, 0/*prehashed*/);
}
static void cn_slow_hash_1(const void *data, size_t length, char *hash) {
- return cn_slow_hash(data, length, hash, 1);
+ return cn_slow_hash(data, length, hash, 1/*variant*/, 0/*prehashed*/);
}
}
POP_WARNINGS
diff --git a/tests/performance_tests/generate_keypair.h b/tests/performance_tests/generate_keypair.h
index f97f4c213..91c830166 100644
--- a/tests/performance_tests/generate_keypair.h
+++ b/tests/performance_tests/generate_keypair.h
@@ -45,7 +45,7 @@ public:
bool test()
{
- cryptonote::keypair::generate();
+ cryptonote::keypair::generate(hw::get_device("default"));
return true;
}
};