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

Potential compiler introduced timing leak #112

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

Potential compiler introduced timing leak #112

zugzwang opened this issue Jun 3, 2024 · 2 comments

Comments

@zugzwang
Copy link

zugzwang commented Jun 3, 2024

I haven't confirmed but it looks like this library is also vulnerable to https://groups.google.com/a/list.nist.gov/g/pqc-forum/c/hqbtIGFKIpU

See

r.coeffs[8 * i + j] = (mask & ((KYBER_Q + 1) / 2) as u16) as i16;

and the fix in the reference implementation pq-crystals/kyber@9b8d306

@zugzwang zugzwang changed the title Fix compiler introduced timing leak Potential compiler introduced timing leak Jun 3, 2024
@conradludgate
Copy link

conradludgate commented Jun 3, 2024

As a slight reassurance, godbolt doesn't demonstrate such a branch in the current rust code on x86_64, although still good to ensure that it won't in a future update to LLVM.

O3 - https://godbolt.org/z/jdT4dnvEr
Os - https://godbolt.org/z/YTsojG5xo

@bwesterb
Copy link
Contributor

Fixed in the safe_pqc_kyber 0.6.3+.

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

3 participants