Skip to content
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

Refactor AES spec to meet "gold standard" requirements #77

Closed
8 tasks done
marsella opened this issue Jun 18, 2024 · 0 comments · Fixed by #92
Closed
8 tasks done

Refactor AES spec to meet "gold standard" requirements #77

marsella opened this issue Jun 18, 2024 · 0 comments · Fixed by #92
Assignees

Comments

@marsella
Copy link
Contributor

marsella commented Jun 18, 2024

The current AES spec doesn't quite meet the gold standard that we'd like to see for important cryptol specs. This concerns just "plain" AES -- the block cipher itself, not any modes of operation layered on top of it -- as described in FIPS-197.

Here are the tasks I'm pretty sure need to happen:

  • Convert to literate Cryptol -- determine whether we have access to a latex file of the spec -- EDIT: moved this to Convert AES to a literate spec #91
  • Update module structure to compile all the allowable key sizes by default (a la Kyber)
    • Uncomment all the test vectors for all the key sizes -- put them in each module
  • Determine whether any other aspects of the structure of the module needs to change to better match the spec
  • Double-check that every data type and function described in the spec has a cryptol corollary
  • Make sure every property in the spec has an equivalent cryptol property
  • Add a batch file to prove or check every property -- done as of Fix docstrings for AES & friends #105
  • Re-review the gold standard and determine whether anything else needs to change.
@marsella marsella self-assigned this Jun 21, 2024
marsella added a commit that referenced this issue Jun 21, 2024
marsella added a commit that referenced this issue Jun 24, 2024
this also refactors ctr mode
marsella added a commit that referenced this issue Jun 24, 2024
This has been fully replaced by the explicit parameterizations of AES
(AES128, AES256) in the internal codebase
marsella added a commit that referenced this issue Jun 24, 2024
- Creates a new specification functor that's generic over the key size
- Instantiates it for AES 128 and 256
- Adds one test vector; more to come!
marsella added a commit that referenced this issue Jun 24, 2024
This has been fully replaced by the explicit parameterizations of AES
(AES128, AES256) in the internal codebase
marsella added a commit that referenced this issue Jun 24, 2024
This has been fully replaced by the explicit parameterizations of AES
(AES128, AES256) introduced in 53d6e68 in the internal codebase
marsella added a commit that referenced this issue Jun 24, 2024
Previously, the AES.cry file was not super explicit about the fact that
it was parameterized only for AES 256. Now that we have concrete
instantiations for the three allowable key sizes, use them explicitly.

I locally spot-checked test vectors and properties where I could find
them to make sure that this didn't break anything.

There are some instances (key wrap) that use a specific key size for
AES, but which should actually support arbitrary key sizes. This will be
addressed separately. This maintains the status quo, since these
implementations previously did not actually support arbitrary key sizes.

Also, fixes a bug in DRBG, which was hard-coded to use AES128 but had
accidentally been switched to AES256 and broke.
marsella added a commit that referenced this issue Jun 26, 2024
- For human-readability, updates the type constraint on AES to be the key size,
  not the mode
- Makes `KeySize` a public type on the AES spec and replaces references
  to AesKeySize
- Updates AES-GCM-SIV to support multiple key sizes (fixing a bug
  intorduced in 8c14010)
marsella added a commit that referenced this issue Jul 5, 2024
- modifies the order a little bit
- adds documentation, esp. references to where things live in the spec.
marsella added a commit that referenced this issue Jul 5, 2024
- modify naming and call sites
- modifies the order a little bit
- adds documentation, esp. references to where things live in the spec.
marsella added a commit that referenced this issue Jul 8, 2024
We could always check the correctness properties too, but I added an
explicit check of the decryption method to each set of test vectors.
marsella added a commit that referenced this issue Jul 8, 2024
- Updates AES::Algorithm to use more spec-conformant names and improve
  documentation
- Fixes a bug in key expansion for decryption and simplify associated
  APIs
- Removes unnecssary parameterization in AES::Algorithm
marsella added a commit that referenced this issue Jul 9, 2024
- modify naming and call sites
- modifies the order a little bit
- adds documentation, esp. references to where things live in the spec.
marsella added a commit that referenced this issue Jul 9, 2024
We could always check the correctness properties too, but I added an
explicit check of the decryption method to each set of test vectors.
marsella added a commit that referenced this issue Jul 9, 2024
- Updates AES::Algorithm to use more spec-conformant names and improve
  documentation
- Fixes a bug in key expansion for decryption and simplify associated
  APIs
- Removes unnecssary parameterization in AES::Algorithm
marsella added a commit that referenced this issue Jul 10, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
- modify naming and call sites
- modifies the order a little bit
- adds documentation, esp. references to where things live in the spec.
marsella added a commit that referenced this issue Jul 15, 2024
We could always check the correctness properties too, but I added an
explicit check of the decryption method to each set of test vectors.
marsella added a commit that referenced this issue Jul 15, 2024
- Updates AES::Algorithm to use more spec-conformant names and improve
  documentation
- Fixes a bug in key expansion for decryption and simplify associated
  APIs
- Removes unnecssary parameterization in AES::Algorithm
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
also fix the spelling of Nichole's name.
marsella added a commit that referenced this issue Jul 15, 2024
- modify naming and call sites
- modifies the order a little bit
- adds documentation, esp. references to where things live in the spec.
marsella added a commit that referenced this issue Jul 15, 2024
We could always check the correctness properties too, but I added an
explicit check of the decryption method to each set of test vectors.
marsella added a commit that referenced this issue Jul 15, 2024
- Updates AES::Algorithm to use more spec-conformant names and improve
  documentation
- Fixes a bug in key expansion for decryption and simplify associated
  APIs
- Removes unnecssary parameterization in AES::Algorithm
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
marsella added a commit that referenced this issue Jul 15, 2024
also fix the spelling of Nichole's name.
marsella added a commit that referenced this issue Jul 17, 2024
Removes the `Round` module and some extraneous names that aren't in the
spec and don't add a significant amount of clarity.
marsella added a commit that referenced this issue Jul 17, 2024
Adds an explicit demo of how to prove / check each property
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 a pull request may close this issue.

1 participant