Skip to content

Conversation

@kornelski
Copy link
Collaborator

On top of #460.

Having all functions attached to one type forces the implementation take keys as arguments. Since there were no types for the keys, the key material had to be handled as bare byte slices.

I've changed it to a more conventional split between private and public key types. They still contain an enum inside to handle both algorithms at run time.

These keys are relatively big (7KB), so I've boxed them internally to avoid returning unusually large stack objects to the user.

I've looked into using MlKem<Private>/MlKem<Public> for similarity with Rsa type, but the underlying implementation is quite different, so there isn't anything obvious to reuse. Having a type like MlKem<768, Public> would be neat, but functionally isn't necessary, I didn't want to overcomplicate this. More specific or flexible types can be added later if needed, and they can be backwards compatible by making type aliases for them.

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.

1 participant