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 -5
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2024, The Monero Project
// Copyright (c) 2014-2026, The Monero Project
//
// All rights reserved.
//
@@ -28,9 +28,6 @@
//
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#include <fstream>
#include "include_base_utils.h"
#include "account.h"
#include "warnings.h"
#include "crypto/crypto.h"
@@ -65,7 +62,7 @@ DISABLE_VS_WARNINGS(4244 4345)
static void derive_key(const crypto::chacha_key &base_key, crypto::chacha_key &key)
{
static_assert(sizeof(base_key) == sizeof(crypto::hash), "chacha key and hash should be the same size");
epee::mlocked<tools::scrubbed_arr<char, sizeof(base_key)+1>> data;
epee::mlocked<tools::scrubbed<std::array<char, sizeof(base_key)+1>>> data;
memcpy(data.data(), &base_key, sizeof(base_key));
data[sizeof(base_key)] = config::HASH_KEY_MEMORY;
crypto::generate_chacha_key(data.data(), sizeof(data), key, 1);
@@ -1,4 +1,4 @@
// Copyright (c) 2014-2024, The Monero Project
// Copyright (c) 2014-2026, The Monero Project
//
// All rights reserved.
//
@@ -38,6 +38,7 @@
#include "cryptonote_config.h"
#include "crypto/crypto.h"
#include "crypto/hash.h"
#include "crypto/hash-ops.h"
#include "ringct/rctOps.h"
using namespace epee;
+2 -2
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2020-2024, The Monero Project
// Copyright (c) 2020-2026, The Monero Project
//
// All rights reserved.
//
@@ -29,7 +29,7 @@
#include <string.h>
#include "misc_log_ex.h"
#include "int-util.h"
#include "crypto/crypto.h"
#include "crypto/hash-ops.h"
#include "common/util.h"
#include "merge_mining.h"
+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.
//
@@ -82,7 +82,7 @@
using namespace epee;
#include "miner.h"
#include "crypto/hash.h"
#include "crypto/hash-ops.h"
extern "C" void slow_hash_allocate_state();