AES Lightengine CFB mode - #108
Closed
officialfrancismendoza wants to merge 32 commits into
Closed
officialfrancismendoza wants to merge 32 commits into
officialfrancismendoza wants to merge 32 commits into
Conversation
…d build workspace (bcgit#45)
…sts' of github.com:officialfrancismendoza/bc-rust into officialfrancismendoza-feature/officialfrancismendoza/45-githu
…row in the future.
…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>
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuing developing the aes-lowmemory crate, added CFB mode and associated tests (#103)