memsan: enable kyber in bench

This commit is contained in:
Henry Case 2021-06-24 08:06:19 +01:00
父節點 ea54cd3ea9
當前提交 e4eff10297
共有 4 個檔案被更改,包括 4 行新增8 行删除

查看文件

@ -289,7 +289,7 @@ void PQCLEAN_KYBER512_AVX2_indcpa_enc(uint8_t c[KYBER_INDCPA_BYTES],
const uint8_t coins[KYBER_SYMBYTES]) {
unsigned int i;
uint8_t seed[KYBER_SYMBYTES];
polyvec sp, pkpv, ep, at[KYBER_K], b;
polyvec sp, pkpv, ep, at[KYBER_K], b = {0};
poly v, k, epp;
unpack_pk(&pkpv, seed, pk);

查看文件

@ -51,9 +51,9 @@ int PQCLEAN_KYBER512_AVX2_crypto_kem_keypair(unsigned char pk[KYBER_PUBLICKEYBYT
int PQCLEAN_KYBER512_AVX2_crypto_kem_enc(unsigned char ct[KYBER_CIPHERTEXTBYTES],
unsigned char ss[KYBER_SSBYTES],
const unsigned char pk[KYBER_PUBLICKEYBYTES]) {
uint8_t buf[2 * KYBER_SYMBYTES];
uint8_t buf[2 * KYBER_SYMBYTES] = {0};
/* Will contain key, coins */
uint8_t kr[2 * KYBER_SYMBYTES];
uint8_t kr[2 * KYBER_SYMBYTES] = {0};
randombytes(buf, KYBER_SYMBYTES);
/* Don't release system RNG output */

查看文件

@ -182,7 +182,7 @@ void PQCLEAN_KYBER512_AVX2_polyvec_invntt_tomont(polyvec *r) {
**************************************************/
void PQCLEAN_KYBER512_AVX2_polyvec_basemul_acc_montgomery(poly *r, const polyvec *a, const polyvec *b) {
size_t i;
poly tmp;
poly tmp = {0};
PQCLEAN_KYBER512_AVX2_poly_basemul_montgomery(r, &a->vec[0], &b->vec[0]);
for (i = 1; i < KYBER_K; i++) {

查看文件

@ -59,7 +59,6 @@ static void BenchKyberKeygen(benchmark::State &st) {
cpucycle(st, total);
}
#ifndef PQC_MEMSAN_BUILD
static void BenchKyberEncaps(benchmark::State &st) {
int64_t t, total = 0;
uint8_t sk[1632];
@ -92,7 +91,6 @@ static void BenchKyberDecaps(benchmark::State &st) {
}
cpucycle(st, total);
}
#endif
static void BenchKyberBaseMulAVX(benchmark::State &st) {
int64_t t, total = 0;
@ -126,7 +124,5 @@ BENCHMARK(BenchKyberBaseMulAVX);
BENCHMARK(BenchKyberNttAVX);
// TODO: not sure why but memcheck fails in INDCPA encryption
#ifndef PQC_MEMSAN_BUILD
BENCHMARK(BenchKyberEncaps);
BENCHMARK(BenchKyberDecaps);
#endif