forked from wolfSSL/wolfssl
configure.ac: fix -DNO_BIG_INT setup to recognize $ENABLED_SP_MATH.
wolfcrypt/test/test.c: fix gating around modLen in rsa_test(). wolfssl/openssl/bn.h: remove superfluous WOLFSSL_SP_MATH gate around mp_int mpi in struct WOLFSSL_BIGNUM definition. wolfssl/wolfcrypt/wolfmath.h: add check for "Conflicting MPI settings.", add initial check for WOLFSSL_SP_MATH_ALL || WOLFSSL_SP_MATH to include sp_int.h, and remove superfluous WOLFSSL_SP_MATH gate on "common math functions".
This commit is contained in:
@@ -9809,8 +9809,8 @@ AS_IF([test "x$ENABLED_16BIT" = "xyes" && \
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Update CFLAGS based on options #
|
# Update CFLAGS based on options #
|
||||||
################################################################################
|
################################################################################
|
||||||
AS_IF([test "x$ENABLED_SP_MATH_ALL" = "xno" && test "x$ENABLED_FASTMATH" = "xno" &&
|
AS_IF([test "$ENABLED_SP_MATH" = "no" && test "$ENABLED_SP_MATH_ALL" = "no" &&
|
||||||
test "x$ENABLED_HEAPMATH" = "xno"],
|
test "$ENABLED_FASTMATH" = "no" && test "$ENABLED_HEAPMATH" = "no"],
|
||||||
[AM_CFLAGS="$AM_CFLAGS -DNO_BIG_INT"])
|
[AM_CFLAGS="$AM_CFLAGS -DNO_BIG_INT"])
|
||||||
|
|
||||||
AS_IF([test "x$ENABLED_CERTS" = "xno"],
|
AS_IF([test "x$ENABLED_CERTS" = "xno"],
|
||||||
|
@@ -22109,13 +22109,15 @@ WOLFSSL_TEST_SUBROUTINE wc_test_ret_t rsa_test(void)
|
|||||||
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_rsa);
|
ERROR_OUT(WC_TEST_RET_ENC_EC(ret), exit_rsa);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_SIG_WRAPPER) && !defined(NO_SHA256)
|
#ifndef NO_SIG_WRAPPER
|
||||||
|
#ifndef NO_SHA256
|
||||||
ret = rsa_sig_test(key, sizeof *key, modLen, &rng);
|
ret = rsa_sig_test(key, sizeof *key, modLen, &rng);
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
goto exit_rsa;
|
goto exit_rsa;
|
||||||
#else
|
#else /* NO_SHA256 */
|
||||||
(void)modLen;
|
(void)modLen;
|
||||||
#endif
|
#endif /* NO_SHA256 */
|
||||||
|
#endif /* !NO_SIG_WRAPPER */
|
||||||
|
|
||||||
#ifdef WC_RSA_NONBLOCK
|
#ifdef WC_RSA_NONBLOCK
|
||||||
ret = rsa_nb_test(key, in, inLen, out, outSz, plain, plainSz, &rng);
|
ret = rsa_nb_test(key, in, inLen, out, outSz, plain, plainSz, &rng);
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
typedef struct WOLFSSL_BIGNUM {
|
typedef struct WOLFSSL_BIGNUM {
|
||||||
int neg; /* openssh deference */
|
int neg; /* openssh deference */
|
||||||
void *internal; /* our big num */
|
void *internal; /* our big num */
|
||||||
#if !defined(NO_BIG_INT) || defined(WOLFSSL_SP_MATH)
|
#if !defined(NO_BIG_INT)
|
||||||
mp_int mpi;
|
mp_int mpi;
|
||||||
#endif
|
#endif
|
||||||
} WOLFSSL_BIGNUM;
|
} WOLFSSL_BIGNUM;
|
||||||
|
@@ -42,6 +42,13 @@ This library provides big integer math functions.
|
|||||||
|
|
||||||
#if defined(NO_BIG_INT)
|
#if defined(NO_BIG_INT)
|
||||||
/* MPI globally disabled -- no PK algorithms supported. */
|
/* MPI globally disabled -- no PK algorithms supported. */
|
||||||
|
#if defined(USE_FAST_MATH) || defined(USE_INTEGER_HEAP_MATH) || \
|
||||||
|
defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH) || \
|
||||||
|
defined(HAVE_WOLF_BIGINT) || defined(WOLFSSL_EXPORT_INT)
|
||||||
|
#error Conflicting MPI settings.
|
||||||
|
#endif
|
||||||
|
#elif defined(WOLFSSL_SP_MATH_ALL) || defined(WOLFSSL_SP_MATH)
|
||||||
|
#include <wolfssl/wolfcrypt/sp_int.h>
|
||||||
#elif defined(USE_FAST_MATH)
|
#elif defined(USE_FAST_MATH)
|
||||||
#include <wolfssl/wolfcrypt/tfm.h>
|
#include <wolfssl/wolfcrypt/tfm.h>
|
||||||
#elif defined(USE_INTEGER_HEAP_MATH)
|
#elif defined(USE_INTEGER_HEAP_MATH)
|
||||||
@@ -74,7 +81,7 @@ This library provides big integer math functions.
|
|||||||
extern const wc_ptr_t wc_off_on_addr[2];
|
extern const wc_ptr_t wc_off_on_addr[2];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(NO_BIG_INT) || defined(WOLFSSL_SP_MATH)
|
#if !defined(NO_BIG_INT)
|
||||||
/* common math functions */
|
/* common math functions */
|
||||||
MP_API int get_digit_count(const mp_int* a);
|
MP_API int get_digit_count(const mp_int* a);
|
||||||
MP_API mp_digit get_digit(const mp_int* a, int n);
|
MP_API mp_digit get_digit(const mp_int* a, int n);
|
||||||
|
Reference in New Issue
Block a user