Make old compilers happy.

This commit is contained in:
Anthony Hu
2023-02-24 17:13:47 -05:00
parent 1fcff5b30d
commit 49ae7d4845

View File

@@ -305,6 +305,11 @@ int wc_KyberKey_SharedSecretSize(KyberKey* key, word32* len)
int wc_KyberKey_MakeKey(KyberKey* key, WC_RNG* rng) int wc_KyberKey_MakeKey(KyberKey* key, WC_RNG* rng)
{ {
int ret = 0; int ret = 0;
#ifdef HAVE_LIBOQS
const char* algName = NULL;
OQS_KEM *kem = NULL;
#endif
(void)rng; (void)rng;
/* Validate parameter. */ /* Validate parameter. */
@@ -313,8 +318,6 @@ int wc_KyberKey_MakeKey(KyberKey* key, WC_RNG* rng)
} }
#ifdef HAVE_LIBOQS #ifdef HAVE_LIBOQS
const char* algName = NULL;
OQS_KEM *kem = NULL;
if (ret == 0) { if (ret == 0) {
algName = OQS_ID2name(key->type); algName = OQS_ID2name(key->type);
if (algName == NULL) { if (algName == NULL) {
@@ -394,6 +397,11 @@ int wc_KyberKey_Encapsulate(KyberKey* key, unsigned char* ct, unsigned char* ss,
WC_RNG* rng) WC_RNG* rng)
{ {
int ret = 0; int ret = 0;
#ifdef HAVE_LIBOQS
const char * algName = NULL;
OQS_KEM *kem = NULL;
#endif
(void)rng; (void)rng;
/* Validate parameters. */ /* Validate parameters. */
@@ -402,8 +410,6 @@ int wc_KyberKey_Encapsulate(KyberKey* key, unsigned char* ct, unsigned char* ss,
} }
#ifdef HAVE_LIBOQS #ifdef HAVE_LIBOQS
const char * algName = NULL;
OQS_KEM *kem = NULL;
if (ret == 0) { if (ret == 0) {
algName = OQS_ID2name(key->type); algName = OQS_ID2name(key->type);
if (algName == NULL) { if (algName == NULL) {
@@ -478,6 +484,10 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
{ {
int ret = 0; int ret = 0;
word32 ctlen = 0; word32 ctlen = 0;
#ifdef HAVE_LIBOQS
const char * algName = NULL;
OQS_KEM *kem = NULL;
#endif
/* Validate parameters. */ /* Validate parameters. */
if ((key == NULL) || (ss == NULL) || (ct == NULL)) { if ((key == NULL) || (ss == NULL) || (ct == NULL)) {
@@ -491,8 +501,6 @@ int wc_KyberKey_Decapsulate(KyberKey* key, unsigned char* ss,
} }
#ifdef HAVE_LIBOQS #ifdef HAVE_LIBOQS
const char * algName = NULL;
OQS_KEM *kem = NULL;
if (ret == 0) { if (ret == 0) {
algName = OQS_ID2name(key->type); algName = OQS_ID2name(key->type);
if (algName == NULL) { if (algName == NULL) {