forked from wolfSSL/wolfssl
Merge pull request #1049 from dgarske/fix_asynchmac
Fixes for building with Async
This commit is contained in:
@@ -442,6 +442,7 @@ int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
|
|||||||
|
|
||||||
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_HMAC)
|
#if defined(WOLFSSL_ASYNC_CRYPT) && defined(WC_ASYNC_ENABLE_HMAC)
|
||||||
if (hmac->asyncDev.marker == WOLFSSL_ASYNC_MARKER_HMAC) {
|
if (hmac->asyncDev.marker == WOLFSSL_ASYNC_MARKER_HMAC) {
|
||||||
|
#if defined(HAVE_INTEL_QA)
|
||||||
if (length > hmac_block_size)
|
if (length > hmac_block_size)
|
||||||
length = hmac_block_size;
|
length = hmac_block_size;
|
||||||
/* update key length */
|
/* update key length */
|
||||||
@@ -449,6 +450,7 @@ int wc_HmacSetKey(Hmac* hmac, int type, const byte* key, word32 length)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
/* no need to pad below */
|
/* no need to pad below */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -314,7 +314,7 @@ void fp_mul(fp_int *A, fp_int *B, fp_int *C)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
/* zero any excess digits on the destination that we didn't write to */
|
/* zero any excess digits on the destination that we didn't write to */
|
||||||
for (y = C->used; y < oldused; y++) {
|
for (y = C->used; y >= 0 && y < oldused; y++) {
|
||||||
C->dp[y] = 0;
|
C->dp[y] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1479,7 +1479,7 @@ void fp_sqr(fp_int *A, fp_int *B)
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
/* zero any excess digits on the destination that we didn't write to */
|
/* zero any excess digits on the destination that we didn't write to */
|
||||||
for (y = B->used; y < oldused; y++) {
|
for (y = B->used; y >= 0 && y < oldused; y++) {
|
||||||
B->dp[y] = 0;
|
B->dp[y] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2467,7 +2467,7 @@ void fp_copy(fp_int *a, fp_int *b)
|
|||||||
XMEMCPY(b->dp, a->dp, a->used * sizeof(fp_digit));
|
XMEMCPY(b->dp, a->dp, a->used * sizeof(fp_digit));
|
||||||
|
|
||||||
/* zero any excess digits on the destination that we didn't write to */
|
/* zero any excess digits on the destination that we didn't write to */
|
||||||
for (x = b->used; x < oldused; x++) {
|
for (x = b->used; x >= 0 && x < oldused; x++) {
|
||||||
b->dp[x] = 0;
|
b->dp[x] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user