crypto: reduce crypto.h header weight

This commit is contained in:
jeffro256
2026-09-07 21:32:29 -05:00
parent fdb030df51
commit c7a2d4f66a
37 changed files with 284 additions and 195 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2024, The Monero Project
// Copyright (c) 2014-2026, The Monero Project
//
// All rights reserved.
//
@@ -113,7 +113,7 @@ bool test_transaction_generation_and_ring_signature()
output_keys.push_back(&boost::get<txout_to_key>(tx_mine_4.vout[0].target).key);
output_keys.push_back(&boost::get<txout_to_key>(tx_mine_5.vout[0].target).key);
output_keys.push_back(&boost::get<txout_to_key>(tx_mine_6.vout[0].target).key);
r = crypto::check_ring_signature(pref_hash, boost::get<txin_to_key>(tx_rc1.vin[0]).k_image, output_keys, &tx_rc1.signatures[0][0]);
r = crypto::check_ring_signature(pref_hash, boost::get<txin_to_key>(tx_rc1.vin[0]).k_image, output_keys.data(), output_keys.size(), &tx_rc1.signatures[0][0]);
CHECK_AND_ASSERT_MES(r, false, "failed to check ring signature");
std::vector<size_t> outs;
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2024, The Monero Project
// Copyright (c) 2014-2026, The Monero Project
//
// All rights reserved.
//
@@ -124,7 +124,7 @@ namespace
m_tx.signatures.push_back(std::vector<crypto::signature>());
std::vector<crypto::signature>& sigs = m_tx.signatures.back();
sigs.resize(src_entr.outputs.size());
generate_ring_signature(m_tx_prefix_hash, boost::get<txin_to_key>(m_tx.vin[i]).k_image, keys_ptrs, m_in_contexts[i].sec, src_entr.real_output, sigs.data());
generate_ring_signature(m_tx_prefix_hash, boost::get<txin_to_key>(m_tx.vin[i]).k_image, keys_ptrs.data(), keys_ptrs.size(), m_in_contexts[i].sec, src_entr.real_output, sigs.data());
i++;
}
}
+2 -1
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2024, The Monero Project
// Copyright (c) 2014-2026, The Monero Project
//
// All rights reserved.
//
@@ -42,6 +42,7 @@
#include "misc_log_ex.h"
#include "warnings.h"
#include "crypto/hash.h"
#include "crypto/hash-ops.h"
#include "crypto/variant2_int_sqrt.h"
#include "crypto/blake2b.h"
#include "../io.h"
+1
View File
@@ -38,6 +38,7 @@ extern "C"
#include "crypto/crypto-ops.h"
}
#include "crypto/generators.h"
#include "crypto/hash-ops.h"
#include "cryptonote_basic/merge_mining.h"
#include "fcmp_pp/fcmp_pp_crypto.h"
#include "ringct/rctOps.h"
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2018-2024, The Monero Project
// Copyright (c) 2018-2026, The Monero Project
//
// All rights reserved.
@@ -34,7 +34,7 @@ extern "C" {
#include "crypto/crypto-ops.h"
}
#include "crypto/hash.h"
#include <boost/algorithm/string.hpp>
#include <boost/optional.hpp>
static inline unsigned char *operator &(crypto::ec_point &point) {
return &reinterpret_cast<unsigned char &>(point);
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2023-2024, The Monero Project
// Copyright (c) 2023-2026, The Monero Project
//
// All rights reserved.
//
@@ -182,7 +182,7 @@ TEST(wallet_storage, export_key_images_uses_generated_key_image)
std::vector<const crypto::public_key*> key_ptrs;
key_ptrs.push_back(&pkey);
EXPECT_TRUE(crypto::check_ring_signature((const crypto::hash&)exported_key_image,
exported_key_image, key_ptrs, &exported.second.front().second));
exported_key_image, key_ptrs.data(), key_ptrs.size(), &exported.second.front().second));
}
TEST(wallet_storage, change_password_same_file)