Define PSA_VENDOR_PBKDF2_MAX_ITERATIONS

Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
This commit is contained in:
Kusumit Ghoderao 2023-05-24 12:30:43 +05:30
parent 52fe517a77
commit e66a8ad8d6
2 changed files with 6 additions and 1 deletions

View File

@ -253,6 +253,10 @@
* curve. */
#define PSA_TLS12_ECJPAKE_TO_PMS_DATA_SIZE 32
/* The maximum number of iterations for PBKDF2 on this implementation, in bits.
* This is a vendor-specific macro. This can be configured if necessary */
#define PSA_VENDOR_PBKDF2_MAX_ITERATIONS 0xffffffff
/** The maximum size of a block cipher. */
#define PSA_BLOCK_CIPHER_BLOCK_MAX_SIZE 16

View File

@ -6419,13 +6419,14 @@ static psa_status_t psa_pbkdf2_set_input_cost(
return PSA_ERROR_BAD_STATE;
}
if (data > 0xFFFFFFFF) {
if (data > PSA_VENDOR_PBKDF2_MAX_ITERATIONS) {
return PSA_ERROR_NOT_SUPPORTED;
}
if (data == 0) {
return PSA_ERROR_INVALID_ARGUMENT;
}
pbkdf2->input_cost = data;
pbkdf2->state = PSA_PBKDF2_STATE_INPUT_COST_SET;