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

Evaluate whether compilation introduces a secret-dependent branch #25

Open
bifurcation opened this issue Jun 3, 2024 · 2 comments
Open

Comments

@bifurcation
Copy link
Contributor

The Kyber reference implementation has a vulnerability resulting from clang introducing a secret-dependent branch. The affected function there is poly_frommsg. The analogous function in our ML-KEM implementation is Encode::<U1>::decode. We should make sure that Rust compilation does not introduce secret-dependent branches.

@bifurcation
Copy link
Contributor Author

I mocked this up in Godbolt and on a quick skim, I don't see any branching instructions. So maybe we're OK here. Would appreciate review by someone else, though.

@tarcieri
Copy link
Member

tarcieri commented Jun 3, 2024

Perhaps the subtle or cmov crates could be helpful?

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

No branches or pull requests

2 participants