Merge pull request #7758 from xkqian/bignum_clone_ecp_curves
[Bignum] Bignum clone ecp curves
This commit is contained in:
commit
b52f9cf5eb
5 changed files with 6051 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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
6044
library/ecp_curves_new.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue