mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 12:15:41 +01:00
Merge pull request #3209 from aurel32/fix-ecp_double_add_mxz
Fix wrong modulo call in ecp_double_add_mxz
This commit is contained in:
commit
b1c8e41ae3
4
ChangeLog.d/fix-ecp_double_add_mxz.txt
Normal file
4
ChangeLog.d/fix-ecp_double_add_mxz.txt
Normal file
@ -0,0 +1,4 @@
|
||||
Changes
|
||||
* Fix minor performance issue in operations on Curve25519 caused by using a
|
||||
suboptimal modular reduction in one place. Found and fix contributed by
|
||||
Aurelien Jarno in #3209.
|
@ -2332,7 +2332,7 @@ static int ecp_double_add_mxz( const mbedtls_ecp_group *grp,
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mod( grp, &D, &Q->X, &Q->Z ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &DA, &D, &A ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &CB, &C, &B ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_add_mpi( &S->X, &DA, &CB ) ); MOD_MUL( S->X );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_add_mod( grp, &S->X, &DA, &CB ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &S->X, &S->X, &S->X ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_sub_mod( grp, &S->Z, &DA, &CB ) );
|
||||
MBEDTLS_MPI_CHK( mbedtls_mpi_mul_mod( grp, &S->Z, &S->Z, &S->Z ) );
|
||||
|
Loading…
Reference in New Issue
Block a user