Skip to content

[Breaking draft] Tweak block::Generator to support fast-key-erasure - #81

Draft
dhardy wants to merge 5 commits into
masterfrom
push-qqklxsquuowp
Draft

[Breaking draft] Tweak block::Generator to support fast-key-erasure#81
dhardy wants to merge 5 commits into
masterfrom
push-qqklxsquuowp

Conversation

@dhardy

@dhardy dhardy commented Aug 20, 2026

Copy link
Copy Markdown
Member
  • Added a CHANGELOG.md entry

Summary

Tweak the block::Generator trait to support fast-key-erasure: RustCrypto/stream-ciphers#578

Also removes BlockRng::{reconstruct, remaining_results} since to my knowledge these are only used by the (mostly abandoned) Isaac generators.

Motivation

It turns out we can fit a low-overhead fast-key-erasure generator into our existing ecosystem with only some small tweaks here. (Larger changes to the block code may be warranted; this is more a proof-of-concept with minimal changes.)

Details

  • Add associated type Generator::Word. Note that we require (without trait bound) that Generator::Output is [Word; N] for some N and that N is not currently an associated constant; ideally we'd add N and remove Output but this requires improved const generics support IIRC.
  • Add fn Generator::erase. Note that this does a different job to drop: erase is used for fast-erasure (only, and without feature requirements) while drop is used to zeroize the buffer on drop (if that feature is enabled).
  • Make fn Generator::generate return the index of the first available value in the buffer.

@dhardy
dhardy marked this pull request as draft August 20, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant