Skip to content

Commit 0cc0bb0

Browse files
authored
Merge pull request #8586 from douzzer/20250321-siphash-armasm
20250321-siphash-armasm
2 parents 576c489 + 0cea9c0 commit 0cc0bb0

File tree

5 files changed

+96
-77
lines changed

5 files changed

+96
-77
lines changed

src/internal.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -13814,8 +13814,6 @@ static int ProcessCSR_ex(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1381413814
#if defined(HAVE_CERTIFICATE_STATUS_REQUEST)
1381513815
TLSX* ext = TLSX_Find(ssl->extensions, TLSX_STATUS_REQUEST);
1381613816
CertificateStatusRequest* csr;
13817-
#else
13818-
(void)idx;
1381913817
#endif
1382013818
#ifdef WOLFSSL_SMALL_STACK
1382113819
CertStatus* status;
@@ -13844,6 +13842,8 @@ static int ProcessCSR_ex(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1384413842
ssl->status_request = 0;
1384513843
break;
1384613844
}
13845+
#else
13846+
(void)idx;
1384713847
#endif
1384813848

1384913849
#ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2

wolfcrypt/src/falcon.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ int wc_falcon_sign_msg(const byte* in, word32 inLen,
6262
falcon_key* key, WC_RNG* rng)
6363
{
6464
int ret = 0;
65+
#ifdef HAVE_LIBOQS
66+
OQS_SIG *oqssig = NULL;
67+
size_t localOutLen = 0;
68+
#endif
6569

6670
/* sanity check on arguments */
6771
if ((in == NULL) || (out == NULL) || (outLen == NULL) || (key == NULL)) {
@@ -83,9 +87,6 @@ int wc_falcon_sign_msg(const byte* in, word32 inLen,
8387
#endif
8488

8589
#ifdef HAVE_LIBOQS
86-
OQS_SIG *oqssig = NULL;
87-
size_t localOutLen = 0;
88-
8990
if ((ret == 0) && (!key->prvKeySet)) {
9091
ret = BAD_FUNC_ARG;
9192
}
@@ -161,6 +162,9 @@ int wc_falcon_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
161162
word32 msgLen, int* res, falcon_key* key)
162163
{
163164
int ret = 0;
165+
#ifdef HAVE_LIBOQS
166+
OQS_SIG *oqssig = NULL;
167+
#endif
164168

165169
if (key == NULL || sig == NULL || msg == NULL || res == NULL) {
166170
return BAD_FUNC_ARG;
@@ -181,8 +185,6 @@ int wc_falcon_verify_msg(const byte* sig, word32 sigLen, const byte* msg,
181185
#endif
182186

183187
#ifdef HAVE_LIBOQS
184-
OQS_SIG *oqssig = NULL;
185-
186188
if ((ret == 0) && (!key->pubKeySet)) {
187189
ret = BAD_FUNC_ARG;
188190
}
@@ -708,12 +710,12 @@ int wc_falcon_export_key(falcon_key* key, byte* priv, word32 *privSz,
708710
*/
709711
int wc_falcon_check_key(falcon_key* key)
710712
{
713+
int ret = 0;
714+
711715
if (key == NULL) {
712716
return BAD_FUNC_ARG;
713717
}
714718

715-
int ret = 0;
716-
717719
/* The public key is also decoded and stored within the private key buffer
718720
* behind the private key. Hence, we can compare both stored public keys. */
719721
if (key->level == 1) {

wolfcrypt/src/siphash.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ int wc_SipHash(const unsigned char* key, const unsigned char* in, word32 inSz,
582582
return 0;
583583
}
584584

585-
#elif !defined(WOLFSSL_NO_ASM) && defined(__GNUC__) && defined(__aarch64__) && \
585+
#elif defined(WOLFSSL_ARMASM) && defined(__GNUC__) && defined(__aarch64__) && \
586586
(WOLFSSL_SIPHASH_CROUNDS == 1 || WOLFSSL_SIPHASH_CROUNDS == 2) && \
587587
(WOLFSSL_SIPHASH_DROUNDS == 2 || WOLFSSL_SIPHASH_DROUNDS == 4)
588588

0 commit comments

Comments
 (0)