Skip to content

Commit

Permalink
wolfcrypt/src/wc_kyber.c: in kyberkey_encapsulate(), don't overalloca…
Browse files Browse the repository at this point in the history
…te "at" for USE_INTEL_SPEEDUP.
  • Loading branch information
douzzer committed Aug 15, 2024
1 parent 7a29b1e commit a2acc41
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions wolfcrypt/src/wc_kyber.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,8 @@ static int kyberkey_encapsulate(KyberKey* key, const byte* msg, byte* coins,

if (ret == 0) {
/* Allocate dynamic memory for all matrices, vectors and polynomials. */
#ifndef USE_INTEL_SPEEDUP
at = (sword16*)XMALLOC(((kp + 3) * kp + 3) * KYBER_N * sizeof(sword16),
key->heap, DYNAMIC_TYPE_TMP_BUFFER);
#else
at = (sword16*)XMALLOC(
((KYBER_MAX_K + 3) * KYBER_MAX_K + 3) * KYBER_N * sizeof(sword16),
key->heap, DYNAMIC_TYPE_TMP_BUFFER);
#endif
if (at == NULL) {
ret = MEMORY_E;
}
Expand Down

0 comments on commit a2acc41

Please sign in to comment.