Skip to content

Commit f5ff72a

Browse files
authored
Merge pull request #7087 from dgarske/cryptocb_sha1
Allow crypto callbacks with SHA-1 HW
2 parents 00c9625 + 9311a96 commit f5ff72a

3 files changed

Lines changed: 35 additions & 35 deletions

File tree

wolfssl/wolfcrypt/sha.h

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -122,48 +122,48 @@ enum {
122122
/* Sha digest */
123123
struct wc_Sha {
124124
#ifdef FREESCALE_LTC_SHA
125-
ltc_hash_ctx_t ctx;
125+
ltc_hash_ctx_t ctx;
126126
#elif defined(WOLFSSL_SE050) && defined(WOLFSSL_SE050_HASH)
127-
SE050_HASH_Context se050Ctx;
127+
SE050_HASH_Context se050Ctx;
128128
#elif defined(STM32_HASH)
129-
STM32_HASH_Context stmCtx;
129+
STM32_HASH_Context stmCtx;
130130
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
131-
wc_silabs_sha_t silabsCtx;
131+
wc_silabs_sha_t silabsCtx;
132132
#elif defined(WOLFSSL_IMXRT_DCP)
133-
dcp_handle_t handle;
134-
dcp_hash_ctx_t ctx;
133+
dcp_handle_t handle;
134+
dcp_hash_ctx_t ctx;
135135
#elif defined(WOLFSSL_HAVE_PSA) && !defined(WOLFSSL_PSA_NO_HASH)
136-
psa_hash_operation_t psa_ctx;
136+
psa_hash_operation_t psa_ctx;
137137
#else
138-
word32 buffLen; /* in bytes */
139-
word32 loLen; /* length in bytes */
140-
word32 hiLen; /* length in bytes */
141-
word32 buffer[WC_SHA_BLOCK_SIZE / sizeof(word32)];
138+
word32 buffLen; /* in bytes */
139+
word32 loLen; /* length in bytes */
140+
word32 hiLen; /* length in bytes */
141+
word32 buffer[WC_SHA_BLOCK_SIZE / sizeof(word32)];
142142
#ifdef WOLFSSL_PIC32MZ_HASH
143-
word32 digest[PIC32_DIGEST_SIZE / sizeof(word32)];
143+
word32 digest[PIC32_DIGEST_SIZE / sizeof(word32)];
144144
#else
145-
word32 digest[WC_SHA_DIGEST_SIZE / sizeof(word32)];
146-
#endif
147-
void* heap;
148-
#ifdef WOLFSSL_PIC32MZ_HASH
149-
hashUpdCache cache; /* cache for updates */
150-
#endif
151-
#ifdef WOLFSSL_ASYNC_CRYPT
152-
WC_ASYNC_DEV asyncDev;
153-
#endif /* WOLFSSL_ASYNC_CRYPT */
154-
#ifdef WOLF_CRYPTO_CB
155-
int devId;
156-
void* devCtx; /* generic crypto callback context */
157-
#endif
158-
#ifdef WOLFSSL_IMXRT1170_CAAM
159-
caam_hash_ctx_t ctx;
160-
caam_handle_t hndl;
161-
#endif
162-
#if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
163-
byte* msg;
164-
word32 used;
165-
word32 len;
145+
word32 digest[WC_SHA_DIGEST_SIZE / sizeof(word32)];
166146
#endif
147+
void* heap;
148+
#endif
149+
#ifdef WOLFSSL_PIC32MZ_HASH
150+
hashUpdCache cache; /* cache for updates */
151+
#endif
152+
#ifdef WOLFSSL_ASYNC_CRYPT
153+
WC_ASYNC_DEV asyncDev;
154+
#endif /* WOLFSSL_ASYNC_CRYPT */
155+
#ifdef WOLF_CRYPTO_CB
156+
int devId;
157+
void* devCtx; /* generic crypto callback context */
158+
#endif
159+
#ifdef WOLFSSL_IMXRT1170_CAAM
160+
caam_hash_ctx_t ctx;
161+
caam_handle_t hndl;
162+
#endif
163+
#if defined(WOLFSSL_DEVCRYPTO_HASH) || defined(WOLFSSL_HASH_KEEP)
164+
byte* msg;
165+
word32 used;
166+
word32 len;
167167
#endif
168168
#if defined(WOLFSSL_ESP32_CRYPT) && \
169169
!defined(NO_WOLFSSL_ESP32_CRYPT_HASH)

wolfssl/wolfcrypt/sha256.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ struct wc_Sha256 {
164164
#elif defined(STM32_HASH_SHA2)
165165
STM32_HASH_Context stmCtx;
166166
#elif defined(WOLFSSL_SILABS_SE_ACCEL)
167-
wc_silabs_sha_t silabsCtx;
167+
wc_silabs_sha_t silabsCtx;
168168
#elif defined(WOLFSSL_IMXRT_DCP)
169169
dcp_handle_t handle;
170170
dcp_hash_ctx_t ctx;

wolfssl/wolfcrypt/sha512.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ struct wc_Sha512 {
159159
WC_ESP32SHA ctx;
160160
#endif
161161
#if defined(WOLFSSL_SILABS_SE_ACCEL)
162-
wc_silabs_sha_t silabsCtx;
162+
wc_silabs_sha_t silabsCtx;
163163
#endif
164164
#ifdef WOLFSSL_KCAPI_HASH
165165
wolfssl_KCAPI_Hash kcapi;

0 commit comments

Comments
 (0)