mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 10:55:38 +01:00
Rename EARLY_RETURN -> RESTARTABLE
This is more consistent with function and context names.
This commit is contained in:
parent
411079fc34
commit
4b9c51ef32
@ -562,7 +562,7 @@
|
||||
#define MBEDTLS_ECP_NIST_OPTIM
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_ECP_EARLY_RETURN
|
||||
* \def MBEDTLS_ECP_RESTARTABLE
|
||||
*
|
||||
* Enable "non-blocking" ECC operations that can return early and be resumed.
|
||||
*
|
||||
@ -574,7 +574,7 @@
|
||||
*
|
||||
* Comment this macro to disable non-blocking ECC computations.
|
||||
*/
|
||||
#define MBEDTLS_ECP_EARLY_RETURN
|
||||
#define MBEDTLS_ECP_RESTARTABLE
|
||||
|
||||
/**
|
||||
* \def MBEDTLS_ECDSA_DETERMINISTIC
|
||||
|
@ -171,7 +171,7 @@ typedef struct
|
||||
}
|
||||
mbedtls_ecp_keypair;
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
* \brief Internal restart context for multiplication
|
||||
*
|
||||
@ -196,7 +196,7 @@ typedef struct
|
||||
mbedtls_ecp_restart_mul_ctx *rsm; /*!< ecp_mul_comb() sub-context */
|
||||
mbedtls_ecp_restart_muladd_ctx *ma; /*!< ecp_muladd() sub-context */
|
||||
} mbedtls_ecp_restart_ctx;
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/**
|
||||
* \name SECTION: Module settings
|
||||
@ -267,7 +267,7 @@ typedef struct
|
||||
*/
|
||||
#define MBEDTLS_ECP_TLS_NAMED_CURVE 3 /**< ECCurveType's named_curve */
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
* \brief Set the maximum number of basic operations done in a row.
|
||||
*
|
||||
@ -307,7 +307,7 @@ typedef struct
|
||||
* \note This setting is currently ignored by Curve25519
|
||||
*/
|
||||
void mbedtls_ecp_set_max_ops( unsigned max_ops );
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/**
|
||||
* \brief Get the list of supported curves in order of preferrence
|
||||
@ -383,7 +383,7 @@ void mbedtls_ecp_group_free( mbedtls_ecp_group *grp );
|
||||
*/
|
||||
void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
* \brief Initialize a restart context
|
||||
*/
|
||||
@ -393,7 +393,7 @@ void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx );
|
||||
* \brief Free the components of a restart context
|
||||
*/
|
||||
void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx );
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/**
|
||||
* \brief Copy the contents of point Q into P
|
||||
@ -612,7 +612,7 @@ int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
* \brief Restartable version of \c mbedtls_ecp_mul()
|
||||
*
|
||||
@ -636,7 +636,7 @@ int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx );
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/**
|
||||
* \brief Multiplication and addition of two points by integers:
|
||||
@ -662,7 +662,7 @@ int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
const mbedtls_mpi *n, const mbedtls_ecp_point *Q );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
* \brief Restartable version of \c mbedtls_ecp_muladd()
|
||||
*
|
||||
|
@ -86,7 +86,7 @@ static unsigned long add_count, dbl_count, mul_count;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/*
|
||||
* Maximum number of "basic operations" to be done in a row.
|
||||
*/
|
||||
@ -253,7 +253,7 @@ static int ecp_check_budget( const mbedtls_ecp_group *grp,
|
||||
|
||||
/* We also need that type to make our life simpler for internal functions */
|
||||
typedef void mbedtls_ecp_restart_ctx;
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
#if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED) || \
|
||||
defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED) || \
|
||||
@ -1409,11 +1409,11 @@ static int ecp_precompute_comb( const mbedtls_ecp_group *grp,
|
||||
const unsigned char T_len = 1U << ( w - 1 );
|
||||
mbedtls_ecp_point *cur, *TT[COMB_MAX_PRE - 1];
|
||||
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
(void) rs_ctx;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
{
|
||||
if( rs_ctx->rsm->state == ecp_rsm_pre_norm_add )
|
||||
@ -1431,7 +1431,7 @@ static int ecp_precompute_comb( const mbedtls_ecp_group *grp,
|
||||
*/
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_copy( &T[0], P ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL && rs_ctx->rsm->i != 0 )
|
||||
j = rs_ctx->rsm->i;
|
||||
else
|
||||
@ -1451,7 +1451,7 @@ static int ecp_precompute_comb( const mbedtls_ecp_group *grp,
|
||||
MBEDTLS_MPI_CHK( ecp_double_jac( grp, cur, cur ) );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
{
|
||||
rs_ctx->rsm->i = 0;
|
||||
@ -1463,7 +1463,7 @@ static int ecp_precompute_comb( const mbedtls_ecp_group *grp,
|
||||
* Normalize current elements in T. As T has holes,
|
||||
* use an auxiliary array of pointers to elements in T.
|
||||
*/
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
norm_dbl:
|
||||
#endif
|
||||
|
||||
@ -1475,7 +1475,7 @@ norm_dbl:
|
||||
|
||||
MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, j ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
rs_ctx->rsm->state++;
|
||||
#endif
|
||||
@ -1484,7 +1484,7 @@ norm_dbl:
|
||||
* Compute the remaining ones using the minimal number of additions
|
||||
* Be careful to update T[2^l] only after using it!
|
||||
*/
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
add:
|
||||
#endif
|
||||
|
||||
@ -1497,7 +1497,7 @@ add:
|
||||
MBEDTLS_MPI_CHK( ecp_add_mixed( grp, &T[i + j], &T[j], &T[i] ) );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
rs_ctx->rsm->state++;
|
||||
#endif
|
||||
@ -1507,7 +1507,7 @@ add:
|
||||
* we still need the auxiliary array for homogeneity with last time.
|
||||
* Also, skip T[0] which is already normalised, being a copy of P.
|
||||
*/
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
norm_add:
|
||||
#endif
|
||||
|
||||
@ -1518,13 +1518,13 @@ norm_add:
|
||||
|
||||
MBEDTLS_MPI_CHK( ecp_normalize_jac_many( grp, TT, j ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
rs_ctx->rsm->state++;
|
||||
#endif
|
||||
|
||||
cleanup:
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL &&
|
||||
ret == MBEDTLS_ERR_ECP_IN_PROGRESS )
|
||||
{
|
||||
@ -1582,11 +1582,11 @@ static int ecp_mul_comb_core( const mbedtls_ecp_group *grp, mbedtls_ecp_point *R
|
||||
|
||||
mbedtls_ecp_point_init( &Txi );
|
||||
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
(void) rs_ctx;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL && rs_ctx->rsm->i != 0 )
|
||||
{
|
||||
/* restore current index (R already pointing to rs_ctx->rsm->R) */
|
||||
@ -1615,7 +1615,7 @@ cleanup:
|
||||
|
||||
mbedtls_ecp_point_free( &Txi );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
{
|
||||
if( ret == 0 )
|
||||
@ -1700,16 +1700,16 @@ static int ecp_mul_comb_after_precomp( const mbedtls_ecp_group *grp,
|
||||
unsigned char k[COMB_MAX_D + 1];
|
||||
mbedtls_ecp_point *RR = R;
|
||||
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
(void) rs_ctx;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
RR = &rs_ctx->rsm->R;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx == NULL || rs_ctx->rsm == NULL ||
|
||||
rs_ctx->rsm->state < ecp_rsm_final_norm )
|
||||
#endif
|
||||
@ -1720,7 +1720,7 @@ static int ecp_mul_comb_after_precomp( const mbedtls_ecp_group *grp,
|
||||
f_rng, p_rng, rs_ctx ) );
|
||||
MBEDTLS_MPI_CHK( ecp_safe_invert_jac( grp, RR, parity_trick ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL )
|
||||
rs_ctx->rsm->state++;
|
||||
#endif
|
||||
@ -1729,7 +1729,7 @@ static int ecp_mul_comb_after_precomp( const mbedtls_ecp_group *grp,
|
||||
ECP_BUDGET( ECP_OPS_INV );
|
||||
MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, RR ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, RR ) );
|
||||
#endif
|
||||
|
||||
@ -1798,11 +1798,11 @@ static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
unsigned char pre_len = 0, T_ok = 0;
|
||||
mbedtls_ecp_point *T = NULL;
|
||||
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
(void) rs_ctx;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/* set up our own sub-context if needed */
|
||||
if( ecp_max_ops != 0 && rs_ctx != NULL && rs_ctx->rsm == NULL )
|
||||
{
|
||||
@ -1834,7 +1834,7 @@ static int ecp_mul_comb( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
T_ok = 1;
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/* Pre-computed table: do we have one in progress? complete? */
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL && rs_ctx->rsm->T != NULL && T == NULL )
|
||||
{
|
||||
@ -1884,7 +1884,7 @@ cleanup:
|
||||
T = NULL;
|
||||
|
||||
/* does T belong to the restart context? */
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->rsm != NULL && ret == MBEDTLS_ERR_ECP_IN_PROGRESS && T != NULL )
|
||||
{
|
||||
/* transfer ownership of T from local function to rsm */
|
||||
@ -1903,7 +1903,7 @@ cleanup:
|
||||
}
|
||||
|
||||
/* don't free R while in progress in case R == P */
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
|
||||
#endif
|
||||
/* prevent caller from using invalid value */
|
||||
@ -1911,7 +1911,7 @@ cleanup:
|
||||
mbedtls_ecp_point_free( R );
|
||||
|
||||
/* clear our sub-context when not in progress (done or error) */
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) {
|
||||
ecp_restart_mul_free( rs_ctx->rsm );
|
||||
mbedtls_free( rs_ctx->rsm );
|
||||
@ -2130,7 +2130,7 @@ cleanup:
|
||||
/*
|
||||
* Restartable multiplication R = m * P
|
||||
*/
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
static
|
||||
#endif
|
||||
int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
@ -2143,7 +2143,7 @@ int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
char is_grp_capable = 0;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/* reset ops count for this call if top-level */
|
||||
if( rs_ctx != NULL && rs_ctx->depth++ == 0 )
|
||||
rs_ctx->ops_done = 0;
|
||||
@ -2157,7 +2157,7 @@ int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
|
||||
#endif /* MBEDTLS_ECP_INTERNAL_ALT */
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN) && defined(ECP_SHORTWEIERSTRASS)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE) && defined(ECP_SHORTWEIERSTRASS)
|
||||
/* skip argument check when restarting */
|
||||
if( ecp_get_type( grp ) != ECP_TYPE_SHORT_WEIERSTRASS ||
|
||||
rs_ctx == NULL || rs_ctx->rsm == NULL )
|
||||
@ -2191,7 +2191,7 @@ cleanup:
|
||||
|
||||
#endif /* MBEDTLS_ECP_INTERNAL_ALT */
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL )
|
||||
rs_ctx->depth--;
|
||||
#endif
|
||||
@ -2295,7 +2295,7 @@ cleanup:
|
||||
* Restartable linear combination
|
||||
* NOT constant-time
|
||||
*/
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
static
|
||||
#endif
|
||||
int mbedtls_ecp_muladd_restartable(
|
||||
@ -2312,7 +2312,7 @@ int mbedtls_ecp_muladd_restartable(
|
||||
char is_grp_capable = 0;
|
||||
#endif
|
||||
|
||||
#if !defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if !defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
(void) rs_ctx;
|
||||
#endif
|
||||
|
||||
@ -2329,7 +2329,7 @@ int mbedtls_ecp_muladd_restartable(
|
||||
|
||||
#endif /* MBEDTLS_ECP_INTERNAL_ALT */
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/* reset ops count for this call if top-level */
|
||||
if( rs_ctx != NULL && rs_ctx->depth++ == 0 )
|
||||
rs_ctx->ops_done = 0;
|
||||
@ -2358,17 +2358,17 @@ int mbedtls_ecp_muladd_restartable(
|
||||
if( rs_ctx->ma->state == ecp_rsma_norm )
|
||||
goto norm;
|
||||
}
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, pmP, m, P, rs_ctx ) );
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->ma != NULL )
|
||||
rs_ctx->ma->state++;
|
||||
|
||||
mul2:
|
||||
#endif
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_mul_shortcuts( grp, pR, n, Q, rs_ctx ) );
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->ma != NULL )
|
||||
rs_ctx->ma->state++;
|
||||
|
||||
@ -2376,7 +2376,7 @@ add:
|
||||
#endif
|
||||
ECP_BUDGET( ECP_OPS_ADD );
|
||||
MBEDTLS_MPI_CHK( ecp_add_mixed( grp, pR, pmP, pR ) );
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->ma != NULL )
|
||||
rs_ctx->ma->state++;
|
||||
|
||||
@ -2385,7 +2385,7 @@ norm:
|
||||
ECP_BUDGET( ECP_OPS_INV );
|
||||
MBEDTLS_MPI_CHK( ecp_normalize_jac( grp, pR ) );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
if( rs_ctx != NULL && rs_ctx->ma != NULL )
|
||||
MBEDTLS_MPI_CHK( mbedtls_ecp_copy( R, pR ) );
|
||||
#endif
|
||||
@ -2401,7 +2401,7 @@ cleanup:
|
||||
|
||||
mbedtls_ecp_point_free( &mP );
|
||||
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/* clear our sub-context when not in progress (done or error) */
|
||||
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) {
|
||||
ecp_restart_muladd_free( rs_ctx->ma );
|
||||
@ -2411,7 +2411,7 @@ cleanup:
|
||||
|
||||
if( rs_ctx != NULL )
|
||||
rs_ctx->depth--;
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
@ -276,9 +276,9 @@ static const char *features[] = {
|
||||
#if defined(MBEDTLS_ECP_NIST_OPTIM)
|
||||
"MBEDTLS_ECP_NIST_OPTIM",
|
||||
#endif /* MBEDTLS_ECP_NIST_OPTIM */
|
||||
#if defined(MBEDTLS_ECP_EARLY_RETURN)
|
||||
"MBEDTLS_ECP_EARLY_RETURN",
|
||||
#endif /* MBEDTLS_ECP_EARLY_RETURN */
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
"MBEDTLS_ECP_RESTARTABLE",
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
#if defined(MBEDTLS_ECDSA_DETERMINISTIC)
|
||||
"MBEDTLS_ECDSA_DETERMINISTIC",
|
||||
#endif /* MBEDTLS_ECDSA_DETERMINISTIC */
|
||||
|
@ -345,34 +345,34 @@ ecp_test_vect:MBEDTLS_ECP_DP_SECP256K1:"923C6D4756CD940CD1E13A359F6E0F0698791938
|
||||
ECP selftest
|
||||
ecp_selftest:
|
||||
|
||||
ECP early return mul secp256r1 restart disabled
|
||||
ECP restartable mul secp256r1 restart disabled
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_test_vect_restart:MBEDTLS_ECP_DP_SECP256R1:"814264145F2F56F2E96A8E337A1284993FAF432A5ABCE59E867B7291D507A3AF":"2AF502F3BE8952F2C9B5A8D4160D09E97165BE50BC42AE4A5E8D3B4BA83AEB15":"EB0FAF4CA986C4D38681A0F9872D79D56795BD4BFF6E6DE3C0F5015ECE5EFD85":"2CE1788EC197E096DB95A200CC0AB26A19CE6BCCAD562B8EEE1B593761CF7F41":"DD0F5396219D1EA393310412D19A08F1F5811E9DC8EC8EEA7F80D21C820C2788":"0357DCCD4C804D0D8D33AA42B848834AA5605F9AB0D37239A115BBB647936F50":0:0:0
|
||||
|
||||
ECP early return mul secp256r1 restart max_ops=1
|
||||
ECP restartable mul secp256r1 max_ops=1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_test_vect_restart:MBEDTLS_ECP_DP_SECP256R1:"814264145F2F56F2E96A8E337A1284993FAF432A5ABCE59E867B7291D507A3AF":"2AF502F3BE8952F2C9B5A8D4160D09E97165BE50BC42AE4A5E8D3B4BA83AEB15":"EB0FAF4CA986C4D38681A0F9872D79D56795BD4BFF6E6DE3C0F5015ECE5EFD85":"2CE1788EC197E096DB95A200CC0AB26A19CE6BCCAD562B8EEE1B593761CF7F41":"DD0F5396219D1EA393310412D19A08F1F5811E9DC8EC8EEA7F80D21C820C2788":"0357DCCD4C804D0D8D33AA42B848834AA5605F9AB0D37239A115BBB647936F50":1:1:5000
|
||||
|
||||
ECP early return mul secp256r1 restart max_ops=10000
|
||||
ECP restartable mul secp256r1 max_ops=10000
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_test_vect_restart:MBEDTLS_ECP_DP_SECP256R1:"814264145F2F56F2E96A8E337A1284993FAF432A5ABCE59E867B7291D507A3AF":"2AF502F3BE8952F2C9B5A8D4160D09E97165BE50BC42AE4A5E8D3B4BA83AEB15":"EB0FAF4CA986C4D38681A0F9872D79D56795BD4BFF6E6DE3C0F5015ECE5EFD85":"2CE1788EC197E096DB95A200CC0AB26A19CE6BCCAD562B8EEE1B593761CF7F41":"DD0F5396219D1EA393310412D19A08F1F5811E9DC8EC8EEA7F80D21C820C2788":"0357DCCD4C804D0D8D33AA42B848834AA5605F9AB0D37239A115BBB647936F50":10000:0:0
|
||||
|
||||
ECP early return mul secp256r1 restart max_ops=250
|
||||
ECP restartable mul secp256r1 max_ops=250
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_test_vect_restart:MBEDTLS_ECP_DP_SECP256R1:"814264145F2F56F2E96A8E337A1284993FAF432A5ABCE59E867B7291D507A3AF":"2AF502F3BE8952F2C9B5A8D4160D09E97165BE50BC42AE4A5E8D3B4BA83AEB15":"EB0FAF4CA986C4D38681A0F9872D79D56795BD4BFF6E6DE3C0F5015ECE5EFD85":"2CE1788EC197E096DB95A200CC0AB26A19CE6BCCAD562B8EEE1B593761CF7F41":"DD0F5396219D1EA393310412D19A08F1F5811E9DC8EC8EEA7F80D21C820C2788":"0357DCCD4C804D0D8D33AA42B848834AA5605F9AB0D37239A115BBB647936F50":250:2:32
|
||||
|
||||
ECP early return muladd secp256r1 restart disabled
|
||||
ECP restartable muladd secp256r1 restart disabled
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_muladd_restart:MBEDTLS_ECP_DP_SECP256R1:"CB28E0999B9C7715FD0A80D8E47A77079716CBBF917DD72E97566EA1C066957C":"2B57C0235FB7489768D058FF4911C20FDBE71E3699D91339AFBB903EE17255DC":"C3875E57C85038A0D60370A87505200DC8317C8C534948BEA6559C7C18E6D4CE":"3B4E49C4FDBFC006FF993C81A50EAE221149076D6EC09DDD9FB3B787F85B6483":"2442A5CC0ECD015FA3CA31DC8E2BBC70BF42D60CBCA20085E0822CB04235E970":"6FC98BD7E50211A4A27102FA3549DF79EBCB4BF246B80945CDDFE7D509BBFD7D":0:0:0
|
||||
|
||||
ECP early return muladd secp256r1 restart max_ops=1
|
||||
ECP restartable muladd secp256r1 max_ops=1
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_muladd_restart:MBEDTLS_ECP_DP_SECP256R1:"CB28E0999B9C7715FD0A80D8E47A77079716CBBF917DD72E97566EA1C066957C":"2B57C0235FB7489768D058FF4911C20FDBE71E3699D91339AFBB903EE17255DC":"C3875E57C85038A0D60370A87505200DC8317C8C534948BEA6559C7C18E6D4CE":"3B4E49C4FDBFC006FF993C81A50EAE221149076D6EC09DDD9FB3B787F85B6483":"2442A5CC0ECD015FA3CA31DC8E2BBC70BF42D60CBCA20085E0822CB04235E970":"6FC98BD7E50211A4A27102FA3549DF79EBCB4BF246B80945CDDFE7D509BBFD7D":1:1:10000
|
||||
|
||||
ECP early return muladd secp256r1 restart max_ops=10000
|
||||
ECP restartable muladd secp256r1 max_ops=10000
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_muladd_restart:MBEDTLS_ECP_DP_SECP256R1:"CB28E0999B9C7715FD0A80D8E47A77079716CBBF917DD72E97566EA1C066957C":"2B57C0235FB7489768D058FF4911C20FDBE71E3699D91339AFBB903EE17255DC":"C3875E57C85038A0D60370A87505200DC8317C8C534948BEA6559C7C18E6D4CE":"3B4E49C4FDBFC006FF993C81A50EAE221149076D6EC09DDD9FB3B787F85B6483":"2442A5CC0ECD015FA3CA31DC8E2BBC70BF42D60CBCA20085E0822CB04235E970":"6FC98BD7E50211A4A27102FA3549DF79EBCB4BF246B80945CDDFE7D509BBFD7D":10000:0:0
|
||||
|
||||
ECP early return muladd secp256r1 restart max_ops=250
|
||||
ECP restartable muladd secp256r1 max_ops=250
|
||||
depends_on:MBEDTLS_ECP_DP_SECP256R1_ENABLED
|
||||
ecp_muladd_restart:MBEDTLS_ECP_DP_SECP256R1:"CB28E0999B9C7715FD0A80D8E47A77079716CBBF917DD72E97566EA1C066957C":"2B57C0235FB7489768D058FF4911C20FDBE71E3699D91339AFBB903EE17255DC":"C3875E57C85038A0D60370A87505200DC8317C8C534948BEA6559C7C18E6D4CE":"3B4E49C4FDBFC006FF993C81A50EAE221149076D6EC09DDD9FB3B787F85B6483":"2442A5CC0ECD015FA3CA31DC8E2BBC70BF42D60CBCA20085E0822CB04235E970":"6FC98BD7E50211A4A27102FA3549DF79EBCB4BF246B80945CDDFE7D509BBFD7D":250:4:64
|
||||
|
@ -51,7 +51,7 @@ exit:
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_ECP_EARLY_RETURN */
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_ECP_RESTARTABLE */
|
||||
void ecp_test_vect_restart( int id,
|
||||
char *dA_str, char *xA_str, char *yA_str,
|
||||
char *dB_str, char *xZ_str, char *yZ_str,
|
||||
@ -145,7 +145,7 @@ exit:
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_ECP_EARLY_RETURN */
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_ECP_RESTARTABLE */
|
||||
void ecp_muladd_restart( int id, char *xR_str, char *yR_str,
|
||||
char *u1_str, char *u2_str,
|
||||
char *xQ_str, char *yQ_str,
|
||||
|
Loading…
Reference in New Issue
Block a user