ECDHLPF3HSM.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  */
32 
33 #ifndef ti_drivers_ecdh_ECDHLPF3HSM__include
34 #define ti_drivers_ecdh_ECDHLPF3HSM__include
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include <ti/drivers/ECDH.h>
39 
40 #include <third_party/hsmddk/include/Kit/EIP130/DomainHelper/incl/eip130_domain_ecc_curves.h>
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /* Defines */
47 /* The largest signature will be for NIST521 which will produce 72B per component (S and R) */
48 #define ECDH_COMPONENT_VECTOR_LENGTH 144
49 
53 #define ECDHLPF3HSM_STATUS_HARDWARE_ERROR (ECDH_STATUS_RESERVED - 0)
54 
58 #define ECDHLPF3HSM_STATUS_NO_VALID_CURVE_TYPE_PROVIDED (ECDH_STATUS_RESERVED - 1)
59 
63 #define ECDHLPF3HSM_STATUS_INVALID_PRIVATE_KEY_ENCODING (ECDH_STATUS_RESERVED - 2)
64 
68 #define ECDHLPF3HSM_STATUS_INVALID_PUBLIC_KEY_ENCODING (ECDH_STATUS_RESERVED - 3)
69 
73 #define ECDHLPF3HSM_STATUS_INVALID_SHARED_SECRET_KEY_ENCODING (ECDH_STATUS_RESERVED - 4)
74 
78 #define ECDHLPF3HSM_STATUS_INVALID_PRIVATE_KEY_SIZE (ECDH_STATUS_RESERVED - 5)
79 
83 #define ECDHLPF3HSM_STATUS_INVALID_PUBLIC_KEY_SIZE (ECDH_STATUS_RESERVED - 6)
84 
88 #define ECDHLPF3HSM_STATUS_INVALID_SHARED_SECRET_KEY_SIZE (ECDH_STATUS_RESERVED - 7)
89 
93 #define ECDHLPF3HSM_STATUS_INVALID_ECC_KEYS (ECDH_STATUS_RESERVED - 8)
94 
98 #define ECDHLPF3HSM_STATUS_INVALID_PUBLIC_KEY_OCTET_VALUE (ECDH_STATUS_RESERVED - 9)
99 
106 typedef struct
107 {
108  uint8_t reserved1;
110 
114 typedef enum
115 {
118 } ECDH_DomainID;
119 
125 typedef struct
126 {
133  Eip130Domain_ECCurveFamily_t curveFamily;
139  uint32_t accessTimeout;
140  int_fast16_t returnStatus;
141  int_fast16_t hsmStatus;
145  uint32_t paramAssetID;
146  const uint8_t *curveParam;
147  uint32_t curveParamSize;
150  bool isOpen;
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif /* ti_drivers_ecdh_ECDHLPF3HSM__include */
ECDH_OperationType
Enum for the operation types supported by the driver.
Definition: ECDH.h:693
Definition: ECDHLPF3HSM.h:116
CryptoKey * publicKey
Definition: ECDHLPF3HSM.h:128
ECDH_CurveType
Enum for the curve types supported by the driver.
Definition: ECDH.h:602
uint32_t curveParamSize
Definition: ECDHLPF3HSM.h:147
ECDH_CurveType curveType
Definition: ECDHLPF3HSM.h:130
const CryptoKey * privateKey
Definition: ECDHLPF3HSM.h:127
ECDH_KeyMaterialEndianness keyMaterialEndianness
Definition: ECDHLPF3HSM.h:138
ECDH_Operation * operation
Definition: ECDHLPF3HSM.h:135
ECDHLPF3HSM Object.
Definition: ECDHLPF3HSM.h:125
Definition: ECDHLPF3HSM.h:117
CryptoKey datastructure.
Definition: CryptoKey.h:211
Eip130Domain_ECCurveFamily_t curveFamily
Definition: ECDHLPF3HSM.h:133
CryptoKey * sharedSecret
Definition: ECDHLPF3HSM.h:129
void(* ECDH_CallbackFxn)(ECDH_Handle handle, int_fast16_t returnStatus, ECDH_Operation operation, ECDH_OperationType operationType)
The definition of a callback function used by the ECDH driver when used in ECDH_RETURN_BEHAVIOR_CALLB...
Definition: ECDH.h:717
bool driverCreatedKeyAsset
Definition: ECDHLPF3HSM.h:149
ECDH_CallbackFxn callbackFxn
Definition: ECDHLPF3HSM.h:134
ECDH_CurveLength curveLength
Definition: ECDHLPF3HSM.h:131
int_fast16_t hsmStatus
Definition: ECDHLPF3HSM.h:141
ECDH_KeyMaterialEndianness
Definition: ECDH.h:588
TI Driver for Elliptic Curve Diffie-Hellman key agreement scheme.
uint32_t accessTimeout
Definition: ECDHLPF3HSM.h:139
int_fast16_t returnStatus
Definition: ECDHLPF3HSM.h:140
uint32_t publicDataAssetID
Definition: ECDHLPF3HSM.h:144
#define ECDH_COMPONENT_VECTOR_LENGTH
Definition: ECDHLPF3HSM.h:48
uint32_t privateKeyAssetID
Definition: ECDHLPF3HSM.h:142
ECDH_OperationType operationType
Definition: ECDHLPF3HSM.h:136
ECDH_ReturnBehavior
The way in which ECDH function calls return after performing a public key generation or shared secret...
Definition: ECDH.h:570
uint32_t publicKeyAssetID
Definition: ECDHLPF3HSM.h:143
ECDH_DomainID
Enum for the curve domain id supported by the driver.
Definition: ECDHLPF3HSM.h:114
ECDH_CurveLength
Enum for signature sizes in bits supported by the driver.
Definition: ECDH.h:617
uint32_t paramAssetID
Definition: ECDHLPF3HSM.h:145
ECDH_ReturnBehavior returnBehavior
Definition: ECDHLPF3HSM.h:137
uint8_t reserved1
Definition: ECDHLPF3HSM.h:108
bool isOpen
Definition: ECDHLPF3HSM.h:150
Hardware-specific configuration attributes.
Definition: ECDHLPF3HSM.h:106
ECDH_DomainID domainId
Definition: ECDHLPF3HSM.h:132
const uint8_t * curveParam
Definition: ECDHLPF3HSM.h:146
Union containing pointers to all supported operation structs.
Definition: ECDH.h:682
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale