mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-10 17:40:52 +02:00
add WOLFSSL_ATECC6088A, Trust&GO support, PIC32 HAL compatibility, 608A expansions
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
|
||||
#include <wolfssl/wolfcrypt/port/atmel/atmel.h>
|
||||
#endif /* WOLFSSL_ATECC508A */
|
||||
|
||||
@@ -127,7 +127,7 @@ enum {
|
||||
ECC_MAX_SIG_SIZE= ((MAX_ECC_BYTES * 2) + ECC_MAX_PAD_SZ + SIG_HEADER_SZ),
|
||||
|
||||
/* max crypto hardware size */
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
|
||||
ECC_MAX_CRYPTO_HW_SIZE = ATECC_KEY_SIZE, /* from port/atmel/atmel.h */
|
||||
ECC_MAX_CRYPTO_HW_PUBKEY_SIZE = (ATECC_KEY_SIZE*2),
|
||||
#elif defined(PLUTON_CRYPTO_ECC)
|
||||
@@ -369,7 +369,7 @@ struct ecc_key {
|
||||
void* heap; /* heap hint */
|
||||
ecc_point pubkey; /* public key */
|
||||
mp_int k; /* private key */
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
|
||||
int slot; /* Key Slot Number (-1 unknown) */
|
||||
byte pubkey_raw[ECC_MAX_CRYPTO_HW_PUBKEY_SIZE];
|
||||
#endif
|
||||
@@ -427,7 +427,7 @@ extern const size_t ecc_sets_count;
|
||||
WOLFSSL_API
|
||||
const char* wc_ecc_get_name(int curve_id);
|
||||
|
||||
#ifndef WOLFSSL_ATECC508A
|
||||
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
|
||||
|
||||
#ifdef WOLFSSL_PUBLIC_ECC_ADD_DBL
|
||||
#define ECC_API WOLFSSL_API
|
||||
@@ -472,7 +472,8 @@ WOLFSSL_API
|
||||
int wc_ecc_shared_secret_ex(ecc_key* private_key, ecc_point* point,
|
||||
byte* out, word32 *outlen);
|
||||
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(PLUTON_CRYPTO_ECC) || defined(WOLFSSL_CRYPTOCELL)
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
|
||||
defined(PLUTON_CRYPTO_ECC) || defined(WOLFSSL_CRYPTOCELL)
|
||||
#define wc_ecc_shared_secret_ssh wc_ecc_shared_secret
|
||||
#else
|
||||
#define wc_ecc_shared_secret_ssh wc_ecc_shared_secret_ex /* For backwards compat */
|
||||
@@ -571,7 +572,7 @@ int wc_ecc_cmp_point(ecc_point* a, ecc_point *b);
|
||||
WOLFSSL_API
|
||||
int wc_ecc_point_is_at_infinity(ecc_point *p);
|
||||
|
||||
#ifndef WOLFSSL_ATECC508A
|
||||
#if !defined(WOLFSSL_ATECC508A) && !defined(WOLFSSL_ATECC608A)
|
||||
WOLFSSL_API
|
||||
int wc_ecc_mulmod(mp_int* k, ecc_point *G, ecc_point *R,
|
||||
mp_int* a, mp_int* modulus, int map);
|
||||
|
||||
@@ -27,14 +27,15 @@
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
#include <wolfssl/wolfcrypt/error-crypt.h>
|
||||
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC_PKCB)
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A) || \
|
||||
defined(WOLFSSL_ATECC_PKCB)
|
||||
#undef SHA_BLOCK_SIZE
|
||||
#define SHA_BLOCK_SIZE SHA_BLOCK_SIZE_REMAP
|
||||
#include <cryptoauthlib.h>
|
||||
#undef SHA_BLOCK_SIZE
|
||||
#endif
|
||||
|
||||
/* ATECC508A only supports ECC P-256 */
|
||||
/* ATECC508A/608A only supports ECC P-256 */
|
||||
#define ATECC_KEY_SIZE (32)
|
||||
#define ATECC_PUBKEY_SIZE (ATECC_KEY_SIZE*2) /* X and Y */
|
||||
#define ATECC_SIG_SIZE (ATECC_KEY_SIZE*2) /* R and S */
|
||||
@@ -53,11 +54,19 @@
|
||||
#endif
|
||||
/* Symmetric encryption key */
|
||||
#ifndef ATECC_SLOT_I2C_ENC
|
||||
#define ATECC_SLOT_I2C_ENC (0x04)
|
||||
#ifdef WOLFSSL_ATECC_TNGTLS
|
||||
#define ATECC_SLOT_I2C_ENC (0x06)
|
||||
#else
|
||||
#define ATECC_SLOT_I2C_ENC (0x04)
|
||||
#endif
|
||||
#endif
|
||||
/* Parent encryption key */
|
||||
#ifndef ATECC_SLOT_ENC_PARENT
|
||||
#define ATECC_SLOT_ENC_PARENT (0x7)
|
||||
#ifdef WOLFSSL_ATECC_TNGTLS
|
||||
#define ATECC_SLOT_ENC_PARENT (0x6)
|
||||
#else
|
||||
#define ATECC_SLOT_ENC_PARENT (0x7)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* ATECC_KEY_SIZE required for ecc.h */
|
||||
@@ -78,7 +87,7 @@ int atmel_get_random_number(uint32_t count, uint8_t* rand_out);
|
||||
#endif
|
||||
long atmel_get_curr_time_and_date(long* tm);
|
||||
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
#if defined(WOLFSSL_ATECC508A) || defined(WOLFSSL_ATECC608A)
|
||||
|
||||
enum atmelSlotType {
|
||||
ATMEL_SLOT_ANY,
|
||||
@@ -100,6 +109,8 @@ int atmel_ecc_translate_err(int status);
|
||||
int atmel_get_rev_info(word32* revision);
|
||||
void atmel_show_rev_info(void);
|
||||
|
||||
WOLFSSL_API int wolfCrypt_ATECC_SetConfig(ATCAIfaceCfg* cfg);
|
||||
|
||||
/* The macro ATECC_GET_ENC_KEY can be set to override the default
|
||||
encryption key with your own at build-time */
|
||||
#ifndef ATECC_GET_ENC_KEY
|
||||
|
||||
@@ -383,6 +383,14 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef WOLFSSL_ATECC508A
|
||||
/* backwards compatibility */
|
||||
#define WOLFSSL_ATECC_ECDH_ENC
|
||||
#ifdef WOLFSSL_ATECC508A_DEBUG
|
||||
#define WOLFSSL_ATECC_DEBUG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef MBED
|
||||
#define WOLFSSL_USER_IO
|
||||
#define NO_FILESYSTEM
|
||||
|
||||
Reference in New Issue
Block a user