![]() |
![]() |
ECJPAKE driver implementation for the CC26X2 family.
============================================================================
This file should only be included in the board file to fill the ECJPAKE_config struct.
The CC26X2 family has a dedicated public key accelerator. It is capable of multiple mathematical operations including dedicated ECC point addition, doubling, and scalar multiplication. Only one operation can be carried out on the accerator at a time. Mutual exclusion is implemented at the driver level and coordinated between all drivers relying on the accelerator. It is transparent to the application and only noted ensure sensible access timeouts are set.
The large number maths engine (LNME) uses a dedicated 2kB block of RAM (PKA RAM) for its operations. The operands of the maths operations must be copied into and results out of the PKA ram. This necessitates a significant number of reads and writes for each operation. The bus interface to the RAM only allows for word-aligned reads and writes. The CPU splits the reads and writes from and to general SRAM from unaligned addresses into multiple bus operations while accumulating the data in a register until it is full. The result of this hardware process is that providing buffers such as plaintext CryptoKey keying material to ECC APIs that are word-aligned will significantly speed up the operation and reduce power consumption.
The driver implementation does not perform runtime checks for most input parameters. Only values that are likely to have a stochastic element to them are checked (such as whether a driver is already open). Higher input paramter validation coverage is achieved by turning on assertions when compiling the driver.
Currently, only PMSNs with lengths that are a multiple of 64 bits can be internally generated.
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/Power.h>
#include <ti/drivers/ECJPAKE.h>
#include <ti/drivers/cryptoutils/ecc/ECCParams.h>
#include <ti/drivers/cryptoutils/cryptokey/CryptoKey.h>
#include <ti/drivers/dpl/HwiP.h>
#include <ti/drivers/dpl/SwiP.h>
#include <ti/drivers/dpl/SemaphoreP.h>
Go to the source code of this file.
Data Structures | |
struct | ECJPAKECC26X2_HWAttrs_ |
ECJPAKECC26X2 Hardware Attributes. More... | |
struct | ECJPAKECC26X2_Object_ |
ECJPAKECC26X2 Object. More... | |
Macros | |
#define | ECJPAKECC26X2_STATUS_FSM_RUN_PKA_OP ECJPAKE_STATUS_RESERVED - 0 |
#define | ECJPAKECC26X2_STATUS_FSM_RUN_FSM ECJPAKE_STATUS_RESERVED - 1 |
Typedefs | |
typedef enum ECJPAKECC26X2_FsmState_ | ECJPAKECC26X2_FsmState |
ECJPAKECC26X2 states. More... | |
typedef struct ECJPAKECC26X2_HWAttrs_ | ECJPAKECC26X2_HWAttrs |
ECJPAKECC26X2 Hardware Attributes. More... | |
typedef struct ECJPAKECC26X2_Object_ | ECJPAKECC26X2_Object |
ECJPAKECC26X2 Object. More... | |
#define ECJPAKECC26X2_STATUS_FSM_RUN_PKA_OP ECJPAKE_STATUS_RESERVED - 0 |
#define ECJPAKECC26X2_STATUS_FSM_RUN_FSM ECJPAKE_STATUS_RESERVED - 1 |
typedef enum ECJPAKECC26X2_FsmState_ ECJPAKECC26X2_FsmState |
ECJPAKECC26X2 states.
The EC-JPAKE operations are implemented using multiple invidividual PKA operations. Since state transitions for these operations are almost always predictable, the state transitions are encoded linearly in this enum. The FSM controller will increment the state counter and iterate through states until it is told to stop or restart.
typedef struct ECJPAKECC26X2_HWAttrs_ ECJPAKECC26X2_HWAttrs |
ECJPAKECC26X2 Hardware Attributes.
ECJPAKECC26X2 hardware attributes should be included in the board file and pointed to by the ECJPAKE_config struct.
typedef struct ECJPAKECC26X2_Object_ ECJPAKECC26X2_Object |
ECJPAKECC26X2 Object.
The application must not access any member variables of this structure!
ECJPAKECC26X2 states.
The EC-JPAKE operations are implemented using multiple invidividual PKA operations. Since state transitions for these operations are almost always predictable, the state transitions are encoded linearly in this enum. The FSM controller will increment the state counter and iterate through states until it is told to stop or restart.