Added new ECC export API's to support export as hex string. New API's are wc_ecc_export_ex and wc_ecc_export_int. For hex string use ECC_TYPE_HEX_STR as encType arg. Refactor to reduce duplicate code. Build fixes for NO_ECC_KEY_EXPORT.

This commit is contained in:
David Garske
2018-08-07 15:51:59 -07:00
parent 64f553d944
commit c073aee87c
7 changed files with 106 additions and 113 deletions

View File

@@ -4915,7 +4915,8 @@ int mp_read_radix (mp_int * a, const char *str, int radix)
#if defined(WOLFSSL_KEY_GEN) || defined(HAVE_COMP_KEY) || \
defined(WOLFSSL_DEBUG_MATH) || defined(DEBUG_WOLFSSL) || \
defined(WOLFSSL_PUBLIC_MP)
defined(WOLFSSL_PUBLIC_MP) || \
(defined(HAVE_ECC) && defined(HAVE_ECC_KEY_EXPORT))
/* returns size of ASCII representation */
int mp_radix_size (mp_int *a, int radix, int *size)