From 7c604bfc4809253ee5390ae7c856f2466069216d Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 22 Aug 2017 13:11:20 -0700 Subject: [PATCH] Fixes for building with `WOLFSSL_ATECC508A`. --- wolfcrypt/src/ecc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 13ce96ee5..9ed7a55f6 100755 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -961,7 +961,9 @@ const ecc_set_type ecc_sets[] = { static int wc_ecc_export_x963_compressed(ecc_key*, byte* out, word32* outLen); #endif -#ifndef WOLFSSL_ATECC508A +#ifdef WOLFSSL_ATECC508A + typedef void* ecc_curve_spec; +#else static int ecc_check_pubkey_order(ecc_key* key, ecc_point* pubkey, mp_int* a, mp_int* prime, mp_int* order); @@ -3008,13 +3010,14 @@ static int wc_ecc_make_pub_ex(ecc_key* key, ecc_curve_spec* curveIn, #ifndef WOLFSSL_ATECC508A ecc_point* base = NULL; DECLARE_CURVE_SPECS(ECC_CURVE_FIELD_COUNT) -#endif ecc_point* pub; +#endif if (key == NULL) { return BAD_FUNC_ARG; } +#ifndef WOLFSSL_ATECC508A /* if ecc_point passed in then use it as output for public key point */ if (pubOut != NULL) { pub = pubOut; @@ -3090,6 +3093,8 @@ static int wc_ecc_make_pub_ex(ecc_key* key, ecc_curve_spec* curveIn, wc_ecc_curve_free(curve); } +#endif /* WOLFSSL_ATECC508A */ + /* change key state if public part is cached */ if (key->type == ECC_PRIVATEKEY_ONLY && pubOut == NULL) { key->type = ECC_PRIVATEKEY;