ECDSALPF3HSM.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024, 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  */
59 #ifndef ti_drivers_ecdsa_ECDSALPF3HSM__include
60 #define ti_drivers_ecdsa_ECDSALPF3HSM__include
61 
62 #include <stdint.h>
63 #include <stdbool.h>
64 
65 #include <ti/drivers/ECDSA.h>
66 
67 #include <third_party/ecc/include/lowlevelapi.h>
68 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
73 /* Defines */
74 /* The largest signature will be for NIST521 which will produce 72B per component (S and R) */
75 #define ECDSA_COMPONENT_VECTOR_LENGTH 144
76 
83 typedef struct
84 {
85  uint8_t dummy;
87 
91 typedef enum
92 {
96 
102 typedef struct
103 {
105  bool isOpen;
106  ECDSA_ReturnBehavior returnBehavior; /* Callback mode is not supported */
107  int_fast16_t returnStatus;
115  int_fast16_t hsmStatus;
116  uint32_t keyAssetID;
117  uint32_t paramAssetID;
118  const uint8_t *curveParam;
119  uint32_t curveParamSize;
120  uint8_t *input;
121  uint8_t signature[ECDSA_COMPONENT_VECTOR_LENGTH];
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif /* ti_drivers_ecdsa_ECDSALPF3HSM__include */
TI Driver for Elliptic Curve Digital Signature Algorithm.
ECDSA_CurveType
Enum for the curve types supported by the driver.
Definition: ECDSA.h:649
ECDSA_ReturnBehavior
The way in which ECDSA function calls return after performing an encryption + authentication or decry...
Definition: ECDSA.h:627
const uint8_t * curveParam
Definition: ECDSALPF3HSM.h:118
uint32_t paramAssetID
Definition: ECDSALPF3HSM.h:117
ECDSA_ReturnBehavior returnBehavior
Definition: ECDSALPF3HSM.h:106
Definition: ECDSALPF3HSM.h:94
ECDSALPF3HSM Object.
Definition: ECDSALPF3HSM.h:102
CryptoKey * key
Definition: ECDSALPF3HSM.h:104
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:782
ECDSA_CallbackFxn callbackFxn
Definition: ECDSALPF3HSM.h:114
Definition: ECDSALPF3HSM.h:93
CryptoKey datastructure.
Definition: CryptoKey.h:208
ECDSA_DigestLength
Enum for the hash digest lengths in bits supported by the driver.
Definition: ECDSA.h:676
ECDSA_DomainID domainId
Definition: ECDSALPF3HSM.h:109
ECDSA_DomainID
Enum for the curve domain id supported by the driver.
Definition: ECDSALPF3HSM.h:91
uint32_t curveParamSize
Definition: ECDSALPF3HSM.h:119
uint32_t keyAssetID
Definition: ECDSALPF3HSM.h:116
uint8_t dummy
Definition: ECDSALPF3HSM.h:85
ECDSA_Operation * operation
Definition: ECDSALPF3HSM.h:113
#define ECDSA_COMPONENT_VECTOR_LENGTH
Definition: ECDSALPF3HSM.h:75
ECDSA_CurveLength
Enum for signature sizes in bits supported by the driver.
Definition: ECDSA.h:663
int_fast16_t hsmStatus
Definition: ECDSALPF3HSM.h:115
ECDSALPF3HSM Hardware Attributes.
Definition: ECDSALPF3HSM.h:83
ECDSA_OperationType
Enum for the operation types supported by the driver.
Definition: ECDSA.h:757
Union containing pointers to all supported operation structs.
Definition: ECDSA.h:748
ECDSA_CurveLength curveLength
Definition: ECDSALPF3HSM.h:110
int_fast16_t returnStatus
Definition: ECDSALPF3HSM.h:107
ECDSA_DigestLength digestLength
Definition: ECDSALPF3HSM.h:111
uint8_t * input
Definition: ECDSALPF3HSM.h:120
ECDSA_OperationType operationType
Definition: ECDSALPF3HSM.h:112
ECDSA_CurveType curveType
Definition: ECDSALPF3HSM.h:108
bool isOpen
Definition: ECDSALPF3HSM.h:105
© Copyright 1995-2024, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale