Define PSA_VENDOR_PBKDF2_MAX_ITERATIONS

Signed-off-by: Kusumit Ghoderao <Kusumit.Ghoderao@silabs.com>
diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h
index 37f7205..6b8ccbb 100644
--- a/include/psa/crypto_sizes.h
+++ b/include/psa/crypto_sizes.h
@@ -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
 
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 4615920..a8ccde5 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -6419,13 +6419,14 @@
         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;