Pārlūkot izejas kodu

memsan: enable kyber in bench

blog/frodo_constant_time_issue
Henry Case pirms 3 gadiem
vecāks
revīzija
e4eff10297
4 mainītis faili ar 4 papildinājumiem un 8 dzēšanām
  1. +1
    -1
      src/kem/kyber/kyber512/avx2/indcpa.c
  2. +2
    -2
      src/kem/kyber/kyber512/avx2/kem.c
  3. +1
    -1
      src/kem/kyber/kyber512/avx2/polyvec.c
  4. +0
    -4
      test/bench/kyber.cc

+ 1
- 1
src/kem/kyber/kyber512/avx2/indcpa.c Parādīt failu

@@ -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);


+ 2
- 2
src/kem/kyber/kyber512/avx2/kem.c Parādīt failu

@@ -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 */


+ 1
- 1
src/kem/kyber/kyber512/avx2/polyvec.c Parādīt failu

@@ -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++) {


+ 0
- 4
test/bench/kyber.cc Parādīt failu

@@ -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

Notiek ielāde…
Atcelt
Saglabāt