Merge bitcoin/bitcoin#30826: fuzz: reduce number of iterations in crypto_aeadchacha20poly1305 target

f482d0e366 fuzz: reduce number of iterations in `crypto_aeadchacha20poly1305` target (brunoerg)

Pull request description:

  By reducing the number of iterations we improve the performance of this target and may increase coverage.

  Running with `-runs=100000` from qa-assets I noticed a significant performance improvement and an increase on cov:
  master:
  ```
  #100000 DONE   cov: 567 ft: 4078 corp: 124/33Kb lim: 4096 exec/s: 793 rss: 499Mb
  ```

  PR:
  ```
  #100000 DONE   cov: 568 ft: 3833 corp: 113/15188b lim: 1746 exec/s: 1250 rss: 544Mb
  ```

ACKs for top commit:
  achow101:
    ACK f482d0e366
  marcofleon:
    Tested ACK f482d0e366. Saw the same slight increase in coverage. Executed 100,000 runs several times and total time went from 30-35 sec to 20-25 sec.
  stratospher:
    ACK f482d0e. saw similar coverage stats

Tree-SHA512: 1a96dbc22a0aed396b7f8cc9b13534b7f20a461f64f167c69c650529d535e360499f1a501abc1f957f7541ee1860b36a5580aa488a1edbfa0270c9ed83ef741d
This commit is contained in:
Ava Chow 2024-09-20 13:55:51 -04:00
commit f57a6754ed
No known key found for this signature in database
GPG key ID: 17565732E08E5E41

View file

@ -39,7 +39,7 @@ FUZZ_TARGET(crypto_aeadchacha20poly1305)
// data).
InsecureRandomContext rng(provider.ConsumeIntegral<uint64_t>());
LIMITED_WHILE(provider.ConsumeBool(), 10000)
LIMITED_WHILE(provider.ConsumeBool(), 100)
{
// Mode:
// - Bit 0: whether to use single-plain Encrypt/Decrypt; otherwise use a split at prefix.