merge bitcoin#28951: damage ciphertext/aad in full byte range

This commit is contained in:
Kittywhiskers Van Gogh 2023-11-28 02:08:57 +01:00
parent 4e96e261e0
commit 92e862acb2
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -94,7 +94,7 @@ FUZZ_TARGET_INIT(bip324_cipher_roundtrip, initialize_bip324)
unsigned damage_bit = provider.ConsumeIntegralInRange<unsigned>(0,
(ciphertext.size() + aad.size()) * 8U - 1U);
unsigned damage_pos = damage_bit >> 3;
std::byte damage_val{(uint8_t)(1U << (damage_bit & 3))};
std::byte damage_val{(uint8_t)(1U << (damage_bit & 7))};
if (damage_pos >= ciphertext.size()) {
aad[damage_pos - ciphertext.size()] ^= damage_val;
} else {