Add psa_generate_key_iop_get_num_ops() docs
Signed-off-by: Paul Elliott <paul.elliott@arm.com>
diff --git a/tf-psa-crypto/core/psa_crypto_ecp.c b/tf-psa-crypto/core/psa_crypto_ecp.c
index 096bc11..7f3a2b6 100644
--- a/tf-psa-crypto/core/psa_crypto_ecp.c
+++ b/tf-psa-crypto/core/psa_crypto_ecp.c
@@ -593,6 +593,17 @@
#endif /* MBEDTLS_PSA_BUILTIN_ALG_ECDH */
/****************************************************************/
+/* Interruptible ECC Key Generation */
+/****************************************************************/
+
+uint32_t psa_generate_key_iop_get_num_ops(
+ psa_generate_key_iop_t *operation)
+{
+ (void) operation;
+ return 0;
+}
+
+/****************************************************************/
/* Interruptible ECC Key Agreement */
/****************************************************************/
diff --git a/tf-psa-crypto/include/psa/crypto.h b/tf-psa-crypto/include/psa/crypto.h
index 2b03435..ac466da 100644
--- a/tf-psa-crypto/include/psa/crypto.h
+++ b/tf-psa-crypto/include/psa/crypto.h
@@ -5206,6 +5206,31 @@
*/
typedef struct psa_generate_key_iop_s psa_generate_key_iop_t;
+/**
+ * \brief Get the number of ops that a key generation
+ * operation has taken so far. If the operation has
+ * completed, then this will represent the number
+ * of ops required for the entire operation. After
+ * initialization or calling \c
+ * psa_generate_key_iop_abort() on the operation,
+ * a value of 0 will be returned.
+ *
+ * \warning This is a beta API, and thus subject to change
+ * at any point. It is not bound by the usual
+ * interface stability promises.
+ *
+ * This is a helper provided to help you tune the
+ * value passed to \c
+ * psa_interruptible_set_max_ops().
+ *
+ * \param operation The \c psa_generate_key_iop_t to use. This must
+ * be initialized first.
+ *
+ * \return Number of ops that the operation has taken so
+ * far.
+ */
+uint32_t psa_generate_key_iop_get_num_ops(psa_generate_key_iop_t *operation);
+
/**@}*/
#ifdef __cplusplus