RustCrypto / RustCrypto/traits
cipher: Block alignment
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 755
- Forks
- 256
- Avg merge
- 1h 27m
- Merged PRs (30d)
- 2
Description
Some hardware implementations (e.g. of AES) need particular alignment of blocks to operate directly over AHB (e.g. NXP LPC55's HASHCRYPT wants 32-bit alignment, I can imagine this is a typical case for ARM microcontrollers). If a large chunk of data needs to be en/de-crypted that's aligned, it would be neat to pass this information through on the type level to avoid stack copies for each block.
The aligned crate (which is sadly missing an A1 type) would be one approach to do it, set
pub type Block<B> = aligned::Aligned<
<B as BlockCipher>::BlockAlignment,
GenericArray<u8, <B as BlockCipher>::BlockSize>
>;
Splitting this out from https://github.com/RustCrypto/traits/issues/43 for possible discussion.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related discussion in RustCrypto/traits issue #43 and this issue's proposal involving Block, BlockCipher, GenericArray, and the aligned crate. Determine whether block alignment belongs in the trait API and what compatibility constraints apply. Done means a decided design and agreed scope for exposing alignment without per-block stack copies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cryptography
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100