Skip to content

Commit 4910cbb

Browse files
Vge0rgerlubos
authored andcommitted
nrf_security: Fix HMAC update for Cracen PSA driver
The cracen_hmac_update needs to resume the hash operation for any call apart from the first block. This was missing before which could make the cracen_hmac_update to fail in cases where the input was not a multiple of the block size. Signed-off-by: Georgios Vasilakis <[email protected]>
1 parent febd0cf commit 4910cbb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

subsys/nrf_security/src/drivers/cracen/cracenpsa/src/cracen_mac_hmac.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ psa_status_t cracen_hmac_update(cracen_mac_operation_t *operation, const uint8_t
7272
return PSA_SUCCESS;
7373
}
7474

75+
if (!operation->is_first_block) {
76+
sx_status = sx_hash_resume_state(&operation->hmac.hashctx);
77+
if (sx_status != SX_OK) {
78+
return silex_statuscodes_to_psa(sx_status);
79+
}
80+
}
81+
7582
operation->is_first_block = false;
7683

7784
/* Feed the data that are currently in the input buffer to the driver */

0 commit comments

Comments
 (0)