Skip to content

AES Lightengine CFB mode - #108

Closed
officialfrancismendoza wants to merge 32 commits into
bcgit:mainfrom
officialfrancismendoza:feature/officialfrancismendoza/103-AES-lightengine-CFB-mode
Closed

officialfrancismendoza wants to merge 32 commits into
bcgit:mainfrom
officialfrancismendoza:feature/officialfrancismendoza/103-AES-lightengine-CFB-mode

Conversation

@officialfrancismendoza

Copy link
Copy Markdown
Contributor

Continuing developing the aes-lowmemory crate, added CFB mode and associated tests (#103)

officialfrancismendoza and others added 30 commits July 17, 2026 03:20
…sts' of github.com:officialfrancismendoza/bc-rust into officialfrancismendoza-feature/officialfrancismendoza/45-githu
…ecrets, but does not need to be anymore. And some other cosmetic refactoring.
…ptor

Rework the block cipher streaming traits ahead of the first mode
implementations:

- Split the single BlockCipher trait into BlockCipherEncryptor and
  BlockCipherDecryptor (mirroring KEMEncapsulator/KEMDecapsulator) so
  the direction can be encoded in the implementing type. A minimal
  BlockCipher supertrait carries the shared MAX_SECURITY_STRENGTH.
  The SymmetricCipher one-shot API is no longer a supertrait.
- Replace the single-block do_{en,de}crypt_block[_out] with
  do_{en,de}crypt_blocks[_out]<const N>, taking &[[u8; BLOCK_LEN]; N]
  so the block count is compile-time and in/out lengths cannot
  disagree.
- Add do_encrypt_init_rng(key, &mut dyn RNG) alongside do_encrypt_init,
  matching the encaps/encaps_rng pattern.
- Remove the do_{en,de}crypt_final[_out] methods. The traits are now
  strictly block-aligned; padding of arbitrary-length data belongs to
  a separate PaddedEncryptor/PaddedDecryptor layer to be built on top.

Update the core-test-framework block cipher test to take separate
encryptor/decryptor type parameters and to exercise N = 1 and N = 2,
including mixed single/multi-block encrypt vs decrypt sequences.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Formatting for the previous commit; no semantic change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…traits

Provided (default) methods on BlockCipherEncryptor -- encrypt_blocks,
encrypt_blocks_rng, encrypt_blocks_out, encrypt_blocks_out_rng -- and on
BlockCipherDecryptor -- decrypt_blocks, decrypt_blocks_out -- implemented
once in the trait as init + blocks, so every block-aligned mode gets the
house-standard take-data-return-result static API at no cost to
implementors. Arbitrary-length one-shots remain the padding layer's job.

The core-test-framework block cipher test now checks the one-shots agree
with the streaming API and round-trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@officialfrancismendoza

officialfrancismendoza commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor Author

Too many merge conflicts between this feature branch and rebasing off feature/aes-tweaks, so closing this and rebuilding CFB off that new feature branch (got reinstituted on #111 and then folded into #113)

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.

4 participants