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

Separate K-PKE scheme in ML-KEM #145

Closed
7 tasks done
marsella opened this issue Oct 2, 2024 · 0 comments · Fixed by #154
Closed
7 tasks done

Separate K-PKE scheme in ML-KEM #145

marsella opened this issue Oct 2, 2024 · 0 comments · Fixed by #154
Assignees
Labels
CNSA 2.0 good first issue Good for newcomers improvement Addresses fixes or changes to existing specs

Comments

@marsella
Copy link
Contributor

marsella commented Oct 2, 2024

Right now the ML-KEM scheme has all of its functions inline. The K-PKE scheme is a sub-scheme that's used to implement ML-KEM, but cannot be used on its own. It would be good to separate these functions into their own submodule so that they are more obviously self contained, not the ML-KEM scheme, and not available for use outside of the module.

While we're moving around all the K-PKE stuff, we should also make a point to bring it up to our gold standard. Some suggestions are here, but this list isn't necessarily exhaustive.

  • Make a K-PKE submodule in the ML-KEM specification. Remove the K_PKE_ prefix on the functions and update the calls to use the module path (K_PKE::KeyGen) instead.
  • Write top-level docs for submodule explaining the limitations (doesn't do any input validation) and with loud warnings against using this outside the ML-KEM context.
    • Also make sure function-level docs have all appropriate warnings.
  • Update the code to more obviously match the spec (there's not that much to do, I think)
    • Move the XOF call into SampleNTT
    • Consider making an EncryptionKey and DecryptionKey type to use in type sigs
    • Add inline docs to label the steps of each algorithm
@marsella marsella added good first issue Good for newcomers CNSA 2.0 improvement Addresses fixes or changes to existing specs labels Oct 2, 2024
marsella added a commit that referenced this issue Oct 10, 2024
marsella added a commit that referenced this issue Oct 10, 2024
- Adds whitespace (inline and to get 4-space tabs)
- Removes extra type annotations, commas, etc.
- Removes unnecessary tuples from parameters of kpke functions
marsella added a commit that referenced this issue Oct 10, 2024
@marsella marsella self-assigned this Oct 10, 2024
marsella pushed a commit that referenced this issue Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CNSA 2.0 good first issue Good for newcomers improvement Addresses fixes or changes to existing specs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant