mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-29 11:41:15 +03:00
Reset ops_done at the right time
This should only be done in the top-level function. Also, we need to know if we indeed are the top-level function or not: for example, when mbedtls_ecp_muladd() calls mbedtls_ecp_mul(), the later should not reset ops_done. This is handled by the "depth" parameter in the restart context.
This commit is contained in:
@ -185,6 +185,7 @@ typedef struct mbedtls_ecp_restart_mul mbedtls_ecp_restart_mul_ctx;
|
||||
typedef struct
|
||||
{
|
||||
unsigned ops_done; /*!< current ops count */
|
||||
unsigned depth; /*!< call depth (0 = top-level) */
|
||||
mbedtls_ecp_restart_mul_ctx *rsm; /*!< ecp_mul_comb() sub-context */
|
||||
} mbedtls_ecp_restart_ctx;
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
|
Reference in New Issue
Block a user