Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

20240910-configure-enable-all-asm-and-sp-cleanup #7967

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
402 changes: 206 additions & 196 deletions configure.ac

Large diffs are not rendered by default.

25 changes: 12 additions & 13 deletions wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -36028,7 +36028,7 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
*ioIndex = idx;

return 0;
#else
#else /* WOLFSSL_ASN_TEMPLATE */
DECL_ASNGETDATA(dataASN, singleResponseASN_Length);
int ret = 0;
word32 ocspDigestSize = OCSP_DIGEST_SIZE;
Expand All @@ -36038,10 +36038,6 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
word32 issuerKeyHashLen;
word32 thisDateLen;
word32 nextDateLen;
#if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || \
defined(WOLFSSL_HAPROXY) || defined(HAVE_LIGHTY)
WOLFSSL_ASN1_TIME *at;
#endif

(void)wrapperSz;

Expand Down Expand Up @@ -36119,19 +36115,20 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
if (!XVALIDATE_DATE(cs->thisDate, ASN_GENERALIZED_TIME, ASN_BEFORE)) {
ret = ASN_BEFORE_DATE_E;
}
#endif /* !NO_ASN_TIME_CHECK && !WOLFSSL_NO_OCSP_DATE_CHECK */
}
#ifdef WOLFSSL_OCSP_PARSE_STATUS
if (ret == 0) {
#endif
#ifdef WOLFSSL_OCSP_PARSE_STATUS
/* Store ASN.1 version of thisDate. */
WOLFSSL_ASN1_TIME *at;
cs->thisDateAsn = GetASNItem_Addr(
dataASN[SINGLERESPONSEASN_IDX_THISUPDATE_GT], source);
at = &cs->thisDateParsed;
at->type = ASN_GENERALIZED_TIME;
XMEMCPY(at->data, cs->thisDate, thisDateLen);
at->length = (int)thisDateLen;
#endif
}
#endif
if ((ret == 0) &&
(dataASN[SINGLERESPONSEASN_IDX_NEXTUPDATE_GT].tag != 0)) {
/* Store the nextDate format - only one possible. */
Expand All @@ -36141,28 +36138,30 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
if (!XVALIDATE_DATE(cs->nextDate, ASN_GENERALIZED_TIME, ASN_AFTER)) {
ret = ASN_AFTER_DATE_E;
}
#endif /* !NO_ASN_TIME_CHECK && !WOLFSSL_NO_OCSP_DATE_CHECK */
}
#ifdef WOLFSSL_OCSP_PARSE_STATUS
if ((ret == 0) &&
(dataASN[SINGLERESPONSEASN_IDX_NEXTUPDATE_GT].tag != 0)) {
#endif
#ifdef WOLFSSL_OCSP_PARSE_STATUS
(dataASN[SINGLERESPONSEASN_IDX_NEXTUPDATE_GT].tag != 0))
{
/* Store ASN.1 version of thisDate. */
WOLFSSL_ASN1_TIME *at;
cs->nextDateAsn = GetASNItem_Addr(
dataASN[SINGLERESPONSEASN_IDX_NEXTUPDATE_GT], source);
at = &cs->nextDateParsed;
at->type = ASN_GENERALIZED_TIME;
XMEMCPY(at->data, cs->nextDate, nextDateLen);
at->length = (int)nextDateLen;
#endif
}
#endif
if (ret == 0) {
/* OcspEntry now used. */
single->used = 1;
}

FREE_ASNGETDATA(dataASN, NULL);
return ret;
#endif
#endif /* WOLFSSL_ASN_TEMPLATE */
}

#ifdef WOLFSSL_ASN_TEMPLATE
Expand Down
34 changes: 17 additions & 17 deletions wolfcrypt/src/siphash.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,29 +805,29 @@ int wc_SipHash(const unsigned char* key, const unsigned char* in, word32 inSz,
#else

#define SipRoundV(v0, v1, v2, v3) \
v0 += v1; \
v2 += v3; \
v1 = rotlFixed64(v1, 13); \
v3 = rotlFixed64(v3, 16); \
v1 ^= v0; \
v3 ^= v2; \
v0 = rotlFixed64(v0, 32); \
v2 += v1; \
v0 += v3; \
v1 = rotlFixed64(v1, 17); \
v3 = rotlFixed64(v3, 21); \
v1 ^= v2; \
v3 ^= v0; \
v2 = rotlFixed64(v2, 32);
(v0) += (v1); \
(v2) += (v3); \
(v1) = rotlFixed64(v1, 13); \
(v3) = rotlFixed64(v3, 16); \
(v1) ^= (v0); \
(v3) ^= (v2); \
(v0) = rotlFixed64(v0, 32); \
(v2) += (v1); \
(v0) += (v3); \
(v1) = rotlFixed64(v1, 17); \
(v3) = rotlFixed64(v3, 21); \
(v1) ^= (v2); \
(v3) ^= (v0); \
(v2) = rotlFixed64(v2, 32);

#define SipHashCompressV(v0, v1, v2, v3, m) \
do { \
int i; \
v3 ^= m; \
(v3) ^= (m); \
for (i = 0; i < WOLFSSL_SIPHASH_CROUNDS; i++) { \
SipRoundV(v0, v1, v2, v3); \
} \
v0 ^= m; \
(v0) ^= (m); \
} \
while (0)

Expand All @@ -839,7 +839,7 @@ int wc_SipHash(const unsigned char* key, const unsigned char* in, word32 inSz,
for (i = 0; i < WOLFSSL_SIPHASH_DROUNDS; i++) { \
SipRoundV(v0, v1, v2, v3); \
} \
n = v0 ^ v1 ^ v2 ^ v3; \
n = (v0) ^ (v1) ^ (v2) ^ (v3); \
SET_U64(out, n); \
} \
while (0)
Expand Down
Loading