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

Add input validation functions and docs to ML-KEM #149

Open
6 of 8 tasks
marsella opened this issue Oct 3, 2024 · 0 comments
Open
6 of 8 tasks

Add input validation functions and docs to ML-KEM #149

marsella opened this issue Oct 3, 2024 · 0 comments
Assignees
Labels
CNSA 2.0 improvement Addresses fixes or changes to existing specs

Comments

@marsella
Copy link
Contributor

marsella commented Oct 3, 2024

The current implementation of ML-KEM does not quite align with the spec. The spec defines "internal" functions that run the actual computations, and "external" functions that require input validation and sample / check randomness in a specific way. We have functions whose names match the "external" functions but implementation and docs match the "internal" ones. We also don't have any of the required input validation implemented.

This is for the Encaps, Decaps, and Keygen functions in ML-KEM.

  • Rename existing functions to _internal and update docs accordingly
  • Make non-suffix "external" functions that (a) throw an error if the randomness is not suitable and (b) document the required input validation
  • Make (public) input validation functions
    • Key pair check in 7.1
    • Encapsulation key check in 7.2
    • Decapsulation input check in 7.3
  • Add properties of input validation functions (e.g. that outputs from the ml kem functions are valid)
  • Make sure documentation across the board is clear about failure cases if you don't validate input. Also, add big warnings about randomness generation that Cryptol cannot do itself.
@marsella marsella added CNSA 2.0 improvement Addresses fixes or changes to existing specs labels Oct 3, 2024
@marsella marsella self-assigned this Nov 5, 2024
marsella added a commit that referenced this issue Nov 5, 2024
marsella added a commit that referenced this issue Nov 5, 2024
- Replace calls by other modules to internal version with external
  versions
- minor clean-up of internal version
marsella added a commit that referenced this issue Nov 5, 2024
- Replace calls by other modules to internal version with external
  versions
- minor clean-up of internal version
marsella added a commit that referenced this issue Nov 5, 2024
- Replace calls by other modules to internal version with external
  versions
- minor clean-up of internal version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CNSA 2.0 improvement Addresses fixes or changes to existing specs
Projects
None yet
Development

No branches or pull requests

1 participant