Add infrastructure for ecdsa_verify_restartable()

This commit is contained in:
Manuel Pégourié-Gonnard 2017-04-21 11:33:57 +02:00
parent 722e5156fd
commit a0c5bcc2bc
4 changed files with 107 additions and 2 deletions

View file

@ -57,12 +57,20 @@ typedef mbedtls_ecp_keypair mbedtls_ecdsa_context;
#if defined(MBEDTLS_ECP_RESTARTABLE)
/**
* \brief Internal restart context for ecdsa_verify()
*
* \note Opaque struct
*/
typedef struct mbedtls_ecdsa_restart_ver mbedtls_ecdsa_restart_ver_ctx;
/**
* \brief General context for resuming ECDSA operations
*/
typedef struct
{
mbedtls_ecp_restart_ctx ecp; /*!< base context (admin+ecp info) */
mbedtls_ecdsa_restart_ver_ctx *ver; /*!< ecdsa_verify() sub-context */
} mbedtls_ecdsa_restart_ctx;
#else /* MBEDTLS_ECP_RESTARTABLE */

View file

@ -341,6 +341,14 @@ typedef void mbedtls_ecp_restart_ctx;
* \note This setting is currently ignored by Curve25519
*/
void mbedtls_ecp_set_max_ops( unsigned max_ops );
/**
* \brief Check if restart is enabled (max_ops != 0)
*
* \return 0 if max_ops == 0 (restart disabled)
* 1 otherwise (restart enabled)
*/
int mbedtls_ecp_restart_enabled( void );
#endif /* MBEDTLS_ECP_RESTARTABLE */
/**