Masked Vector Sampling for HQC
Résumé
Anticipating the advent of large quantum computers, NIST started a worldwide competition in 2016 aiming to define the next cryptographic standards. HQC is one of these post-quantum schemes selected for standardization. In 2022, Guo et al. introduced a timing attack that exploited a weakness in HQC rejection sampling function to recover its secret key in 866,000 calls to an oracle. The authors of HQC updated its specification by applying an algorithm to sample vectors in constant time. A masked implementation of this function was later proposed for BIKE but it is not directly applicable to HQC. In this paper we propose a specification-compliant masked version of the HQC vector sampling which relies, to our knowledge, on the first masked implementation of the Barrett reduction.