rebase to 0.18.3.3 completed

This commit is contained in:
Some Random Crypto Guy
2024-06-05 14:03:44 +01:00
parent e23423c16d
commit d39c20bb2d
160 changed files with 4209 additions and 3394 deletions
+1 -3
View File
@@ -27,7 +27,6 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "crypto/crypto.h"
#include "crypto/hash.h"
#include "cryptonote_basic/account.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_config.h"
@@ -98,13 +97,12 @@ namespace multisig
// - the 'multisig priv keys' here are those held by the local account
// - later, we add in the components held by other participants
cryptonote::keypair in_ephemeral;
//crypto::hash uniqueness = crypto::cn_fast_hash(reinterpret_cast<void*>(&real_output_index), sizeof(size_t));
// Populate this struct if you want to make use of multisig for Salvium!!!
assert(false);
cryptonote::origin_data origin_tx_data;
if (!cryptonote::generate_key_image_helper(keys, subaddresses, out_key, tx_public_key, additional_tx_public_keys, real_output_index, in_ephemeral, ki, keys.get_device(), origin_tx_data))
if (!cryptonote::generate_key_image_helper(keys, subaddresses, out_key, tx_public_key, additional_tx_public_keys, real_output_index, in_ephemeral, ki, keys.get_device(), true, origin_tx_data))
return false;
std::unordered_set<crypto::key_image> used;
+6 -3
View File
@@ -206,8 +206,13 @@ namespace multisig
//----------------------------------------------------------------------------------------------------------------------
void multisig_kex_msg::parse_and_validate_msg()
{
CHECK_AND_ASSERT_THROW_MES(MULTISIG_KEX_MSG_V2_MAGIC_1.size() == MULTISIG_KEX_MSG_V2_MAGIC_N.size(),
"Multisig kex msg magic inconsistency.");
CHECK_AND_ASSERT_THROW_MES(MULTISIG_KEX_MSG_V2_MAGIC_1.size() >= MULTISIG_KEX_V1_MAGIC.size(),
"Multisig kex msg magic inconsistency.");
// check message type
CHECK_AND_ASSERT_THROW_MES(m_msg.size() > 0, "Kex message unexpectedly empty.");
CHECK_AND_ASSERT_THROW_MES(m_msg.size() >= MULTISIG_KEX_MSG_V2_MAGIC_1.size(), "Kex message unexpectedly small.");
CHECK_AND_ASSERT_THROW_MES(m_msg.substr(0, MULTISIG_KEX_V1_MAGIC.size()) != MULTISIG_KEX_V1_MAGIC,
"V1 multisig kex messages are deprecated (unsafe).");
CHECK_AND_ASSERT_THROW_MES(m_msg.substr(0, MULTISIG_KEX_MSG_V1_MAGIC.size()) != MULTISIG_KEX_MSG_V1_MAGIC,
@@ -215,8 +220,6 @@ namespace multisig
// deserialize the message
std::string msg_no_magic;
CHECK_AND_ASSERT_THROW_MES(MULTISIG_KEX_MSG_V2_MAGIC_1.size() == MULTISIG_KEX_MSG_V2_MAGIC_N.size(),
"Multisig kex msg magic inconsistency.");
CHECK_AND_ASSERT_THROW_MES(tools::base58::decode(m_msg.substr(MULTISIG_KEX_MSG_V2_MAGIC_1.size()), msg_no_magic),
"Multisig kex msg decoding error.");
binary_archive<false> b_archive{epee::strspan<std::uint8_t>(msg_no_magic)};
+4 -8
View File
@@ -31,7 +31,6 @@
#include "int-util.h"
#include "memwipe.h"
#include "crypto/hash.h"
#include "cryptonote_basic/cryptonote_basic.h"
#include "cryptonote_basic/account.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
@@ -112,7 +111,7 @@ static bool compute_keys_for_sources(
// Populate this struct if you want to make use of multisig for Salvium!!!
assert(false);
cryptonote::origin_data origin_tx_data;
if (not cryptonote::generate_key_image_helper(
account_keys,
subaddresses,
@@ -123,6 +122,7 @@ static bool compute_keys_for_sources(
tmp_keys,
tmp_key_image,
hwdev,
true,
origin_tx_data
)) {
return false;
@@ -429,10 +429,6 @@ static bool compute_keys_for_destinations(
crypto::public_key temp_output_public_key;
for (std::size_t i = 0; i < num_destinations; ++i) {
crypto::ec_scalar uniqueness;
assert(false);
if (not hwdev.generate_output_ephemeral_keys(
unsigned_tx.version,
account_keys,
@@ -447,8 +443,7 @@ static bool compute_keys_for_destinations(
output_amount_secret_keys,
temp_output_public_key,
use_view_tags,
view_tags[i], //unused variable if use_view_tags is not set
uniqueness
view_tags[i] //unused variable if use_view_tags is not set
)) {
return false;
}
@@ -866,6 +861,7 @@ bool tx_builder_ringct_t::init(
// misc. fields
unsigned_tx.version = 2; //rct = 2
unsigned_tx.unlock_time = unlock_time;
// sort inputs
sort_sources(sources);