• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rust-bitcoin / rust-bitcoin / 15045337466
83%

Build:
DEFAULT BRANCH: master
Ran 15 May 2025 12:47PM UTC
Jobs 1
Files 130
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 May 2025 12:47PM UTC coverage: 84.614% (+0.01%) from 84.601%
15045337466

push

github

apoelstra
Merge rust-bitcoin/rust-bitcoin#4083: Improve chacha20 cipher performance

<a class=hub.com/rust-bitcoin/rust-bitcoin/commit/<a class="double-link" href="https://git"><a class=hub.com/rust-bitcoin/rust-bitcoin/commit/1ca55ac77db698f3816d8b7ed4051ddb5a579a29">1ca55ac77<a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/35a49993c8cc10132369b193a9c09a8e449159b6"> chacha20_poly1305: inline simd functions (Nick Johnson)
<a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/30920c4d849cf25ae3847b51380b90aa331f903f">30920c4d8</a><a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/35a49993c8cc10132369b193a9c09a8e449159b6"> chacha20_poly1305: drop mutable requirement (Nick Johnson)
</a><a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/415945cd2b3f4bd40f6c15e359ea241ed7b4f2d4">415945cd2</a><a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/35a49993c8cc10132369b193a9c09a8e449159b6"> chacha20_poly1305: avoid duplicate block work (Nick Johnson)
</a><a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/33dc1b95fa282ec1fe9706525f1a38ee611b7915">33dc1b95f</a><a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/35a49993c8cc10132369b193a9c09a8e449159b6"> chacha20_poly1305: swap tuple for array (Nick Johnson)
</a><a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/dadd1d72248015450fe6f898cd999ac54ff34aec">dadd1d722</a><a href="https://github.com/rust-bitcoin/rust-bitcoin/commit/35a49993c8cc10132369b193a9c09a8e449159b6"> chacha20_poly1305: remove alignment (Nick Johnson)
</a><a class="double-link" href="https://github.com/rust-bitcoin/rust-bitcoin/commit/36d45bf360b4fff069203a86e3429831babe5e5d">36d45bf36</a> chacha20_poly1305: remove mod operator (Nick Johnson)

Pull request description:

  Inspired by JeremiahR's new benchmark on the chacha20 module, I dug in and found a few tweaks (and a larger refactor) which help a lot with performance.

  The tweaks are broken down by commit. One of the relatively fruitful ones (5% increase) was refactoring the U32x4's rotation methods to use hardcoded matches instead of the mod operator. Others saw more modest performance gains.

  The big change though was to *not* calculate two blocks for each keystream call (oops). I refactored the logic to handle the offset state (which is technically not required for BIP324, but as seen here, can be confusing to not have) and now we always calculate just the required amount of a keystream. This about doubles the performance.

  For the curious, the SIMD performance isn't very impressive at this point, just a modest increase. But I have some hope that the experimental core library U32x4 will bring a nice bump (it is implemented with some unsafe hacking) and be an easy refactor.

ACKs for top commit:
  apoelstra:
    ACK 1ca55ac77db698f3816d8b7ed4051ddb5a579a29; successfully ran local tests
  tcharding:
    ACK 1ca55ac77db698f3816d8b7ed4051ddb5a579a29

Tree-SHA512: 8db1c6144d06b5cccdae233caf8f7019684

83 of 87 new or added lines in 2 files covered. (95.4%)

23334 of 27577 relevant lines covered (84.61%)

16053.34 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
97.75
-0.79% chacha20_poly1305/src/chacha20.rs
1
56.38
0.0% chacha20_poly1305/src/lib.rs
Jobs
ID Job ID Ran Files Coverage
1 15045337466.1 15 May 2025 12:47PM UTC 130
84.61
GitHub Action Run
Source Files on build 15045337466
  • Tree
  • List 130
  • Changed 3
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #15045337466
  • 35a49993 on github
  • Prev Build on master (#15031516188)
  • Next Build on master (#15052275701)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc