-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve code quality on modes of operation #80
Labels
Comments
marsella
added a commit
that referenced
this issue
Jun 28, 2024
marsella
added a commit
that referenced
this issue
Jun 28, 2024
- Rewrite CTR mode to be in terms of the `CipherInterface` - Update CTR mode to more closely match the original spec (naming, parameter order, etc.), and add docs for deviations - Adds top-level documentation on deviations from the original spec and warnings for failure modes that cryptol cannot detect - Rearranges instantiations and test vectors for AES (including adding more test vectors)
marsella
added a commit
that referenced
this issue
Jul 1, 2024
marsella
added a commit
that referenced
this issue
Jul 1, 2024
- Adds a type constraint that ensures messages are not so long that we'd reuse counters within a single encryption.
marsella
added a commit
that referenced
this issue
Jul 2, 2024
mccleeary-galois
added
enhancement
New feature or request
good first issue
Good for newcomers
labels
Aug 8, 2024
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
The previous implementation of CBC (not yet removed) takes as input a keysize and an encrypt/decrypt function, and hardcodes the IV and block size to 128 bits. Instead, we'd like to make use of CipherInterface, which makes it easier to instantiate CBC with different block ciphers (and without any hardcoded assumptions on the block size). Removal of the old implementation and updating module-level comments is reserved for future commits
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
Further tests the new CipherInterface implementation of CBC by instantiating it with AES128. The instantiation can be imported from: Primitive::Symmetric::Cipher::Block::Instantiations::AES128_CBC
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
Now that we've established Modes/CBC.cry, Instantiations/AES128_CBC.cry, and Tests/TestAES_CBC.cry as the CBC implementation, instantiation, and testing, we can remove the old implementations.
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
Comment updated to follow format set throughout cryptol-specs.
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
staslyakhov
added a commit
that referenced
this issue
Aug 26, 2024
staslyakhov
added a commit
that referenced
this issue
Aug 28, 2024
* Mention Appendix D that discusses what can go wrong if the IV is predictable. * Emphasize that cryptol cannot check that IVs were generated correctly.
staslyakhov
added a commit
that referenced
this issue
Aug 28, 2024
* Match variable capitalization * Use C_j_1 instead of c' to refer to $C_{j-1}$
marsella
added
improvement
Addresses fixes or changes to existing specs
and removed
enhancement
New feature or request
labels
Aug 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
We have implementations of most of the modes of operations for block ciphers based on NIST 800-38A (and I think some subsequent publications) but they're not very formal. There are a couple things to do here.
On the presentation side:
Modes
directoryand is instantiated just for AES, instead of generically(edit: I realized key wrap is an AES-only mode; see also Genericize key wrap modes of operation #81). Authenticated modes of operation are underAuthenticated/
instead ofBlock/Modes/
. Modes of operation are interspersed with instantiations and implementations for specific block ciphers. I think it would be nice to either update the organization or have a README pointing users to available ciphers and modes, briefly explaining what guarantees different modes get you (confidentiality, integrity, side-channel security...), and sharing which modes have been concretely instantiated for which block ciphers.On the engineering side, there are several possible changes to make.
Cipher
type that encodes the key size and type of the encryption/decryption methods which is sufficient for almost all modes of operation, except GCM-SIV. We should consider rewriting the modes in terms of Cipher, somehow.Related issue: #82
CipherInterface
CipherInterface
CipherInterface
and make follow-up issuesThe text was updated successfully, but these errors were encountered: