mbedtls_pk_sign_restartable() function
Restartable version of \c mbedtls_pk_sign()
Syntax
int mbedtls_pk_sign_restartable( mbedtls_pk_context *ctx,
mbedtls_md_type_t md_alg,
const unsigned char *hash,
size_t hash_len,
unsigned char *sig,
size_t *sig_len,
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng,
mbedtls_pk_restart_ctx *rs_ctx );
Arguments
ctx
The PK context to use. It must have been set up with a private key.
md_alg
Hash algorithm used (see notes)
hash
Hash of the message to sign
hash_len
Hash length or 0 (see notes)
sig
Place to write the signature
sig_len
Number of bytes written
rs_ctx
Restart context (NULL to disable restart)
Return value
See \c mbedtls_pk_sign(), or #MBEDTLS_ERR_ECP_IN_PROGRESS if maximum number of operations was reached: see \c mbedtls_ecp_set_max_ops().
Notes
Performs the same job as \c mbedtls_pk_sign(), but can return early and restart according to the limit set with \c mbedtls_ecp_set_max_ops() to reduce blocking for ECC operations. For RSA, same as \c mbedtls_pk_sign().