SmartSnippets DA1459x SDK
Files | Data Structures | Macros | Enumerations | Functions | Variables

Elliptic curves data. More...

Files

file  crypto_ec.h
 Elliptic curves data.
 
file  crypto_ecc_provider_function_map.h
 ECC curvetype - libprovider mapping macro definitions.
 
file  crypto_ecc_provider_functions.h
 Elliptic curves primitives and basic datatypes. Depending on ecc library and curve settings, the primitives provided from this header will be mapped to the respective functions.
 
file  crypto_ecc_provider_params.h
 Elliptic curves parameters.
 

Data Structures

struct  crypto_ec_params_t
 Elliptic curve parameters. More...
 

Macros

#define dg_ALLOW_DYNAMIC_LIB_PROVIDER   0
 Dynamic ecc library selection flag. More...
 

Enumerations

enum  ECC_CRYPTO_LIB_PROVIDER { HW_ECC = HW_ECC_ID, UECC_LIB = UECC_LIB_ID, SODIUM_LIB = SODIUM_LIB_ID }
 ECC library providers. More...
 
enum  CRYPTO_ECC_CURVE
 ECC supported curves type.
 
enum  CRYPTO_ECC_PROVIDER_RET {
  CRYPTO_ECC_PROVIDER_RET_OK = 0, CRYPTO_ECC_PROVIDER_RET_INIT_FAIL, CRYPTO_ECC_PROVIDER_RET_NOT_PROVIDED, CRYPTO_ECC_PROVIDER_RET_INVALID_LIB,
  CRYPTO_ECC_PROVIDER_RET_INVALID_CURVE, CRYPTO_ECC_PROVIDER_RET_MUTEX_LOCKED, CRYPTO_ECC_PROVIDER_RET_ERROR
}
 ECC Provider API return codes. More...
 

Functions

CRYPTO_ECC_PROVIDER_RET crypto_ecc_curve_init (crypto_ec_params_t *curve, CRYPTO_ECC_CURVE curve_type)
 Initialize ecc_curve.
 
CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_public_key (crypto_ec_params_t *curve, uint8_t *d, uint8_t *Q)
 Compute public key ecc primitive. More...
 
CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_private_key (crypto_ec_params_t *curve, uint8_t *d)
 Compute private key ecc primitive. More...
 
CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_shared_secret (crypto_ec_params_t *curve, uint8_t *d, uint8_t *Qp, uint8_t *s)
 Compute shared secret key ecc primitive. More...
 

Variables

ECC_CRYPTO_LIB_PROVIDER curve_lib_provider_index [ECC_CRYPTO_LAST_VALUE]
 Index table informs which curve is implemented by which library provider. More...
 
const bool lib_provider_truthtable [ECC_CRYPTO_LAST_VALUE][CRYPTO_ECC_PROVIDER_LAST_VALUE]
 Truth table informs if a curve is provided by the respective library. More...
 

Detailed Description

Elliptic curves data.

Elliptic curves primitives and basic datatypes.

Elliptic curves provider function mapping.

Macro Definition Documentation

◆ dg_ALLOW_DYNAMIC_LIB_PROVIDER

#define dg_ALLOW_DYNAMIC_LIB_PROVIDER   0

Dynamic ecc library selection flag.

Set in order to allow ecc library providers to be changed during runtime. This is practical only for testing purposes, ie cross checking library implementations of the same algorithm from the same binary file.

Enumeration Type Documentation

◆ CRYPTO_ECC_PROVIDER_RET

ECC Provider API return codes.

Enumerator
CRYPTO_ECC_PROVIDER_RET_OK 

No error.

CRYPTO_ECC_PROVIDER_RET_INIT_FAIL 

Failed to initialize external library during curve initialization.

CRYPTO_ECC_PROVIDER_RET_NOT_PROVIDED 

No provider library for the requested curve.

CRYPTO_ECC_PROVIDER_RET_INVALID_LIB 

Invalid library request.

CRYPTO_ECC_PROVIDER_RET_INVALID_CURVE 

Invalid curve request.

CRYPTO_ECC_PROVIDER_RET_MUTEX_LOCKED 

Crypto library mutex is locked.

CRYPTO_ECC_PROVIDER_RET_ERROR 

Other error.

◆ ECC_CRYPTO_LIB_PROVIDER

ECC library providers.

Enumerator
HW_ECC 

hw ecc coprocessor.

UECC_LIB 

uECC library.

SODIUM_LIB 

sodium library.

Function Documentation

◆ crypto_ecc_compute_private_key()

CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_private_key ( crypto_ec_params_t curve,
uint8_t *  d 
)

Compute private key ecc primitive.

Calculates the private key. Depending on ecc library provider and curve settings, the appropriate function call will be made from ecc_compute_public_jump_table.

Parameters
[in]curveThe curve parameter object for which the key will be generated
[out]dPointer to the private key.
Returns
ecc provider status.

◆ crypto_ecc_compute_public_key()

CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_public_key ( crypto_ec_params_t curve,
uint8_t *  d,
uint8_t *  Q 
)

Compute public key ecc primitive.

Calculates the public key given a private key. Depending on ecc library provider and curve settings, the appropriate function call will be made from ecc_compute_public_jump_table.

Parameters
[in]curveThe curve parameter object for which the key will be generated
[in]dPointer to the private key.
[out]QPointer to the public key to be generated.
Returns
ecc provider status.

◆ crypto_ecc_compute_shared_secret()

CRYPTO_ECC_PROVIDER_RET crypto_ecc_compute_shared_secret ( crypto_ec_params_t curve,
uint8_t *  d,
uint8_t *  Qp,
uint8_t *  s 
)

Compute shared secret key ecc primitive.

Calculates the public key given a private key. Depending on ecc library provider and curve settings, the appropriate function call will be made from ecc_compute_public_jump_table.

Parameters
[in]curveThe curve parameter object for which the key will be generated
[in]dPointer to the private key.
[in]QpPointer to the peers public key that will be used to create the shared key.
[out]sPointer to the generated shared key.
Returns
ecc provider status.

Variable Documentation

◆ curve_lib_provider_index

ECC_CRYPTO_LIB_PROVIDER curve_lib_provider_index[ECC_CRYPTO_LAST_VALUE]

Index table informs which curve is implemented by which library provider.

This is used for dynamically changing library provider for a specific curve. Row index must be the same as CRYPTO_ECC_CURVE

◆ lib_provider_truthtable

const bool lib_provider_truthtable[ECC_CRYPTO_LAST_VALUE][CRYPTO_ECC_PROVIDER_LAST_VALUE]

Truth table informs if a curve is provided by the respective library.

This is used for checking if a requested curved can be implemented by a requested library.