You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The HQC post quantum KEM implementation in both Java and C# are not matching the reference implementation for round 4 https://pqc-hqc.org/implementation.html. A sigma variable was added on round 3 (2023/04/30) to provide explicit rejection. bouncy castle implementations instead return ss=0 when decapsulation failed
Be aware that there are 2 bugs in this part of the reference implementation (not fixed yet) that make it deviate from the specifications (GHSA-gpf4-vrrw-r8v7).
Also, the code is using non constant time comparison for u, v and d with Arrays.equal where the reference implementation (even in round 3) use constant time comparison with vect_compare.
The HQC post quantum KEM implementation in both Java and C# are not matching the reference implementation for round 4 https://pqc-hqc.org/implementation.html. A sigma variable was added on round 3 (2023/04/30) to provide explicit rejection. bouncy castle implementations instead return
ss=0
when decapsulation failedbc-java/core/src/main/java/org/bouncycastle/pqc/crypto/hqc/HQCEngine.java
Lines 266 to 273 in c349210
Be aware that there are 2 bugs in this part of the reference implementation (not fixed yet) that make it deviate from the specifications (GHSA-gpf4-vrrw-r8v7).
Also, the code is using non constant time comparison for u, v and d with
Arrays.equal
where the reference implementation (even in round 3) use constant time comparison withvect_compare
.bc-java/core/src/main/java/org/bouncycastle/pqc/crypto/hqc/HQCEngine.java
Lines 251 to 264 in c349210
I don't report this as a security issue as bouncycastle's website states these are
available for experimenting
.Célian Glénaz (Quarkslab)
The text was updated successfully, but these errors were encountered: