fuzz: Improve the fuzz target for CCrypter #34111

pull Chand-ra wants to merge 2 commits into bitcoin:master from Chand-ra:crypter changing 1 files +30 −8
  1. Chand-ra commented at 8:53 am on December 19, 2025: none

    Add the following improvements to the fuzz target for CCrypter:

    • Add roundtrip assertions: Add verification logic by decrypting the resulting ciphertext from a successful call to Encrypt() or EncryptSecret() and verifying that the output matches the original plaintext.

    • Cover untested methods: Extend the target to explicitly test CCrypter::SetKey() and DecryptSecret().

  2. fuzz: Add roundtrip assertions to `crypter`
    Add verification logic to the `crypter` fuzz target by decrypting
    the resulting ciphertext from a successful call to `Encrypt()` or
    `EncryptSecret()` and verifying that the output matches the
    original plaintext.
    
    This ensures that the encryption/decryption cycle preserves data
    correctness, rather than just checking for execution crashes.
    ef0031651a
  3. fuzz: cover `SetKey()` and `DecryptSecret()` in `crypter`
    Extend the `crypter` fuzz target to cover `CCrypter::SetKey()` and
    `DecryptSecret()`.
    38c6ca7d75
  4. DrahtBot added the label Fuzzing on Dec 19, 2025
  5. DrahtBot commented at 8:53 am on December 19, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/34111.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    Concept NACK brunoerg

    If your review is incorrectly listed, please copy-paste <!–meta-tag:bot-skip–> into the comment that the bot should ignore.

  6. brunoerg commented at 6:08 pm on December 22, 2025: contributor

    Concept NACK

    We already have 100% coverage for wallet/crypter, see: https://maflcko.github.io/b-c-cov/fuzz.coverage/src/wallet/crypter.cpp.gcov.html.

    Also, we don’t need to cover DecryptSecret directly if this is already exercised by DecryptKey, same idea for SetKey. For reference, see #32118 which fixed this target and removed a direct call to DecryptSecret.

  7. Chand-ra commented at 6:13 am on December 23, 2025: none

    Concept NACK

    We already have 100% coverage for wallet/crypter, see: https://maflcko.github.io/b-c-cov/fuzz.coverage/src/wallet/crypter.cpp.gcov.html.

    Also, we don’t need to cover DecryptSecret directly if this is already exercised by DecryptKey, same idea for SetKey. For reference, see #32118 which fixed this target and removed a direct call to DecryptSecret.

    Makes sense. But shouldn’t making the encryption tests roundtrip better help in future regression catching?

    Closing the PR for now.

  8. Chand-ra closed this on Dec 23, 2025


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-12-31 06:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me