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
7 tasks
marsella opened this issue Oct 3, 2024 · 0 comments
Open
7 tasks

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

marsella opened this issue Oct 3, 2024 · 0 comments
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
  • 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
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