Skip to content

Commit 8635014

Browse files
committed
Fix to enable SHA384/SHA512 crypto hardware on STM32H7S.
1 parent 93c8d7d commit 8635014

3 files changed

Lines changed: 13 additions & 11 deletions

File tree

IDE/STM32Cube/STM32_Benchmarks.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -216,14 +216,14 @@ GMAC Table 4-bit 46 MiB took 1.000 seconds, 45.835 MiB/s
216216
CHACHA 32 MiB took 1.000 seconds, 31.519 MiB/s
217217
CHA-POLY 15 MiB took 1.000 seconds, 15.259 MiB/s
218218
POLY1305 57 MiB took 1.000 seconds, 56.934 MiB/s
219-
SHA-256 88 MiB took 1.000 seconds, 88.184 MiB/s
220-
SHA-384 6 MiB took 1.000 seconds, 5.835 MiB/s
221-
SHA-512 6 MiB took 1.000 seconds, 5.591 MiB/s
222-
SHA-512/224 6 MiB took 1.000 seconds, 5.615 MiB/s
223-
SHA-512/256 6 MiB took 1.000 seconds, 5.591 MiB/s
224-
HMAC-SHA256 83 MiB took 1.000 seconds, 83.154 MiB/s
225-
HMAC-SHA384 6 MiB took 1.000 seconds, 5.518 MiB/s
226-
HMAC-SHA512 6 MiB took 1.000 seconds, 5.542 MiB/s
219+
SHA-256 90 MiB took 1.000 seconds, 90.381 MiB/s
220+
SHA-384 98 MiB took 1.000 seconds, 97.925 MiB/s
221+
SHA-512 98 MiB took 1.000 seconds, 97.925 MiB/s
222+
SHA-512/224 98 MiB took 1.000 seconds, 98.120 MiB/s
223+
SHA-512/256 98 MiB took 1.000 seconds, 98.096 MiB/s
224+
HMAC-SHA256 71 MiB took 1.000 seconds, 71.265 MiB/s
225+
HMAC-SHA384 89 MiB took 1.000 seconds, 88.599 MiB/s
226+
HMAC-SHA512 89 MiB took 1.000 seconds, 88.843 MiB/s
227227
RSA 2048 public 352 ops took 1.000 sec, avg 2.841 ms, 352.000 ops/sec
228228
RSA 2048 private 6 ops took 1.008 sec, avg 168.000 ms, 5.952 ops/sec
229229
DH 2048 key gen 15 ops took 1.027 sec, avg 68.467 ms, 14.606 ops/sec

wolfcrypt/src/aes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8296,7 +8296,7 @@ static WARN_UNUSED_RESULT int wc_AesGcmEncrypt_STM32(
82968296

82978297
/* Authentication buffer - must be 4-byte multiple zero padded */
82988298
authPadSz = authInSz % sizeof(word32);
8299-
#if STM_CRYPT_HEADER_TYPE
8299+
#ifdef WOLFSSL_STM32MP13
83008300
/* STM32MP13 HAL at least v1.2 and lower has a bug with which it needs a
83018301
* minimum of 16 bytes for the auth
83028302
*/
@@ -8842,7 +8842,7 @@ static WARN_UNUSED_RESULT int wc_AesGcmDecrypt_STM32(
88428842
authPadSz = authInSz;
88438843
}
88448844

8845-
#if defined(WOLFSSL_STM32MP13)
8845+
#ifdef WOLFSSL_STM32MP13
88468846
/* STM32MP13 HAL at least v1.2 and lower has a bug with which it needs a
88478847
* minimum of 16 bytes for the auth
88488848
*/

wolfssl/wolfcrypt/port/st/stm32.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242
#define HASH_CR_SIZE 54
4343
#define HASH_MAX_DIGEST 32
4444
#endif
45-
#if defined(WOLFSSL_STM32MP13)
45+
#if defined(WOLFSSL_STM32MP13) || defined(WOLFSSL_STM32H7S)
4646
#define STM32_HASH_SHA512
4747
#define STM32_HASH_SHA512_224
4848
#define STM32_HASH_SHA512_256
4949
#define STM32_HASH_SHA384
50+
#endif
51+
#if defined(WOLFSSL_STM32MP13)
5052
#define STM32_HASH_SHA3
5153
#endif
5254
#else

0 commit comments

Comments
 (0)