ECDSACC26X2.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
66 #ifndef ti_drivers_ecdsa_ECDSACC26X2__include
67 #define ti_drivers_ecdsa_ECDSACC26X2__include
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 #include <stdint.h>
74 #include <stdbool.h>
75 
76 #include <ti/drivers/Power.h>
77 #include <ti/drivers/ECDSA.h>
80 
81 #include <ti/drivers/dpl/HwiP.h>
82 #include <ti/drivers/dpl/SwiP.h>
83 #include <ti/drivers/dpl/SemaphoreP.h>
84 
85 /* Exit the SWI and wait until an HWI call posts the SWI again */
86 #define ECDSACC26X2_STATUS_FSM_RUN_PKA_OP ECDSA_STATUS_RESERVED - 0
87 /* Execute the next FSM state immediately without waiting for the next HWI */
88 #define ECDSACC26X2_STATUS_FSM_RUN_FSM ECDSA_STATUS_RESERVED - 1
89 /* Restart the FSM and begin executing from the initial state */
90 #define ECDSACC26X2_STATUS_FSM_RESTART_FSM ECDSA_STATUS_RESERVED - 2
91 
101 typedef enum ECDSACC26X2_FsmState_ {
103 
121 
142 
144 
153 typedef int_fast16_t (*ECDSACC26X2_stateMachineFxn) (ECDSA_Handle handle);
154 
161 typedef struct ECDSACC26X2_HWAttrs_ {
174  uint8_t intPriority;
180  uint32_t swiPriority;
182 
188 typedef struct ECDSACC26X2_Object_ {
189  bool isOpen;
190  int_fast16_t returnValue;
196  ECDSACC26X2_FsmState fsmState;
197  ECDSACC26X2_FsmState fsmStateInitial;
199  uint32_t resultAddress;
200  uint32_t *scratchNumber1;
201  uint32_t *scratchNumber2;
202  SwiP_Struct callbackSwi;
204 
205 #ifdef __cplusplus
206 }
207 #endif
208 
209 #endif /* ti_drivers_ecdsa_ECDSACC26X2__include */
TI Driver for Elliptic Curve Digital Signature Algorithm.
enum ECDSA_ReturnBehavior_ ECDSA_ReturnBehavior
The way in which ECDSA function calls return after performing an encryption + authentication or decry...
ECDSA_CallbackFxn callbackFxn
Definition: ECDSACC26X2.h:193
The CryptoKey type is an opaque representation of a cryptographic key.
struct ECDSACC26X2_HWAttrs_ ECDSACC26X2_HWAttrs
ECDSACC26X2 Hardware Attributes.
Definition: ECDSACC26X2.h:108
ECDSA_Operation operation
Definition: ECDSACC26X2.h:191
Definition: ECDSACC26X2.h:111
Definition: ECDSACC26X2.h:141
Union containing pointers to all supported operation structs.
Definition: ECDSA.h:600
Definition: ECDSACC26X2.h:139
ECDSA_ReturnBehavior returnBehavior
Definition: ECDSACC26X2.h:195
uint32_t resultAddress
Definition: ECDSACC26X2.h:199
uint32_t semaphoreTimeout
Definition: ECDSACC26X2.h:198
void(* ECDSA_CallbackFxn)(ECDSA_Handle handle, int_fast16_t returnStatus, ECDSA_Operation operation, ECDSA_OperationType operationType)
The definition of a callback function used by the ECDSA driver when used in ECDSA_RETURN_BEHAVIOR_CAL...
Definition: ECDSA.h:631
ECDSACC26X2_FsmState fsmStateInitial
Definition: ECDSACC26X2.h:197
uint32_t * scratchNumber1
Definition: ECDSACC26X2.h:200
ECDSA_OperationType operationType
Definition: ECDSACC26X2.h:192
struct ECDSACC26X2_Object_ ECDSACC26X2_Object
ECDSACC26X2 Object.
Power manager interface.
ECDSACC26X2_FsmState fsmState
Definition: ECDSACC26X2.h:196
Definition: ECDSACC26X2.h:115
Definition: ECDSACC26X2.h:102
Definition: ECDSACC26X2.h:133
Definition: ECDSACC26X2.h:107
Definition: ECDSACC26X2.h:124
Definition: ECDSACC26X2.h:122
Definition: ECDSACC26X2.h:117
Definition: ECDSACC26X2.h:110
Definition: ECDSACC26X2.h:131
Definition: ECDSACC26X2.h:105
Definition: ECDSACC26X2.h:119
Definition: ECDSACC26X2.h:109
uint8_t intPriority
Crypto Peripheral&#39;s interrupt priority.
Definition: ECDSACC26X2.h:174
Definition: ECDSACC26X2.h:123
Definition: ECDSACC26X2.h:140
int_fast16_t(* ECDSACC26X2_stateMachineFxn)(ECDSA_Handle handle)
ECDSACC26X2 state machine function prototype.
Definition: ECDSACC26X2.h:153
ECDSA Global configuration.
Definition: ECDSA.h:539
enum ECDSACC26X2_FsmState_ ECDSACC26X2_FsmState
ECDSACC26X2 Sign and Verify states.
Definition: ECDSACC26X2.h:104
Definition: ECDSACC26X2.h:136
ECDSACC26X2_stateMachineFxn fsmFxn
Definition: ECDSACC26X2.h:194
bool isOpen
Definition: ECDSACC26X2.h:189
uint32_t * scratchNumber2
Definition: ECDSACC26X2.h:201
Definition: ECDSACC26X2.h:130
SwiP_Struct callbackSwi
Definition: ECDSACC26X2.h:202
ECDSACC26X2_FsmState_
ECDSACC26X2 Sign and Verify states.
Definition: ECDSACC26X2.h:101
Definition: ECDSACC26X2.h:132
Definition: ECDSACC26X2.h:125
Definition: ECDSACC26X2.h:135
Definition: ECDSACC26X2.h:137
ECDSACC26X2 Hardware Attributes.
Definition: ECDSACC26X2.h:161
Definition: ECDSACC26X2.h:129
Definition: ECDSACC26X2.h:116
ECDSACC26X2 Object.
Definition: ECDSACC26X2.h:188
int_fast16_t returnValue
Definition: ECDSACC26X2.h:190
uint32_t swiPriority
ECC SWI priority. The higher the number, the higher the priority. The minimum is 0 and the maximum is...
Definition: ECDSACC26X2.h:180
Definition: ECDSACC26X2.h:106
Definition: ECDSACC26X2.h:120
enum ECDSA_OperationType_ ECDSA_OperationType
Enum for the operation types supported by the driver.
Copyright 2017, Texas Instruments Incorporated