Merge pull request #7758 from xkqian/bignum_clone_ecp_curves

[Bignum] Bignum clone ecp curves
This commit is contained in:
Janos Follath 2023-07-26 13:33:56 +01:00 committed by GitHub
commit b52f9cf5eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6051 additions and 2 deletions

View file

@ -39,6 +39,7 @@ set(src_crypto
ecp.c
ecp_new.c
ecp_curves.c
ecp_curves_new.c
entropy.c
entropy_poll.c
error.c

View file

@ -104,6 +104,7 @@ OBJS_CRYPTO= \
ecp.o \
ecp_new.o \
ecp_curves.o \
ecp_curves_new.o \
entropy.o \
entropy_poll.o \
error.o \

View file

@ -19,6 +19,8 @@
#include "common.h"
#if !defined(MBEDTLS_ECP_WITH_MPI_UINT)
#if defined(MBEDTLS_ECP_LIGHT)
#include "mbedtls/ecp.h"
@ -6039,3 +6041,4 @@ int mbedtls_ecp_modulus_setup(mbedtls_mpi_mod_modulus *N,
#endif /* MBEDTLS_TEST_HOOKS */
#endif /* !MBEDTLS_ECP_ALT */
#endif /* MBEDTLS_ECP_LIGHT */
#endif /* MBEDTLS_ECP_WITH_MPI_UINT */

6044
library/ecp_curves_new.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -2932,9 +2932,9 @@ int mbedtls_ecp_muladd(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
#if defined(MBEDTLS_ECP_MONTGOMERY_ENABLED)
#if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)
#define ECP_MPI_INIT(s, n, p) { s, (n), (mbedtls_mpi_uint *) (p) }
#define ECP_MPI_INIT(_p, _n) { .p = (mbedtls_mpi_uint *) (_p), .s = 1, .n = (_n) }
#define ECP_MPI_INIT_ARRAY(x) \
ECP_MPI_INIT(1, sizeof(x) / sizeof(mbedtls_mpi_uint), x)
ECP_MPI_INIT(x, sizeof(x) / sizeof(mbedtls_mpi_uint))
/*
* Constants for the two points other than 0, 1, -1 (mod p) in
* https://cr.yp.to/ecdh.html#validate