Skip to content

Commit

Permalink
merge bitcoin#28951: damage ciphertext/aad in full byte range
Browse files Browse the repository at this point in the history
  • Loading branch information
kwvg committed Oct 15, 2024
1 parent 4e96e26 commit 92e862a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/test/fuzz/bip324.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 92e862a

Please sign in to comment.