mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 12:05:31 +00:00
Fix a few unchecked return codes in EC
This commit is contained in:
parent
9e4191c3e7
commit
26bc1c0f5d
|
@ -798,8 +798,8 @@ static int ecp_normalize_jac_many( const ecp_group *grp,
|
||||||
* - shrinking other coordinates, but still keeping the same number of
|
* - shrinking other coordinates, but still keeping the same number of
|
||||||
* limbs as P, as otherwise it will too likely be regrown too fast.
|
* limbs as P, as otherwise it will too likely be regrown too fast.
|
||||||
*/
|
*/
|
||||||
mpi_shrink( &T[i]->X, grp->P.n );
|
MPI_CHK( mpi_shrink( &T[i]->X, grp->P.n ) );
|
||||||
mpi_shrink( &T[i]->Y, grp->P.n );
|
MPI_CHK( mpi_shrink( &T[i]->Y, grp->P.n ) );
|
||||||
mpi_free( &T[i]->Z );
|
mpi_free( &T[i]->Z );
|
||||||
|
|
||||||
if( i == 0 )
|
if( i == 0 )
|
||||||
|
@ -1036,7 +1036,7 @@ int ecp_sub( const ecp_group *grp, ecp_point *R,
|
||||||
return( POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE );
|
return( POLARSSL_ERR_ECP_FEATURE_UNAVAILABLE );
|
||||||
|
|
||||||
/* mQ = - Q */
|
/* mQ = - Q */
|
||||||
ecp_copy( &mQ, Q );
|
MPI_CHK( ecp_copy( &mQ, Q ) );
|
||||||
if( mpi_cmp_int( &mQ.Y, 0 ) != 0 )
|
if( mpi_cmp_int( &mQ.Y, 0 ) != 0 )
|
||||||
MPI_CHK( mpi_sub_mpi( &mQ.Y, &grp->P, &mQ.Y ) );
|
MPI_CHK( mpi_sub_mpi( &mQ.Y, &grp->P, &mQ.Y ) );
|
||||||
|
|
||||||
|
@ -1195,7 +1195,7 @@ static int ecp_precompute_comb( const ecp_group *grp,
|
||||||
TT[k++] = cur;
|
TT[k++] = cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
ecp_normalize_jac_many( grp, TT, k );
|
MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) );
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compute the remaining ones using the minimal number of additions
|
* Compute the remaining ones using the minimal number of additions
|
||||||
|
@ -1207,12 +1207,12 @@ static int ecp_precompute_comb( const ecp_group *grp,
|
||||||
j = i;
|
j = i;
|
||||||
while( j-- )
|
while( j-- )
|
||||||
{
|
{
|
||||||
ecp_add_mixed( grp, &T[i + j], &T[j], &T[i] );
|
MPI_CHK( ecp_add_mixed( grp, &T[i + j], &T[j], &T[i] ) );
|
||||||
TT[k++] = &T[i + j];
|
TT[k++] = &T[i + j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ecp_normalize_jac_many( grp, TT, k );
|
MPI_CHK( ecp_normalize_jac_many( grp, TT, k ) );
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
Loading…
Reference in a new issue