awslabs / bike-kem

Additional implementation of BIKE (Bit Flipping Key Encapsulation)
Apache License 2.0
45 stars 11 forks source link

Eliminate secret-index array accesses and unnecessary static assert #18

Closed SWilson4 closed 6 months ago

SWilson4 commented 6 months ago

Issue #, if available:

https://github.com/open-quantum-safe/liboqs/issues/1624

Description of changes:

This PR addresses two issues which were caught by liboqs automated constant-time testing. One of these involved a number of secret-dependent array accesses in gf2x_mul_base_portable. This can be fixed by putting the array accesses inside short loops and using a mask. The second involved an unnecessary static_assert statement; the fix was to remove it.

See also the analogous liboqs PR: https://github.com/open-quantum-safe/liboqs/pull/1632

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

dkostic commented 6 months ago

@SWilson4 thanks for fixing the issue!