ocb3: improve handling of L values
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Refactor
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- rust
- Domain
- cryptography
Research direction
Start by locating cipher initialization and the encrypt/decrypt paths that use the pre-computed L table. Compare the three proposed strategies for runtime table sizing, stack allocation, and on-the-fly computation. Done means messages needing larger tables are handled without the current fixed-size limitation and the mode struct/API concerns are addressed.
Written by the indexing model from the issue text.
Description
Right now we pre-compute L values during cipher initialization. Size of the table is regulated by the const generic parameter and the mode instance can not process messages which require larger tables. Arguably, it's a quite leaky API especially considering somewhat subpar handling of default constants/types in Rust. The cached table can also significantly increase size of the mode struct.
Computation of one L value is just a relatively cheap DBL operation, so I think improve handling in one of the following ways:
- Re-compute the L table on each encrypt/decrypt call with table size computed at runtime depending on the message/AAD size. Since we don't have alloca in Rust, we can allocate a sufficiently large array on stack and initialize it only partially.
- Pre-compute a small table (e.g. sufficient for 1 MiB) and compute additional values at runtime if necessary by copying cached values to stack-based array and re-computing the rest.
- Pre-compute a small table and re-compute additional values on the fly if necessary from the last cached value.
- Dominant language
- Rust
- Stars
- 961
- Forks
- 200
- Avg merge
- 1h 30m
- Merged PRs (30d)
- 6
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.
More from RustCrypto/AEADs
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
RustCrypto/AEADs#864 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
RustCrypto/AEADs#755 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
RustCrypto/AEADs#706 · 1 comment · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
RustCrypto/AEADs#660 · 7 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
RustCrypto/AEADs#628 · 2 comments · 1 reaction ·
All issues in RustCrypto/AEADs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100