Skip to content

Conversation

@kornelski
Copy link
Collaborator

@kornelski kornelski commented Feb 10, 2026

It's scary that the MLKEM768_generate_key is a void function without ability to report an error. This adds a check that some seed/secret parseable public key has actually been written.

@bwesterb
Copy link
Member

bwesterb commented Feb 10, 2026

Why is it scary?

Copy link
Member

@bwesterb bwesterb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timing side channel

@bwesterb
Copy link
Member

Still not safe.

@bwesterb
Copy link
Member

We really shouldn't write this needless code. It's only more chances to get things wrong.

@kornelski
Copy link
Collaborator Author

ok, fine. I've removed the check for all-0 keys. Now it's just a good'ol error handling bugfix.

@kornelski
Copy link
Collaborator Author

BTW, why using CRYPTO_memcmp for comparison still wasn't safe?

@bwesterb
Copy link
Member

CRYPTO_memcmp is safe. I read too quickly and thought you were calling this.

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.

2 participants