@@ -1021,6 +1021,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
10211021
10221022 default :
10231023 hcryp -> ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED ;
1024+
1025+ /* Process unlocked */
1026+ __HAL_UNLOCK (hcryp ); // MBED patch
1027+
10241028 return HAL_ERROR ;
10251029 }
10261030
@@ -1057,6 +1061,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
10571061
10581062 default :
10591063 hcryp -> ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED ;
1064+
1065+ /* Process unlocked */
1066+ __HAL_UNLOCK (hcryp ); // MBED patch
1067+
10601068 return HAL_ERROR ;
10611069 }
10621070#endif /*end AES or CRYP */
@@ -1065,10 +1073,10 @@ HAL_StatusTypeDef HAL_CRYP_Encrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
10651073 {
10661074 /* Change the CRYP peripheral state */
10671075 hcryp -> State = HAL_CRYP_STATE_READY ;
1068-
1076+ }
1077+
10691078 /* Process unlocked */
1070- __HAL_UNLOCK (hcryp );
1071- }
1079+ __HAL_UNLOCK (hcryp ); // MBED patch
10721080 }
10731081 else
10741082 {
@@ -1186,6 +1194,10 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
11861194
11871195 default :
11881196 hcryp -> ErrorCode |= HAL_CRYP_ERROR_NOT_SUPPORTED ;
1197+
1198+ /* Process unlocked */
1199+ __HAL_UNLOCK (hcryp ); // MBED patch
1200+
11891201 return HAL_ERROR ;
11901202 }
11911203
@@ -1230,10 +1242,10 @@ HAL_StatusTypeDef HAL_CRYP_Decrypt(CRYP_HandleTypeDef *hcryp, uint32_t *Input, u
12301242 {
12311243 /* Change the CRYP peripheral state */
12321244 hcryp -> State = HAL_CRYP_STATE_READY ;
1233-
1234- /* Process unlocked */
1235- __HAL_UNLOCK (hcryp );
12361245 }
1246+
1247+ /* Process unlocked */
1248+ __HAL_UNLOCK (hcryp ); // MBED patch
12371249 }
12381250 else
12391251 {
0 commit comments