Commit 1418e16
committed
Add STM32 DHUK (Device Hardware Unique Key) support via crypto callbacks
A vendor-neutral DHUK crypto-callback device (wc_Stm32_DhukRegister) that
binds keys to the silicon's hardware-unique key via SAES: GMAC, AES-ECB/CBC
and ECDSA-sign run with a key derived from a seed inside SAES (the key never
enters software); wc_ecc_import_wrapped_private carries a wrapped scalar +
seed on the ecc_key. Gated behind WOLFSSL_DHUK + WOLF_CRYPTO_CB.
Includes the SAES kernel-clock fix this depends on: on STM32U5/U3 the SAES
runs from the SHSI (secure HSI), which the bare driver now enables in
Stm32SaesEnsureRng -- without it the wrapped-key derive never completes (CCF
never asserts) and DHUK returned WC_TIMEOUT_E. Also factors the repeated
SAES push/wait-CCF/read/clear idiom into Stm32SaesEcbBlock.
Validated on NUCLEO-U545RE-Q and B-U585I-IOT02A (TZEN=1): all DHUK stages
pass, with device-unique tags.1 parent 1839a0f commit 1418e16
7 files changed
Lines changed: 1447 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
| 534 | + | |
534 | 535 | | |
535 | 536 | | |
536 | 537 | | |
| |||
599 | 600 | | |
600 | 601 | | |
601 | 602 | | |
| 603 | + | |
602 | 604 | | |
603 | 605 | | |
604 | 606 | | |
| |||
971 | 973 | | |
972 | 974 | | |
973 | 975 | | |
| 976 | + | |
| 977 | + | |
974 | 978 | | |
975 | 979 | | |
976 | 980 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4154 | 4154 | | |
4155 | 4155 | | |
4156 | 4156 | | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
4157 | 4165 | | |
4158 | 4166 | | |
4159 | 4167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7039 | 7039 | | |
7040 | 7040 | | |
7041 | 7041 | | |
| 7042 | + | |
| 7043 | + | |
| 7044 | + | |
| 7045 | + | |
| 7046 | + | |
| 7047 | + | |
| 7048 | + | |
| 7049 | + | |
| 7050 | + | |
| 7051 | + | |
| 7052 | + | |
| 7053 | + | |
| 7054 | + | |
| 7055 | + | |
| 7056 | + | |
| 7057 | + | |
| 7058 | + | |
| 7059 | + | |
| 7060 | + | |
| 7061 | + | |
| 7062 | + | |
| 7063 | + | |
| 7064 | + | |
| 7065 | + | |
| 7066 | + | |
| 7067 | + | |
| 7068 | + | |
| 7069 | + | |
| 7070 | + | |
| 7071 | + | |
| 7072 | + | |
| 7073 | + | |
| 7074 | + | |
| 7075 | + | |
| 7076 | + | |
| 7077 | + | |
| 7078 | + | |
| 7079 | + | |
| 7080 | + | |
| 7081 | + | |
| 7082 | + | |
| 7083 | + | |
| 7084 | + | |
| 7085 | + | |
7042 | 7086 | | |
7043 | 7087 | | |
7044 | 7088 | | |
| |||
8127 | 8171 | | |
8128 | 8172 | | |
8129 | 8173 | | |
| 8174 | + | |
| 8175 | + | |
| 8176 | + | |
| 8177 | + | |
| 8178 | + | |
| 8179 | + | |
| 8180 | + | |
| 8181 | + | |
| 8182 | + | |
8130 | 8183 | | |
8131 | 8184 | | |
8132 | 8185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
99 | 147 | | |
100 | 148 | | |
101 | 149 | | |
| |||
0 commit comments