Skip to content

Conversation

@kornelski
Copy link
Collaborator

MlKemParams is an enum, which means it's fully public, and can't have any private fields to store any other params in the future. These two data-less variants it's all it can have.

MlKem doesn't have its own state other than the params. Given that the params are trivial and non-extensible, this makes MlKem::new(params) pretend to be more than it can be. It's not constructing any object, it's just indirection for the params (calling ffi::init() is handled by keys' functions anyway).

So I've made MlKemParams and MlKem the same thing. mlkem::MlKem::MlKem768 is repetitive, so I've renamed MlKem(Params) to Algorithm. It can be used as mlkem::Algorithm where the context is needed.

@kornelski kornelski merged commit 1722cc7 into master Feb 3, 2026
25 checks passed
@kornelski kornelski deleted the mlkem branch February 3, 2026 14:43
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 this pull request may close these issues.

3 participants