Skip to content

Commit 42a0cb2

Browse files
authored
Merge pull request #7364 from gojimmypi/PR-Kyber-Init
Initialize some Kyber variables
2 parents 2f17b75 + 01ae240 commit 42a0cb2

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8437,7 +8437,7 @@ static int TLSX_KeyShare_ProcessPqc(WOLFSSL* ssl, KeyShareEntry* keyShareEntry)
84378437
XMEMCPY(ssl->arrays->preMasterSecret, keyShareEntry->ke,
84388438
keyShareEntry->keLen);
84398439
ssl->arrays->preMasterSz = keyShareEntry->keLen;
8440-
XFREE(keyShareEntry->ke, ssl->heap, DYNAMIC_TYPE_SECRET)
8440+
XFREE(keyShareEntry->ke, ssl->heap, DYNAMIC_TYPE_SECRET);
84418441
keyShareEntry->ke = NULL;
84428442
keyShareEntry->keLen = 0;
84438443
return 0;

wolfcrypt/src/wc_kyber.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -364,12 +364,12 @@ static int kyberkey_encapsulate(KyberKey* key, const byte* msg, byte* coins,
364364
unsigned char* ct)
365365
{
366366
int ret = 0;
367-
sword16* sp;
368-
sword16* ep;
369-
sword16* k;
370-
sword16* epp;
371-
unsigned int kp;
372-
unsigned int compVecSz;
367+
sword16* sp = NULL;
368+
sword16* ep = NULL;
369+
sword16* k = NULL;
370+
sword16* epp = NULL;
371+
unsigned int kp = 0;
372+
unsigned int compVecSz = 0;
373373
#ifndef USE_INTEL_SPEEDUP
374374
sword16* at = NULL;
375375
#else
@@ -636,7 +636,7 @@ static KYBER_NOINLINE int kyberkey_decapsulate(KyberKey* key,
636636
int ret = 0;
637637
sword16* v;
638638
sword16* mp;
639-
unsigned int kp;
639+
unsigned int kp = 0;
640640
unsigned int compVecSz;
641641
#ifndef USE_INTEL_SPEEDUP
642642
sword16* bp = NULL;
@@ -741,7 +741,7 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
741741
byte msg[2 * KYBER_SYM_SZ];
742742
byte kr[2 * KYBER_SYM_SZ + 1];
743743
int ret = 0;
744-
unsigned int ctSz;
744+
unsigned int ctSz = 0;
745745
unsigned int i;
746746
int fail;
747747
#ifndef USE_INTEL_SPEEDUP

0 commit comments

Comments
 (0)