Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dhruv/bitcoin-core-ci
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ca3dc9e0a2afccbc90f91da08c03eddc6cb3df46
Choose a base ref
..
head repository: dhruv/bitcoin-core-ci
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 88fa767ccdfdd0f8376039ce332a9b7812906bfd
Choose a head ref
7 changes: 2 additions & 5 deletions src/bench/bip324_suite.cpp
Original file line number Diff line number Diff line change
@@ -23,12 +23,9 @@ static const std::vector<std::byte> zero_vec(BIP324_KEY_LEN, std::byte{0x00});
static void BIP324_CIPHER_SUITE(benchmark::Bench& bench, size_t contents_len, bool include_decryption)
{
BIP324Key zero_arr;
std::array<std::byte, BIP324_REKEY_SALT_LEN> zero_rekey_salt;
memcpy(zero_arr.data(), zero_vec.data(), BIP324_KEY_LEN);
memcpy(zero_rekey_salt.data(), zero_vec.data(), BIP324_REKEY_SALT_LEN);

BIP324CipherSuite enc{zero_arr, zero_arr, zero_rekey_salt};
BIP324CipherSuite dec{zero_arr, zero_arr, zero_rekey_salt};
BIP324CipherSuite enc{zero_arr, zero_arr};
BIP324CipherSuite dec{zero_arr, zero_arr};

auto packet_len = BIP324_LENGTH_FIELD_LEN + BIP324_HEADER_LEN + contents_len + RFC8439_EXPANSION;

26 changes: 9 additions & 17 deletions src/crypto/bip324_suite.cpp
Original file line number Diff line number Diff line change
@@ -32,21 +32,15 @@ BIP324CipherSuite::~BIP324CipherSuite()
memory_cleanse(key_P.data(), key_P.size());
}

void BIP324CipherSuite::CommitToKeys(const Span<const std::byte> data, bool commit_to_L, bool commit_to_P)
void BIP324CipherSuite::Rekey()
{
if (commit_to_L) {
fsc20.CommitToKey(data);
}

if (commit_to_P) {
assert(CSHA256::OUTPUT_SIZE == BIP324_KEY_LEN);
auto hasher = rekey_hasher;
hasher << MakeUCharSpan(data) << MakeUCharSpan(key_P);
auto new_key = hasher.GetSHA256();
memcpy(key_P.data(), new_key.data(), BIP324_KEY_LEN);
}

set_nonce();
ChaCha20 rekey_c20(UCharCast(key_P.data()));
std::array<std::byte, NONCE_LENGTH> rekey_nonce;
memset(rekey_nonce.data(), 0xFF, 4);
memcpy(rekey_nonce.data() + 4, nonce.data() + 4, NONCE_LENGTH - 4);
rekey_c20.SetRFC8439Nonce(rekey_nonce);
rekey_c20.SeekRFC8439(1);
rekey_c20.Keystream(reinterpret_cast<unsigned char*>(key_P.data()), BIP324_KEY_LEN);
}

bool BIP324CipherSuite::Crypt(const Span<const std::byte> aad,
@@ -101,9 +95,7 @@ bool BIP324CipherSuite::Crypt(const Span<const std::byte> aad,

packet_counter++;
if (packet_counter % REKEY_INTERVAL == 0) {
// Rekey key_P. key_L is automatically re-keyed since we're using a forward-secure version
// of ChaCha20, FSChacha20
CommitToKeys({(std::byte*)nullptr, 0}, false, true);
Rekey();
}
set_nonce();
return true;
18 changes: 6 additions & 12 deletions src/crypto/bip324_suite.h
Original file line number Diff line number Diff line change
@@ -7,17 +7,15 @@

#include <crypto/chacha20.h>
#include <crypto/rfc8439.h>
#include <hash.h>
#include <span.h>

#include <array>
#include <cstddef>

static constexpr size_t BIP324_KEY_LEN = 32; // bytes
static constexpr size_t BIP324_REKEY_SALT_LEN = 23; // bytes
static constexpr size_t BIP324_HEADER_LEN = 1; // bytes
static constexpr size_t BIP324_LENGTH_FIELD_LEN = 3; // bytes
static constexpr size_t REKEY_INTERVAL = 256; // packets
static constexpr size_t REKEY_INTERVAL = 224; // packets
static constexpr size_t NONCE_LENGTH = 12; // bytes

enum BIP324HeaderFlags : uint8_t {
@@ -33,28 +31,24 @@ class BIP324CipherSuite
FSChaCha20 fsc20;
uint32_t packet_counter{0};
BIP324Key key_P;
HashWriter rekey_hasher;
std::array<std::byte, 12> nonce;
std::array<std::byte, NONCE_LENGTH> nonce;

void set_nonce()
{
WriteLE32(reinterpret_cast<unsigned char*>(nonce.data()), packet_counter % REKEY_INTERVAL);
WriteLE64(reinterpret_cast<unsigned char*>(nonce.data()) + 4, packet_counter / REKEY_INTERVAL);
}

void Rekey();

public:
BIP324CipherSuite(const BIP324Key& K_L, const BIP324Key& K_P,
const std::array<std::byte, BIP324_REKEY_SALT_LEN>& rekey_salt)
: fsc20{K_L, rekey_salt, REKEY_INTERVAL},
BIP324CipherSuite(const BIP324Key& K_L, const BIP324Key& K_P)
: fsc20{K_L, REKEY_INTERVAL},
key_P{K_P}
{
set_nonce();
rekey_hasher << MakeUCharSpan(rekey_salt);
};

// Resets the suite keys to commit to data
void CommitToKeys(const Span<const std::byte> data, bool commit_to_L, bool commit_to_P);

explicit BIP324CipherSuite(const BIP324CipherSuite&) = delete;
~BIP324CipherSuite();

17 changes: 3 additions & 14 deletions src/crypto/chacha20.cpp
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@
#include <crypto/chacha20.h>

#include <crypto/common.h>
#include <crypto/sha256.h>

#include <algorithm>
#include <string.h>
@@ -348,18 +347,8 @@ void FSChaCha20::Crypt(Span<const std::byte> input, Span<std::byte> output)
chunk_counter++;

if (chunk_counter % rekey_interval == 0) {
CommitToKey({(std::byte*)nullptr, 0});
c20.Keystream(reinterpret_cast<unsigned char*>(key.data()), FSCHACHA20_KEYLEN);
c20.SetKey32(reinterpret_cast<unsigned char*>(key.data()));
set_nonce();
}
}

void FSChaCha20::CommitToKey(const Span<const std::byte> data)
{
assert(CSHA256::OUTPUT_SIZE == FSCHACHA20_KEYLEN);
auto hasher = rekey_hasher;
hasher << MakeUCharSpan(data) << MakeUCharSpan(key);
auto new_key = hasher.GetSHA256();
memory_cleanse(key.data(), key.size());
memcpy(key.data(), new_key.data(), FSCHACHA20_KEYLEN);
c20.SetKey32(reinterpret_cast<unsigned char*>(key.data()));
set_nonce();
}
7 changes: 0 additions & 7 deletions src/crypto/chacha20.h
Original file line number Diff line number Diff line change
@@ -6,7 +6,6 @@
#define BITCOIN_CRYPTO_CHACHA20_H

#include <crypto/common.h>
#include <hash.h>
#include <span.h>
#include <support/cleanse.h>

@@ -16,7 +15,6 @@
#include <stdint.h>

static constexpr size_t FSCHACHA20_KEYLEN = 32; // bytes
static constexpr size_t FSCHACHA20_REKEY_SALT_LEN = 23; // bytes

// classes for ChaCha20 256-bit stream cipher developed by Daniel J. Bernstein
// https://cr.yp.to/chacha/chacha-20080128.pdf */
@@ -112,7 +110,6 @@ class FSChaCha20
size_t rekey_interval;
uint32_t chunk_counter{0};
std::array<std::byte, FSCHACHA20_KEYLEN> key;
HashWriter rekey_hasher;

void set_nonce()
{
@@ -125,19 +122,15 @@ class FSChaCha20
public:
FSChaCha20() = delete;
FSChaCha20(const std::array<std::byte, FSCHACHA20_KEYLEN>& key,
const std::array<std::byte, FSCHACHA20_REKEY_SALT_LEN>& rekey_salt,
size_t rekey_interval)
: c20{reinterpret_cast<const unsigned char*>(key.data())},
rekey_interval{rekey_interval},
key{key}
{
assert(rekey_interval > 0);
set_nonce();
rekey_hasher << MakeUCharSpan(rekey_salt);
}

void CommitToKey(const Span<const std::byte> data);

~FSChaCha20()
{
memory_cleanse(key.data(), FSCHACHA20_KEYLEN);
54 changes: 21 additions & 33 deletions src/test/crypto_tests.cpp
Original file line number Diff line number Diff line change
@@ -169,21 +169,16 @@ static void TestChaCha20(const std::string &hex_message, const std::string &hexk
}
}

static void TestFSChaCha20(const std::string& hex_plaintext, const std::string& hexkey, const std::string& hex_rekey_salt, size_t rekey_interval, const std::string& ciphertext_after_rotation)
static void TestFSChaCha20(const std::string& hex_plaintext, const std::string& hexkey, size_t rekey_interval, const std::string& ciphertext_after_rotation)
{
auto key_vec = ParseHex(hexkey);
BOOST_CHECK_EQUAL(FSCHACHA20_KEYLEN, key_vec.size());
std::array<std::byte, FSCHACHA20_KEYLEN> key;
memcpy(key.data(), key_vec.data(), FSCHACHA20_KEYLEN);

auto salt_vec = ParseHex(hex_rekey_salt);
BOOST_CHECK_EQUAL(FSCHACHA20_REKEY_SALT_LEN, salt_vec.size());
std::array<std::byte, FSCHACHA20_REKEY_SALT_LEN> rekey_salt;
memcpy(rekey_salt.data(), salt_vec.data(), FSCHACHA20_REKEY_SALT_LEN);

auto plaintext = ParseHex(hex_plaintext);

auto fsc20 = FSChaCha20{key, rekey_salt, rekey_interval};
auto fsc20 = FSChaCha20{key, rekey_interval};
auto c20 = ChaCha20{reinterpret_cast<const unsigned char*>(key.data())};

std::vector<std::byte> fsc20_output;
@@ -200,13 +195,13 @@ static void TestFSChaCha20(const std::string& hex_plaintext, const std::string&

// At the rotation interval, the outputs will no longer match
fsc20.Crypt(MakeByteSpan(plaintext), fsc20_output);
auto c20_copy = c20;
c20.Crypt(plaintext.data(), c20_output.data(), plaintext.size());
BOOST_CHECK(memcmp(c20_output.data(), fsc20_output.data(), plaintext.size()) != 0);

unsigned char new_key[FSCHACHA20_KEYLEN];
auto hasher = CSHA256().Write(UCharCast(rekey_salt.data()), rekey_salt.size());
hasher.Write(UCharCast(key.data()), key.size()).Finalize(new_key);
c20.SetKey32(reinterpret_cast<unsigned char*>(new_key));
c20_copy.Keystream(new_key, FSCHACHA20_KEYLEN);
c20.SetKey32(new_key);

std::array<std::byte, 12> new_nonce;
WriteLE32(reinterpret_cast<unsigned char*>(new_nonce.data()), 0);
@@ -715,14 +710,16 @@ BOOST_AUTO_TEST_CASE(chacha20_testvector)
// Forward secure ChaCha20
TestFSChaCha20("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000", 256,
"4cf63894c8507adffa163a742db5fdcc9a861187b1c94a5a4c002d1bb7f2223c");
TestFSChaCha20("01", "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"0000000000000000000000000000000000000000000000", 5, "e0");
256,
"a93df4ef03011f3db95f60d996e1785df5de38fc39bfcb663a47bb5561928349");
TestFSChaCha20("01",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
5,
"ea");
TestFSChaCha20("e93fdb5c762804b9a706816aca31e35b11d2aa3080108ef46a5b1f1508819c0a",
"8ec4c3ccdaea336bdeb245636970be01266509b33f3d2642504eaf412206207a",
"8bb571662db12d38ee4e2630d4434f6f626cb0e6007e3c", 4096,
"30a36b4833331bf83bc16fcff408c771044e239b80472edd2e89ba9eb1845f34");
4096,
"8bfaa4eacff308fdb4a94a5ff25bd9d0c1f84b77f81239f67ff39d6e1ac280c9");
}

BOOST_AUTO_TEST_CASE(chacha20_midblock)
@@ -833,7 +830,7 @@ BOOST_AUTO_TEST_CASE(hkdf_hmac_sha256_l32_tests)
"8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d");
}

static void TestBIP324CipherSuite(const std::string& hex_aad, const std::string& hex_contents, const std::string& hex_key_L, const std::string& hex_key_P, const std::string& hex_rekey_salt, const std::string& hex_expected_output_seq_0, const std::string& hex_expected_output_seq_999)
static void TestBIP324CipherSuite(const std::string& hex_aad, const std::string& hex_contents, const std::string& hex_key_L, const std::string& hex_key_P, const std::string& hex_expected_output_seq_0, const std::string& hex_expected_output_seq_999)
{
auto key_L_vec = ParseHex(hex_key_L);
BIP324Key key_L;
@@ -843,10 +840,6 @@ static void TestBIP324CipherSuite(const std::string& hex_aad, const std::string&
BIP324Key key_P;
memcpy(key_P.data(), key_P_vec.data(), BIP324_KEY_LEN);

auto rekey_salt_vec = ParseHex(hex_rekey_salt);
std::array<std::byte, BIP324_REKEY_SALT_LEN> rekey_salt;
memcpy(rekey_salt.data(), rekey_salt_vec.data(), BIP324_REKEY_SALT_LEN);

auto aad = ParseHex(hex_aad);

const auto original_contents_bytes = ParseHex(hex_contents);
@@ -856,8 +849,8 @@ static void TestBIP324CipherSuite(const std::string& hex_aad, const std::string&
std::vector<unsigned char> contents_buf_dec(contents_buf.size(), 0);
uint32_t out_len = 0;

BIP324CipherSuite suite_enc(key_L, key_P, rekey_salt);
BIP324CipherSuite suite_dec(key_L, key_P, rekey_salt);
BIP324CipherSuite suite_enc(key_L, key_P);
BIP324CipherSuite suite_dec(key_L, key_P);

BIP324HeaderFlags flags{BIP324_NONE};
std::array<std::byte, BIP324_LENGTH_FIELD_LEN> encrypted_pkt_len;
@@ -900,42 +893,37 @@ BOOST_AUTO_TEST_CASE(bip324_cipher_suite_testvectors)
/* plaintext */ "",
/* k_l */ "0000000000000000000000000000000000000000000000000000000000000000",
/* k_p */ "0000000000000000000000000000000000000000000000000000000000000000",
/* rekey_salt */ "0000000000000000000000000000000000000000000000",
/* ciphertext_and_mac_0 */ "76b8e09fbedcfd1809ff3c10adf8277fcc0581b8",
/* ciphertext_and_mac_999 */ "66712b97e33e72c0e908f5a7ce99279cb3cb6769");
/* ciphertext_and_mac_999 */ "5dd1ef229ae773099415b4ae56d003d21b4e4a08");

TestBIP324CipherSuite("",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000",
"56b8e09f07e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32ee7aed29e7e38bb44c94b6a43c525ffca66c79e9",
"46712b9741ee5bde86518fee0ce0778aa97cf58c1ee3c587ab3dce47de77b25f202b4807e074989c86c4bb8493e76cda937e0aad");
"7dd1ef2205b549ef8e0dc60b16342f037e415cfcd3d6111532f8f9e7553e422129d9df0d58e083ad538381c1e30a51a5d296cce2");

TestBIP324CipherSuite("",
"0100000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000000000000000000000",
"0000000000000000000000000000000000000000000000",
"56b8e09f06e7be5551387a98ba977c732d080dcb0f29a048e3656912c6533e32ee7aed2929449b86c1e4e213676824f2c48e5336",
"46712b9740ee5bde86518fee0ce0778aa97cf58c1ee3c587ab3dce47de77b25f202b48079f2cc4249bd112ea04cccf99a211dfdb");
"7dd1ef2204b549ef8e0dc60b16342f037e415cfcd3d6111532f8f9e7553e422129d9df0d04fc5b2ab5cb70895a90edddbe642c00");

TestBIP324CipherSuite("",
"fc0000f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c9",
"ff0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"6f5ef19ed6f1a5e2db2b119494f21d8c2de638a4c6ec3b",
"3940c1184442315c7340b89171039acb48f95287e66e56f7afa7cf00f95044d26fb69d46ac5c16a2d57a1cadc39160644717559e73480734410a3f543c5f231a7d7ed77af2a64681f6a7417283cef85504ac5de9fdea100e6c67ef7a1bfcd888a92a5f1ef2c9074b44b572aa748f29ff61a850ce40470004dff5cc1d926c5abe25ace47a12c5373094a26bab027e008154fb630aa062490b5421e96691a3f79557f7a79e3cfd9100796671ea241703ddf326f113adf1694bbd6e0ca032e16f936e7bfbf174e7ef4af5b53a6a9102e6fa41a8e589290f39a7bc7a6003088c612a43a36c2e9f2e740797ad3a2a1a80e0f67157fb9abc40487077368e94751a266a0b2dac24f0adabd5c6d7ba54316eee951da560",
"bcc270293211abbeac7a26af3f3d200f8ce44de3d3e86cdbf449dcf7fedb7b5a489629deaae0c87471b1331b2fce7aba3dfabf6f1867e1a534cececba0cdc9e6150e92cb145567401f08778eeb646b2a70165061423b30ca21e754d3e0a0db4de59dd74093b0fc0fc78a598d522571525ab172592620f770b3303c65ee4a35504e4991e8f1d8904c9679824140642c70a184b4449d1ffdf11b8bee4e831a5b3d986006f5119a0912bacb939886abcb279be2437ecbf1f56528ef397f6459f0fd895031c7a8a2a815a3e68199dc1a9b0c7fef3df72c470f9e8e5524049e7e712da407a6b8ab9a3c0a4ae40cc187952b1062e646b8aebc2808a381530791e46b7220a1af222022952872decc6ad5fad2a7b242a7");
"2db339c8500d35db91994138b4ab5e698086b4ec7fb66e75d083b18f84a9da7d696be75c349cb1555a58f65f123d4b68e2be2277fd7b38ba26ad93040a22ac8f7782b00d75c7650dcff0442f7ef91980aaabecb2c8cefec5d5eb9d495b5e1768fe316ec2a0d69d46b7289cd2e2049f27d30a6183605651d48ac40e0d06af9ec7012d477e473f2af7842335c36acf4f5bdef45605ca243b9007b5363f095850a78945508cf3fa191b8fe7fc5359d6e00741e6504f1d50904152622f4c0bdeaa0745f00d28b995543621c96d9d9d30fa1fbf403b19a716411b1700e8401a3e1e01bb1546653fbda19d83ba5e561695baea229880ff33058f85754fe9fdc09db4491f47ae64ec030ec6163d2838d9474d40ef0579");

// Repeat test with non-empty aad - only mac tags (last 16 bytes) in the expected outputs change
TestBIP324CipherSuite("c6d7bc3a5079ae98fec7094bdfb42aac61d3ba64af179d672c7c33fd4a139647",
"fc0000f195e66982105ffb640bb7757f579da31602fc93ec01ac56f85ac3c134a4547b733b46413042c9440049176905d3be59ea1c53f15916155c2be8241a38008b9a26bc35941e2444177c8ade6689de95264986d95889fb60e84629c9bd9a5acb1cc118be563eb9b3a4a472f82e09a7e778492b562ef7130e88dfe031c79db9d4f7c7a899151b9a475032b63fc385245fe054e3dd5a97a5f576fe064025d3ce042c566ab2c507b138db853e3d6959660996546cc9c4a6eafdc777c040d70eaf46f76dad3979e5c5360c3317166a1c894c94a371876a94df7628fe4eaaf2ccb27d5aaae0ad7ad0f9d4b6ad3b54098746d4524d38407a6deb3ab78fab78c9",
"ff0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
"6f5ef19ed6f1a5e2db2b119494f21d8c2de638a4c6ec3b5b4d43f3196152ea10",
"3940c1184442315c7340b89171039acb48f95287e66e56f7afa7cf00f95044d26fb69d46ac5c16a2d57a1cadc39160644717559e73480734410a3f543c5f231a7d7ed77af2a64681f6a7417283cef85504ac5de9fdea100e6c67ef7a1bfcd888a92a5f1ef2c9074b44b572aa748f29ff61a850ce40470004dff5cc1d926c5abe25ace47a12c5373094a26bab027e008154fb630aa062490b5421e96691a3f79557f7a79e3cfd9100796671ea241703ddf326f113adf1694bbd6e0ca032e16f936e7bfbf174e7ef4af5b53a6a9102e6fa41a8e589290f39a7bc7a6003088c612a43a36c2e9f2e740797ad3a2a1a80e0f67157fb9abc40487077368e94751a266a0b2dac4d382097b958da569f3b6fae3faaaaf2",
"bcc270293211abbeac7a26af3f3d200f8ce44de3d3e86cdbf449dcf7fedb7b5a489629deaae0c87471b1331b2fce7aba3dfabf6f1867e1a534cececba0cdc9e6150e92cb145567401f08778eeb646b2a70165061423b30ca21e754d3e0a0db4de59dd74093b0fc0fc78a598d522571525ab172592620f770b3303c65ee4a35504e4991e8f1d8904c9679824140642c70a184b4449d1ffdf11b8bee4e831a5b3d986006f5119a0912bacb939886abcb279be2437ecbf1f56528ef397f6459f0fd895031c7a8a2a815a3e68199dc1a9b0c7fef3df72c470f9e8e5524049e7e712da407a6b8ab9a3c0a4ae40cc187952b1062e646b8aebc2808a381530791e46b7220a1afd31f9f544f9ae60720005dca1ded9ac6");
"2db339c8500d35db91994138b4ab5e698086b4ec7fb66e75d083b18f84a9da7d696be75c349cb1555a58f65f123d4b68e2be2277fd7b38ba26ad93040a22ac8f7782b00d75c7650dcff0442f7ef91980aaabecb2c8cefec5d5eb9d495b5e1768fe316ec2a0d69d46b7289cd2e2049f27d30a6183605651d48ac40e0d06af9ec7012d477e473f2af7842335c36acf4f5bdef45605ca243b9007b5363f095850a78945508cf3fa191b8fe7fc5359d6e00741e6504f1d50904152622f4c0bdeaa0745f00d28b995543621c96d9d9d30fa1fbf403b19a716411b1700e8401a3e1e01bb1546653fbda19d83ba5e561695baea229880ff33058f85754fe9fdc09db4491f47ae0623cf23941a59b7c7dc6cad9bd97cc1");
}

BOOST_AUTO_TEST_CASE(countbits_tests)
5 changes: 1 addition & 4 deletions src/test/fuzz/crypto_bip324_suite.cpp
Original file line number Diff line number Diff line change
@@ -29,10 +29,7 @@ FUZZ_TARGET(crypto_bip324_suite)
get_key(fdp, key_L);
get_key(fdp, key_P);

std::array<std::byte, BIP324_REKEY_SALT_LEN> rekey_salt;
get_key(fdp, rekey_salt);

BIP324CipherSuite suite(key_L, key_P, rekey_salt);
BIP324CipherSuite suite(key_L, key_P);

size_t contents_size = fdp.ConsumeIntegralInRange<size_t>(0, 4096);
std::vector<std::byte> in(BIP324_LENGTH_FIELD_LEN + BIP324_HEADER_LEN + contents_size + RFC8439_EXPANSION, std::byte{0x00});
Loading