Remove the SHA1-/SHA2-256 auto devId selection devId = wc_CryptoCb_GetDevIdAtIndex(0);
This commit is contained in:
parent
8b203719d3
commit
90748b5f61
@ -1337,7 +1337,6 @@ int wc_HashGetFlags(wc_HashAlg* hash, enum wc_HashType type, word32* flags)
|
||||
#else
|
||||
wc_Sha sha[1];
|
||||
#endif
|
||||
int devId = INVALID_DEVID;
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
sha = (wc_Sha*)XMALLOC(sizeof(wc_Sha), NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
@ -1345,12 +1344,6 @@ int wc_HashGetFlags(wc_HashAlg* hash, enum wc_HashType type, word32* flags)
|
||||
return MEMORY_E;
|
||||
#endif
|
||||
|
||||
#ifdef WOLF_CRYPTO_CB
|
||||
/* only use devId if its not an empty hash */
|
||||
if (data != NULL && len > 0)
|
||||
devId = wc_CryptoCb_GetDevIdAtIndex(0);
|
||||
#endif
|
||||
|
||||
if ((ret = wc_InitSha_ex(sha, heap, devId)) != 0) {
|
||||
WOLFSSL_MSG("InitSha failed");
|
||||
}
|
||||
@ -1429,7 +1422,6 @@ int wc_HashGetFlags(wc_HashAlg* hash, enum wc_HashType type, word32* flags)
|
||||
#else
|
||||
wc_Sha256 sha256[1];
|
||||
#endif
|
||||
int devId = INVALID_DEVID;
|
||||
|
||||
#ifdef WOLFSSL_SMALL_STACK
|
||||
sha256 = (wc_Sha256*)XMALLOC(sizeof(wc_Sha256), NULL,
|
||||
@ -1438,12 +1430,6 @@ int wc_HashGetFlags(wc_HashAlg* hash, enum wc_HashType type, word32* flags)
|
||||
return MEMORY_E;
|
||||
#endif
|
||||
|
||||
#ifdef WOLF_CRYPTO_CB
|
||||
/* only use devId if its not an empty hash */
|
||||
if (data != NULL && len > 0)
|
||||
devId = wc_CryptoCb_GetDevIdAtIndex(0);
|
||||
#endif
|
||||
|
||||
if ((ret = wc_InitSha256_ex(sha256, heap, devId)) != 0) {
|
||||
WOLFSSL_MSG("InitSha256 failed");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user