diff options
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/CMakeLists.txt | 5 | ||||
-rw-r--r-- | tests/unit_tests/ban.cpp | 5 | ||||
-rw-r--r-- | tests/unit_tests/blockchain_db.cpp | 1 | ||||
-rw-r--r-- | tests/unit_tests/bulletproofs.cpp | 71 | ||||
-rw-r--r-- | tests/unit_tests/http.cpp | 3 | ||||
-rw-r--r-- | tests/unit_tests/main.cpp | 11 | ||||
-rw-r--r-- | tests/unit_tests/memwipe.cpp | 64 | ||||
-rw-r--r-- | tests/unit_tests/multisig.cpp | 188 | ||||
-rw-r--r-- | tests/unit_tests/ringct.cpp | 18 | ||||
-rw-r--r-- | tests/unit_tests/serialization.cpp | 2 |
10 files changed, 356 insertions, 12 deletions
diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt index e10648d20..cfacd5688 100644 --- a/tests/unit_tests/CMakeLists.txt +++ b/tests/unit_tests/CMakeLists.txt @@ -34,6 +34,7 @@ set(unit_tests_sources blockchain_db.cpp block_queue.cpp block_reward.cpp + bulletproofs.cpp canonical_amounts.cpp chacha8.cpp checkpoints.cpp @@ -49,8 +50,10 @@ set(unit_tests_sources hashchain.cpp http.cpp main.cpp + memwipe.cpp mnemonics.cpp mul_div.cpp + multisig.cpp parse_amount.cpp serialization.cpp sha256.cpp @@ -100,6 +103,8 @@ if (NOT MSVC) COMPILE_FLAGS " -Wno-undef -Wno-sign-compare") endif () +SET_PROPERTY(SOURCE memwipe.cpp PROPERTY COMPILE_FLAGS -Ofast) + add_test( NAME unit_tests COMMAND unit_tests --data-dir "${TEST_DATA_DIR}") diff --git a/tests/unit_tests/ban.cpp b/tests/unit_tests/ban.cpp index 242e5fe1c..5af514643 100644 --- a/tests/unit_tests/ban.cpp +++ b/tests/unit_tests/ban.cpp @@ -31,7 +31,9 @@ #include "gtest/gtest.h" #include "cryptonote_core/cryptonote_core.h" #include "p2p/net_node.h" +#include "p2p/net_node.inl" #include "cryptonote_protocol/cryptonote_protocol_handler.h" +#include "cryptonote_protocol/cryptonote_protocol_handler.inl" #define MAKE_IPV4_ADDRESS(a,b,c,d) epee::net_utils::ipv4_network_address{MAKE_IP(a,b,c,d),0} @@ -79,6 +81,7 @@ public: cryptonote::difficulty_type get_block_cumulative_difficulty(uint64_t height) const { return 0; } bool fluffy_blocks_enabled() const { return false; } uint64_t prevalidate_block_hashes(uint64_t height, const std::list<crypto::hash> &hashes) { return 0; } + void stop() {} }; typedef nodetool::node_server<cryptonote::t_cryptonote_protocol_handler<test_core>> Server; @@ -184,3 +187,5 @@ TEST(ban, add) ASSERT_TRUE(t >= 4); } +namespace nodetool { template class node_server<cryptonote::t_cryptonote_protocol_handler<test_core>>; } +namespace cryptonote { template class t_cryptonote_protocol_handler<test_core>; } diff --git a/tests/unit_tests/blockchain_db.cpp b/tests/unit_tests/blockchain_db.cpp index 5592106cb..4ccd9c1c8 100644 --- a/tests/unit_tests/blockchain_db.cpp +++ b/tests/unit_tests/blockchain_db.cpp @@ -35,6 +35,7 @@ #include "gtest/gtest.h" +#include "string_tools.h" #include "blockchain_db/blockchain_db.h" #include "blockchain_db/lmdb/db_lmdb.h" #ifdef BERKELEY_DB diff --git a/tests/unit_tests/bulletproofs.cpp b/tests/unit_tests/bulletproofs.cpp new file mode 100644 index 000000000..3d3dba5e6 --- /dev/null +++ b/tests/unit_tests/bulletproofs.cpp @@ -0,0 +1,71 @@ +// Copyright (c) 2017, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers + +#include "gtest/gtest.h" + +#include "ringct/rctOps.h" +#include "ringct/bulletproofs.h" + +TEST(bulletproofs, valid_zero) +{ + rct::Bulletproof proof = bulletproof_PROVE(0, rct::skGen()); + ASSERT_TRUE(rct::bulletproof_VERIFY(proof)); +} + +TEST(bulletproofs, valid_max) +{ + rct::Bulletproof proof = bulletproof_PROVE(0xffffffffffffffff, rct::skGen()); + ASSERT_TRUE(rct::bulletproof_VERIFY(proof)); +} + +TEST(bulletproofs, valid_random) +{ + for (int n = 0; n < 8; ++n) + { + rct::Bulletproof proof = bulletproof_PROVE(crypto::rand<uint64_t>(), rct::skGen()); + ASSERT_TRUE(rct::bulletproof_VERIFY(proof)); + } +} + +TEST(bulletproofs, invalid_8) +{ + rct::key invalid_amount = rct::zero(); + invalid_amount[8] = 1; + rct::Bulletproof proof = bulletproof_PROVE(invalid_amount, rct::skGen()); + ASSERT_FALSE(rct::bulletproof_VERIFY(proof)); +} + +TEST(bulletproofs, invalid_31) +{ + rct::key invalid_amount = rct::zero(); + invalid_amount[31] = 1; + rct::Bulletproof proof = bulletproof_PROVE(invalid_amount, rct::skGen()); + ASSERT_FALSE(rct::bulletproof_VERIFY(proof)); +} diff --git a/tests/unit_tests/http.cpp b/tests/unit_tests/http.cpp index 8d8a0965e..5e427f064 100644 --- a/tests/unit_tests/http.cpp +++ b/tests/unit_tests/http.cpp @@ -30,6 +30,7 @@ #include "net/http_auth.h" #include <boost/algorithm/string/predicate.hpp> +#include <boost/algorithm/string/join.hpp> #include <boost/fusion/adapted/std_pair.hpp> #include <boost/range/algorithm/find_if.hpp> #include <boost/range/iterator_range_core.hpp> @@ -211,7 +212,7 @@ std::string get_a1(const http::login& user, const fields& src) { const std::string& realm = src.at(u8"realm"); return boost::join( - std::vector<std::string>{user.username, realm, user.password}, u8":" + std::vector<std::string>{user.username, realm, std::string(user.password.data(), user.password.size())}, u8":" ); } diff --git a/tests/unit_tests/main.cpp b/tests/unit_tests/main.cpp index 95ea67410..073ac20fd 100644 --- a/tests/unit_tests/main.cpp +++ b/tests/unit_tests/main.cpp @@ -30,10 +30,16 @@ #include "gtest/gtest.h" -#include <boost/filesystem.hpp> +#include <boost/filesystem/path.hpp> +#include <boost/filesystem/operations.hpp> #include <boost/program_options.hpp> +#include "p2p/net_node.h" +#include "p2p/net_node.inl" +#include "cryptonote_protocol/cryptonote_protocol_handler.h" +#include "cryptonote_protocol/cryptonote_protocol_handler.inl" #include "include_base_utils.h" +#include "string_tools.h" #include "common/command_line.h" #include "common/util.h" #include "unit_tests_utils.h" @@ -42,6 +48,9 @@ namespace po = boost::program_options; boost::filesystem::path unit_test::data_dir; +namespace nodetool { template class node_server<cryptonote::t_cryptonote_protocol_handler<cryptonote::core>>; } +namespace cryptonote { template class t_cryptonote_protocol_handler<cryptonote::core>; } + int main(int argc, char** argv) { tools::on_startup(); diff --git a/tests/unit_tests/memwipe.cpp b/tests/unit_tests/memwipe.cpp new file mode 100644 index 000000000..b2b19fbf5 --- /dev/null +++ b/tests/unit_tests/memwipe.cpp @@ -0,0 +1,64 @@ +// Copyright (c) 2017, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "gtest/gtest.h" + +#include <stdint.h> +#include "misc_log_ex.h" +#include "common/memwipe.h" + +// Probably won't catch the optimized out case, but at least we test +// it works in the normal case +static void test(bool wipe) +{ + char *foo = (char*)malloc(4); + ASSERT_TRUE(foo != NULL); + intptr_t foop = (intptr_t)foo; + strcpy(foo, "bar"); + void *bar = wipe ? memwipe(foo, 3) : memset(foo, 0, 3); + ASSERT_EQ(foo, bar); + free(foo); + char *quux = (char*)malloc(4); // same size, just after free, so we're likely to get the same, depending on the allocator + if ((intptr_t)quux == foop) + { + MDEBUG(std::hex << std::setw(8) << std::setfill('0') << *(uint32_t*)quux); + if (wipe) ASSERT_TRUE(!memcmp(quux, "\0\0\0", 3)); + } + else MWARNING("We did not get the same location, cannot check"); + free(quux); +} + +TEST(memwipe, control) +{ + test(false); +} + +TEST(memwipe, works) +{ + test(true); +} diff --git a/tests/unit_tests/multisig.cpp b/tests/unit_tests/multisig.cpp new file mode 100644 index 000000000..8b2c7e5f8 --- /dev/null +++ b/tests/unit_tests/multisig.cpp @@ -0,0 +1,188 @@ +// Copyright (c) 2017, The Monero Project +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, are +// permitted provided that the following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of +// conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list +// of conditions and the following disclaimer in the documentation and/or other +// materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be +// used to endorse or promote products derived from this software without specific +// prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL +// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF +// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include "gtest/gtest.h" + +#include <cstdint> + +#include "wallet/wallet2.h" + +static const struct +{ + const char *address; + const char *spendkey; +} test_addresses[] = +{ + { + "9uvjbU54ZJb8j7Dcq1h3F1DnBRkxXdYUX4pbJ7mE3ghM8uF3fKzqRKRNAKYZXcNLqMg7MxjVVD2wKC2PALUwEveGSC3YSWD", + "2dd6e34a234c3e8b5d29a371789e4601e96dee4ea6f7ef79224d1a2d91164c01" + }, + { + "9ywDBAyDbb6QKFiZxDJ4hHZqZEQXXCR5EaYNcndUpqPDeE7rEgs6neQdZnhcDrWbURYK8xUjhuG2mVjJdmknrZbcG7NnbaB", + "fac47aecc948ce9d3531aa042abb18235b1df632087c55a361b632ffdd6ede0c" + }, + { + "9t6Hn946u3eah5cuncH1hB5hGzsTUoevtf4SY7MHN5NgJZh2SFWsyVt3vUhuHyRKyrCQvr71Lfc1AevG3BXE11PQFoXDtD8", + "bbd3175ef9fd9f5eefdc43035f882f74ad14c4cf1799d8b6f9001bc197175d02" + } +}; + +static void make_wallet(unsigned int idx, tools::wallet2 &wallet) +{ + ASSERT_TRUE(idx < sizeof(test_addresses) / sizeof(test_addresses[0])); + + crypto::secret_key spendkey; + epee::string_tools::hex_to_pod(test_addresses[idx].spendkey, spendkey); + + try + { + wallet.init(""); + wallet.set_subaddress_lookahead(1, 1); + wallet.generate("", "", spendkey, true, false); + ASSERT_TRUE(test_addresses[idx].address == wallet.get_account().get_public_address_str(true)); + } + catch (const std::exception &e) + { + MFATAL("Error creating test wallet: " << e.what()); + ASSERT_TRUE(0); + } +} + +static void make_M_2_wallet(tools::wallet2 &wallet0, tools::wallet2 &wallet1, unsigned int M) +{ + ASSERT_TRUE(M <= 2); + + make_wallet(0, wallet0); + make_wallet(1, wallet1); + + std::vector<crypto::secret_key> sk0(1), sk1(1); + std::vector<crypto::public_key> pk0(1), pk1(1); + + std::string mi0 = wallet0.get_multisig_info(); + std::string mi1 = wallet1.get_multisig_info(); + + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi1, sk0[0], pk0[0])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi0, sk1[0], pk1[0])); + + ASSERT_FALSE(wallet0.multisig() || wallet1.multisig()); + wallet0.make_multisig("", sk0, pk0, M); + wallet1.make_multisig("", sk1, pk1, M); + + ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet1.get_account().get_public_address_str(true)); + + bool ready; + uint32_t threshold, total; + ASSERT_TRUE(wallet0.multisig(&ready, &threshold, &total)); + ASSERT_TRUE(ready); + ASSERT_TRUE(threshold == M); + ASSERT_TRUE(total == 2); + ASSERT_TRUE(wallet1.multisig(&ready, &threshold, &total)); + ASSERT_TRUE(ready); + ASSERT_TRUE(threshold == M); + ASSERT_TRUE(total == 2); +} + +static void make_M_3_wallet(tools::wallet2 &wallet0, tools::wallet2 &wallet1, tools::wallet2 &wallet2, unsigned int M) +{ + ASSERT_TRUE(M <= 3); + + make_wallet(0, wallet0); + make_wallet(1, wallet1); + make_wallet(2, wallet2); + + std::vector<crypto::secret_key> sk0(2), sk1(2), sk2(2); + std::vector<crypto::public_key> pk0(2), pk1(2), pk2(2); + + std::string mi0 = wallet0.get_multisig_info(); + std::string mi1 = wallet1.get_multisig_info(); + std::string mi2 = wallet2.get_multisig_info(); + + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi1, sk0[0], pk0[0])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi2, sk0[1], pk0[1])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi0, sk1[0], pk1[0])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi2, sk1[1], pk1[1])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi0, sk2[0], pk2[0])); + ASSERT_TRUE(tools::wallet2::verify_multisig_info(mi1, sk2[1], pk2[1])); + + ASSERT_FALSE(wallet0.multisig() || wallet1.multisig() || wallet2.multisig()); + std::string mxi0 = wallet0.make_multisig("", sk0, pk0, M); + std::string mxi1 = wallet1.make_multisig("", sk1, pk1, M); + std::string mxi2 = wallet2.make_multisig("", sk2, pk2, M); + + const size_t nset = !mxi0.empty() + !mxi1.empty() + !mxi2.empty(); + ASSERT_TRUE((M < 3 && nset == 3) || (M == 3 && nset == 0)); + + if (nset > 0) + { + std::unordered_set<crypto::public_key> pkeys; + std::vector<crypto::public_key> signers(3, crypto::null_pkey); + ASSERT_TRUE(tools::wallet2::verify_extra_multisig_info(mxi0, pkeys, signers[0])); + ASSERT_TRUE(tools::wallet2::verify_extra_multisig_info(mxi1, pkeys, signers[1])); + ASSERT_TRUE(tools::wallet2::verify_extra_multisig_info(mxi2, pkeys, signers[2])); + ASSERT_TRUE(pkeys.size() == 3); + ASSERT_TRUE(wallet0.finalize_multisig("", pkeys, signers)); + ASSERT_TRUE(wallet1.finalize_multisig("", pkeys, signers)); + ASSERT_TRUE(wallet2.finalize_multisig("", pkeys, signers)); + } + + ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet1.get_account().get_public_address_str(true)); + ASSERT_TRUE(wallet0.get_account().get_public_address_str(true) == wallet2.get_account().get_public_address_str(true)); + + bool ready; + uint32_t threshold, total; + ASSERT_TRUE(wallet0.multisig(&ready, &threshold, &total)); + ASSERT_TRUE(ready); + ASSERT_TRUE(threshold == M); + ASSERT_TRUE(total == 3); + ASSERT_TRUE(wallet1.multisig(&ready, &threshold, &total)); + ASSERT_TRUE(ready); + ASSERT_TRUE(threshold == M); + ASSERT_TRUE(total == 3); + ASSERT_TRUE(wallet2.multisig(&ready, &threshold, &total)); + ASSERT_TRUE(ready); + ASSERT_TRUE(threshold == M); + ASSERT_TRUE(total == 3); +} + +TEST(multisig, make_2_2) +{ + tools::wallet2 wallet0, wallet1; + make_M_2_wallet(wallet0, wallet1, 2); +} + +TEST(multisig, make_3_3) +{ + tools::wallet2 wallet0, wallet1, wallet2; + make_M_3_wallet(wallet0, wallet1, wallet2, 3); +} + +TEST(multisig, make_2_3) +{ + tools::wallet2 wallet0, wallet1, wallet2; + make_M_3_wallet(wallet0, wallet1, wallet2, 2); +} diff --git a/tests/unit_tests/ringct.cpp b/tests/unit_tests/ringct.cpp index ef6151efb..6956179c1 100644 --- a/tests/unit_tests/ringct.cpp +++ b/tests/unit_tests/ringct.cpp @@ -111,7 +111,7 @@ TEST(ringct, MG_sigs) sk[j] = xm[ind][j]; } key message = identity(); - mgSig IIccss = MLSAG_Gen(message, P, sk, ind, R); + mgSig IIccss = MLSAG_Gen(message, P, sk, NULL, NULL, ind, R); ASSERT_TRUE(MLSAG_Ver(message, P, IIccss, R)); //#MG sig: false one @@ -132,7 +132,7 @@ TEST(ringct, MG_sigs) sk[j] = xx[ind][j]; } sk[2] = skGen();//asume we don't know one of the private keys.. - IIccss = MLSAG_Gen(message, P, sk, ind, R); + IIccss = MLSAG_Gen(message, P, sk, NULL, NULL, ind, R); ASSERT_FALSE(MLSAG_Ver(message, P, IIccss, R)); } @@ -171,7 +171,7 @@ TEST(ringct, range_proofs) destinations.push_back(Pk); //compute rct data with mixin 500 - rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3); + rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3); //verify rct data ASSERT_TRUE(verRct(s)); @@ -188,7 +188,7 @@ TEST(ringct, range_proofs) //compute rct data with mixin 500 - s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3); + s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3); //verify rct data ASSERT_FALSE(verRct(s)); @@ -235,7 +235,7 @@ TEST(ringct, range_proofs_with_fee) destinations.push_back(Pk); //compute rct data with mixin 500 - rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3); + rctSig s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3); //verify rct data ASSERT_TRUE(verRct(s)); @@ -252,7 +252,7 @@ TEST(ringct, range_proofs_with_fee) //compute rct data with mixin 500 - s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3); + s = genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3); //verify rct data ASSERT_FALSE(verRct(s)); @@ -310,7 +310,7 @@ TEST(ringct, simple) //compute sig with mixin 2 xmr_amount txnfee = 1; - rctSig s = genRctSimple(message, sc, pc, destinations,inamounts, outamounts, amount_keys, txnfee, 2); + rctSig s = genRctSimple(message, sc, pc, destinations,inamounts, outamounts, amount_keys, NULL, NULL, txnfee, 2); //verify ring ct signature ASSERT_TRUE(verRctSimple(s)); @@ -344,7 +344,7 @@ static rct::rctSig make_sample_rct_sig(int n_inputs, const uint64_t input_amount } } - return genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3);; + return genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3);; } static rct::rctSig make_sample_simple_rct_sig(int n_inputs, const uint64_t input_amounts[], int n_outputs, const uint64_t output_amounts[], uint64_t fee) @@ -370,7 +370,7 @@ static rct::rctSig make_sample_simple_rct_sig(int n_inputs, const uint64_t input destinations.push_back(Pk); } - return genRctSimple(rct::zero(), sc, pc, destinations, inamounts, outamounts, amount_keys, fee, 3);; + return genRctSimple(rct::zero(), sc, pc, destinations, inamounts, outamounts, amount_keys, NULL, NULL, fee, 3);; } static bool range_proof_test(bool expected_valid, diff --git a/tests/unit_tests/serialization.cpp b/tests/unit_tests/serialization.cpp index 0750ab7d1..9e76efadf 100644 --- a/tests/unit_tests/serialization.cpp +++ b/tests/unit_tests/serialization.cpp @@ -591,7 +591,7 @@ TEST(Serialization, serializes_ringct_types) rct::skpkGen(Sk, Pk); destinations.push_back(Pk); //compute rct data with mixin 500 - s0 = rct::genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, 3); + s0 = rct::genRct(rct::zero(), sc, pc, destinations, amounts, amount_keys, NULL, NULL, 3); mg0 = s0.p.MGs[0]; ASSERT_TRUE(serialization::dump_binary(mg0, blob)); |