diff --git a/wolfssl/wolfcrypt/wc_pkcs11.h b/wolfssl/wolfcrypt/wc_pkcs11.h index 98a1ead23..614f65d8d 100644 --- a/wolfssl/wolfcrypt/wc_pkcs11.h +++ b/wolfssl/wolfcrypt/wc_pkcs11.h @@ -33,6 +33,11 @@ #include #include +#ifdef __cplusplus + extern "C" { +#endif + + typedef struct Pkcs11Dev { void* dlHandle; /* Handle to library */ CK_FUNCTION_LIST* func; /* Array of functions */ @@ -53,10 +58,6 @@ typedef struct Pkcs11Session { CK_SESSION_HANDLE handle; /* Handle to active session */ } Pkcs11Session; -#ifdef __cplusplus - extern "C" { -#endif - /* Types of keys that can be stored. */ enum Pkcs11KeyType { PKCS11_KEY_TYPE_AES_GCM, diff --git a/wolfssl/wolfcrypt/wolfmath.h b/wolfssl/wolfcrypt/wolfmath.h index 707dcf5fa..a1c03084f 100644 --- a/wolfssl/wolfcrypt/wolfmath.h +++ b/wolfssl/wolfcrypt/wolfmath.h @@ -19,6 +19,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ +#ifdef __cplusplus + extern "C" { +#endif + +/* This section is included prior to wolfmath.h below */ #if defined(HAVE_WOLF_BIGINT) && !defined(WOLF_BIGINT_DEFINED) /* raw big integer */ typedef struct WC_BIGINT { @@ -30,8 +35,8 @@ #define WOLF_BIGINT_DEFINED #endif - /* only define functions if mp_int has been declared */ +/* The MP_INT_DEFINED is defined in tfm.h and integer.h after mp_int */ #ifdef MP_INT_DEFINED #ifndef __WOLFMATH_H__ @@ -57,7 +62,7 @@ WC_TYPE_UNSIGNED_BIN = 2, }; - WOLFSSL_API int wc_export_int(mp_int* mp, byte* buf, word32* len, + WOLFSSL_API int wc_export_int(mp_int* mp, byte* buf, word32* len, word32 keySz, int encType); #ifdef HAVE_WOLF_BIGINT @@ -76,3 +81,7 @@ #endif /* __WOLFMATH_H__ */ #endif /* MP_INT_DEFINED */ + +#ifdef __cplusplus + } /* extern "C" */ +#endif