ECDSACC26X4_s.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022-2023, Texas Instruments Incorporated - https://www.ti.com
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_ecdsa_ECDSACC26X4_s__include
34 #define ti_drivers_ecdsa_ECDSACC26X4_s__include
35 
36 #include <stdint.h>
37 
39 #include <ti/drivers/ECDSA.h>
40 
42 
43 #include <third_party/tfm/interface/include/psa/error.h>
44 #include <third_party/tfm/interface/include/psa/service.h>
45 
46 #if defined(TFM_BUILD)
47  #include "ti_drivers_config.h" /* Sysconfig generated header */
48 #endif
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /*
55  * ECDSA secure message types
56  * These secure message structs correspond to the secure message types defined
57  * above. Together, they are used by non-secure client to make PSA calls to the
58  * ECDSA secure service. There is a single input vector for the PSA call
59  * which is a pointer to secure message struct. If the underlying function
60  * has a return value, there is a single output vector which is a pointer to
61  * storage for the return value.
62  */
63 #define ECDSA_S_MSG_TYPE_CONSTRUCT ECDSA_S_MSG_TYPE(0U)
64 #define ECDSA_S_MSG_TYPE_OPEN ECDSA_S_MSG_TYPE(1U)
65 #define ECDSA_S_MSG_TYPE_REGISTER_CALLBACK ECDSA_S_MSG_TYPE(2U)
66 #define ECDSA_S_MSG_TYPE_CLOSE ECDSA_S_MSG_TYPE(3U)
67 #define ECDSA_S_MSG_TYPE_SIGN ECDSA_S_MSG_TYPE(4U)
68 #define ECDSA_S_MSG_TYPE_VERIFY ECDSA_S_MSG_TYPE(5U)
69 #define ECDSA_S_MSG_TYPE_CANCEL_OPERATION ECDSA_S_MSG_TYPE(6U)
70 
71 /*
72  * Config pool size determines how many dynamic driver instances can be created
73  * by the non-secure client using ECDSA_construct().
74  */
75 #ifndef CONFIG_ECDSA_S_CONFIG_POOL_SIZE
76  #define CONFIG_ECDSA_S_CONFIG_POOL_SIZE 1
77 #endif
78 
79 #define ECDSA_SECURE_CALLBACK_COUNT (CONFIG_TI_DRIVERS_ECDSA_COUNT + CONFIG_ECDSA_S_CONFIG_POOL_SIZE)
80 
81 /*
82  * ========= ECDSA Secure Callback struct =========
83  * Non-secure clients must register their callback after opening or
84  * constructing a driver instance with blocking or callback return behavior.
85  */
86 typedef struct
87 {
89  /* ECDSA callback fxn parameters */
91  int_fast16_t returnStatus;
95 
96 /*
97  * ========= ECDSA Secure Message Structs =========
98  * These secure message structs correspond to the secure message types defined
99  * above. Together, they are used by non-secure client to make PSA calls to the
100  * ECDSA secure service. There is a single input vector for the PSA call
101  * which is a pointer to secure message struct. If the underlying function
102  * has a return value, there is a single output vector which is a pointer to
103  * storage for the return value.
104  */
105 typedef struct
106 {
110 
111 typedef struct
112 {
113  uint_least8_t index;
116 
117 typedef struct
118 {
122 
123 typedef struct
124 {
127 
128 typedef struct
129 {
133 
134 typedef struct
135 {
139 
140 typedef struct
141 {
144 
155 psa_status_t ECDSA_s_handlePsaMsg(psa_msg_t *msg);
156 
162 void ECDSA_s_init(void);
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif /* ti_drivers_ecdsa_ECDSACC26X4_s__include */
TI Driver for Elliptic Curve Digital Signature Algorithm.
Definition: ECDSACC26X4_s.h:123
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:119
Definition: SecureCallback.h:51
ECDSA_Operation operation
Definition: ECDSACC26X4_s.h:92
Definition: ECDSACC26X4_s.h:134
Definition: ECDSACC26X4_s.h:128
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:130
ECDSA_OperationSign * operation
Definition: ECDSACC26X4_s.h:131
ECDSA_s_SecureCallback * callback
Definition: ECDSACC26X4_s.h:120
Definition: ECDSACC26X4_s.h:86
void ECDSA_s_init(void)
Initializes the ECDSA secure driver.
ECDSA Global configuration.
Definition: ECDSA.h:469
const ECDSA_Params * params
Definition: ECDSACC26X4_s.h:108
Definition: ECDSACC26X4_s.h:111
ECDSA_Config * config
Definition: ECDSACC26X4_s.h:107
Secure Crypto Service.
Definition: ECDSACC26X4_s.h:105
Struct containing the parameters required for signing a message.
Definition: ECDSA.h:526
ECDSA_OperationVerify * operation
Definition: ECDSACC26X4_s.h:137
uint_least8_t index
Definition: ECDSACC26X4_s.h:113
ECDSA Parameters.
Definition: ECDSA.h:626
SecureCallback_Object object
Definition: ECDSACC26X4_s.h:88
ECDSA_OperationType
Enum for the operation types supported by the driver.
Definition: ECDSA.h:588
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:90
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:142
Definition: ECDSACC26X4_s.h:117
Union containing pointers to all supported operation structs.
Definition: ECDSA.h:579
int_fast16_t returnStatus
Definition: ECDSACC26X4_s.h:91
psa_status_t ECDSA_s_handlePsaMsg(psa_msg_t *msg)
Handles PSA messages for ECDSA secure driver.
Struct containing the parameters required for verifying a message.
Definition: ECDSA.h:552
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:125
ECDSA_OperationType operationType
Definition: ECDSACC26X4_s.h:93
Definition: ECDSACC26X4_s.h:140
const ECDSA_Params * params
Definition: ECDSACC26X4_s.h:114
ECDSA_Handle handle
Definition: ECDSACC26X4_s.h:136
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale