CryptoCC26X4_s.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 Texas Instruments Incorporated - http://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  * @file CryptoCC26X4_s.h
34  * @brief Secure Crypto Service
35  *
36  * @anchor ti_drivers_crypto_CryptoCC26X4_s_Overview
37  * # Overview
38  * The Secure Crypto Service is used to access all cryptographic functions
39  * when using the Secure Processing Environment (SPE).
40  *
41  *******************************************************************************
42  */
43 #ifndef ti_drivers_crypto_CryptoCC26X4_s__include
44 #define ti_drivers_crypto_CryptoCC26X4_s__include
45 
46 #include <stdint.h>
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /* Index values for secure msg types for various crypto drivers */
53 #define CRYPTO_S_MSG_TYPE_INDEX_AESCBC ((int32_t)0x11)
54 #define CRYPTO_S_MSG_TYPE_INDEX_AESCCM ((int32_t)0x22)
55 #define CRYPTO_S_MSG_TYPE_INDEX_AESCMAC ((int32_t)0x33)
56 #define CRYPTO_S_MSG_TYPE_INDEX_AESCTR ((int32_t)0x44)
57 #define CRYPTO_S_MSG_TYPE_INDEX_AESECB ((int32_t)0x55)
58 #define CRYPTO_S_MSG_TYPE_INDEX_AESGCM ((int32_t)0x66)
59 #define CRYPTO_S_MSG_TYPE_INDEX_AESCTRDRBG ((int32_t)0x77)
60 #define CRYPTO_S_MSG_TYPE_INDEX_ECDH ((int32_t)0x88)
61 #define CRYPTO_S_MSG_TYPE_INDEX_ECDSA ((int32_t)0x99)
62 #define CRYPTO_S_MSG_TYPE_INDEX_ECJPAKE ((int32_t)0xAA)
63 #define CRYPTO_S_MSG_TYPE_INDEX_EDDSA ((int32_t)0xBB)
64 #define CRYPTO_S_MSG_TYPE_INDEX_SHA2 ((int32_t)0xCC)
65 #define CRYPTO_S_MSG_TYPE_INDEX_TRNG ((int32_t)0xDD)
66 #define CRYPTO_S_MSG_TYPE_INDEX_KEYSTORE ((int32_t)0xEE)
67 
68 #define CRYPTO_S_MSG_TYPE_SHIFT 8U
69 #define CRYPTO_S_MSG_TYPE_INDEX_MASK 0xFF
70 #define GET_CRYPTO_S_MSG_TYPE_INDEX(type) ((type) & (int32_t)CRYPTO_S_MSG_TYPE_INDEX_MASK)
71 
72 /*
73  * Secure handle ID values which correspond to unmapped memory ranges are used
74  * to avoid confusion with non-secure driver handles which point to valid
75  * memory locations.
76  */
77 enum
78 {
86  CRYPTO_S_HANDLE_ID_ECDH = 0xABCD8000U,
87  CRYPTO_S_HANDLE_ID_ECDSA = 0xABCD9000U,
89  CRYPTO_S_HANDLE_ID_EDDSA = 0xABCDB000U,
90  CRYPTO_S_HANDLE_ID_SHA2 = 0xABCDC000U,
91  CRYPTO_S_HANDLE_ID_TRNG = 0xABCDD000U,
92 };
93 
94 #define CRYPTO_S_HANDLE_ID_MASK 0xFFFFF000U
95 #define CRYPTO_S_HANDLE_INDEX_MASK 0x00000FFFU
96 
97 #define GET_CRYPTO_S_HANDLE_ID(handle) ((uintptr_t)(handle)&CRYPTO_S_HANDLE_ID_MASK)
98 #define GET_CRYPTO_S_HANDLE_INDEX(handle) ((uintptr_t)(handle)&CRYPTO_S_HANDLE_INDEX_MASK)
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif /* ti_drivers_crypto_CryptoCC26X4_s__include */
Definition: CryptoCC26X4_s.h:85
Definition: CryptoCC26X4_s.h:88
Definition: CryptoCC26X4_s.h:87
Definition: CryptoCC26X4_s.h:79
Definition: CryptoCC26X4_s.h:91
Definition: CryptoCC26X4_s.h:90
Definition: CryptoCC26X4_s.h:86
Definition: CryptoCC26X4_s.h:83
Definition: CryptoCC26X4_s.h:82
Definition: CryptoCC26X4_s.h:89
Definition: CryptoCC26X4_s.h:84
Definition: CryptoCC26X4_s.h:81
Definition: CryptoCC26X4_s.h:80
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale