mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-20 15:19:07 +01:00
refactor: Fix includes in crypto directory
IWYU issue #1763 appears to be a corner case, so it has been addressed using a local pragma rather than a global mapping.
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
# Nothing for now.
|
||||
[
|
||||
# Compiler intrinsics.
|
||||
# See: https://github.com/include-what-you-use/include-what-you-use/issues/1764.
|
||||
{ "include": [ "<emmintrin.h>", "private", "<immintrin.h>", "public" ] },
|
||||
{ "include": [ "<smmintrin.h>", "private", "<immintrin.h>", "public" ] },
|
||||
{ "include": [ "<tmmintrin.h>", "private", "<immintrin.h>", "public" ] },
|
||||
|
||||
# libc symbols.
|
||||
{ "symbol": ["AT_HWCAP", "private", "<sys/auxv.h>", "public"] },
|
||||
{ "symbol": ["AT_HWCAP2", "private", "<sys/auxv.h>", "public"] },
|
||||
]
|
||||
|
||||
@@ -8,11 +8,10 @@
|
||||
#include <crypto/common.h>
|
||||
#include <crypto/chacha20.h>
|
||||
#include <support/cleanse.h>
|
||||
#include <span.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
|
||||
#define QUARTERROUND(a,b,c,d) \
|
||||
a += b; d = std::rotl(d ^ a, 16); \
|
||||
|
||||
@@ -5,12 +5,11 @@
|
||||
#ifndef BITCOIN_CRYPTO_CHACHA20_H
|
||||
#define BITCOIN_CRYPTO_CHACHA20_H
|
||||
|
||||
#include <span.h>
|
||||
|
||||
#include <array>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <iterator>
|
||||
#include <span>
|
||||
#include <utility>
|
||||
|
||||
// classes for ChaCha20 256-bit stream cipher developed by Daniel J. Bernstein
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
|
||||
#include <crypto/chacha20.h>
|
||||
#include <crypto/poly1305.h>
|
||||
#include <span.h>
|
||||
|
||||
/** The AEAD_CHACHA20_POLY1305 authenticated encryption algorithm from RFC8439 section 2.8. */
|
||||
class AEADChaCha20Poly1305
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
#include <crypto/hex_base.h>
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
namespace {
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
#include <crypto/hkdf_sha256_32.h>
|
||||
|
||||
#include <crypto/hmac_sha256.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
|
||||
CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const unsigned char* ikm, size_t ikmlen, const std::string& salt)
|
||||
{
|
||||
|
||||
@@ -5,10 +5,8 @@
|
||||
#ifndef BITCOIN_CRYPTO_HKDF_SHA256_32_H
|
||||
#define BITCOIN_CRYPTO_HKDF_SHA256_32_H
|
||||
|
||||
#include <crypto/hmac_sha256.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
/** A rfc5869 HKDF implementation with HMAC_SHA256 and fixed key output length of 32 bytes (L=32) */
|
||||
class CHKDF_HMAC_SHA256_L32
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <crypto/hmac_sha256.h>
|
||||
|
||||
#include <crypto/sha256.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <crypto/sha256.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
|
||||
/** A hasher class for HMAC-SHA-256. */
|
||||
class CHMAC_SHA256
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#include <crypto/hmac_sha512.h>
|
||||
|
||||
#include <crypto/sha512.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
|
||||
#include <crypto/sha512.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <cstddef>
|
||||
|
||||
/** A hasher class for HMAC-SHA-512. */
|
||||
class CHMAC_SHA512
|
||||
|
||||
@@ -7,11 +7,12 @@
|
||||
#include <crypto/chacha20.h>
|
||||
#include <crypto/common.h>
|
||||
#include <hash.h>
|
||||
#include <span.h>
|
||||
#include <uint256.h>
|
||||
#include <util/check.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -6,9 +6,12 @@
|
||||
#define BITCOIN_CRYPTO_MUHASH_H
|
||||
|
||||
#include <serialize.h>
|
||||
#include <uint256.h>
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
|
||||
class uint256;
|
||||
|
||||
class Num3072
|
||||
{
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <crypto/common.h>
|
||||
#include <crypto/poly1305.h>
|
||||
|
||||
#include <cstring>
|
||||
|
||||
namespace poly1305_donna {
|
||||
|
||||
// Based on the public domain implementation by Andrew Moon
|
||||
|
||||
@@ -8,8 +8,9 @@
|
||||
#include <span.h>
|
||||
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <span>
|
||||
|
||||
#define POLY1305_BLOCK_SIZE 16
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <cstring>
|
||||
|
||||
#if !defined(DISABLE_OPTIMIZED_SHA256)
|
||||
#include <compat/cpuid.h>
|
||||
#include <compat/cpuid.h> // IWYU pragma: keep
|
||||
|
||||
#if defined(__linux__) && defined(ENABLE_ARM_SHANI)
|
||||
#include <sys/auxv.h>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <arm_acle.h>
|
||||
#include <arm_neon.h>
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
// This is a translation to GCC extended asm syntax from YASM code by Intel
|
||||
// (available at the bottom of this file).
|
||||
|
||||
#if defined(__x86_64__) || defined(__amd64__)
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
|
||||
#if defined(__x86_64__) || defined(__amd64__)
|
||||
|
||||
namespace sha256_sse4
|
||||
{
|
||||
void Transform(uint32_t* s, const unsigned char* chunk, size_t blocks)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#if defined(ENABLE_SSE41) && defined(ENABLE_X86_SHANI)
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <immintrin.h>
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
#include <crypto/common.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <span>
|
||||
|
||||
void KeccakF(uint64_t (&st)[25])
|
||||
|
||||
@@ -5,10 +5,9 @@
|
||||
#ifndef BITCOIN_CRYPTO_SHA3_H
|
||||
#define BITCOIN_CRYPTO_SHA3_H
|
||||
|
||||
#include <span.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstdlib>
|
||||
#include <span>
|
||||
|
||||
//! The Keccak-f[1600] transform.
|
||||
void KeccakF(uint64_t (&st)[25]);
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
|
||||
#include <crypto/siphash.h>
|
||||
|
||||
#include <uint256.h>
|
||||
|
||||
#include <bit>
|
||||
#include <cassert>
|
||||
#include <span>
|
||||
|
||||
#define SIPROUND do { \
|
||||
v0 += v1; v1 = std::rotl(v1, 13); v1 ^= v0; \
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#define BITCOIN_CRYPTO_SIPHASH_H
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
|
||||
#include <span.h>
|
||||
#include <uint256.h>
|
||||
class uint256;
|
||||
|
||||
/** SipHash-2-4 */
|
||||
class CSipHasher
|
||||
|
||||
Reference in New Issue
Block a user