Initialize some Kyber client variables

This commit is contained in:
gojimmypi
2024-03-28 09:14:53 -07:00
parent 716870cbc2
commit 5bffbdb20c

View File

@@ -203,7 +203,7 @@ int wc_KyberKey_MakeKeyWithRandom(KyberKey* key, const unsigned char* rand,
byte* pubSeed = buf; byte* pubSeed = buf;
byte* noiseSeed = buf + KYBER_SYM_SZ; byte* noiseSeed = buf + KYBER_SYM_SZ;
sword16* a = NULL; sword16* a = NULL;
sword16* e; sword16* e = NULL;
int ret = 0; int ret = 0;
int kp = 0; int kp = 0;
@@ -528,7 +528,7 @@ int wc_KyberKey_EncapsulateWithRandom(KyberKey* key, unsigned char* ct,
byte msg[2 * KYBER_SYM_SZ]; byte msg[2 * KYBER_SYM_SZ];
byte kr[2 * KYBER_SYM_SZ + 1]; byte kr[2 * KYBER_SYM_SZ + 1];
int ret = 0; int ret = 0;
unsigned int ctSz; unsigned int ctSz = 0;
/* Validate parameters. */ /* Validate parameters. */
if ((key == NULL) || (ct == NULL) || (ss == NULL) || (rand == NULL)) { if ((key == NULL) || (ct == NULL) || (ss == NULL) || (rand == NULL)) {
@@ -742,8 +742,8 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
byte kr[2 * KYBER_SYM_SZ + 1]; byte kr[2 * KYBER_SYM_SZ + 1];
int ret = 0; int ret = 0;
unsigned int ctSz = 0; unsigned int ctSz = 0;
unsigned int i; unsigned int i = 0;
int fail; int fail = 0;
#ifndef USE_INTEL_SPEEDUP #ifndef USE_INTEL_SPEEDUP
byte* cmp = NULL; byte* cmp = NULL;
#else #else