1
1
/*
2
- * Copyright (c) 2021, The OpenThread Authors.
3
- * All rights reserved.
4
2
*
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions are met:
7
- * 1. Redistributions of source code must retain the above copyright
8
- * notice, this list of conditions and the following disclaimer.
9
- * 2. Redistributions in binary form must reproduce the above copyright
10
- * notice, this list of conditions and the following disclaimer in the
11
- * documentation and/or other materials provided with the distribution.
12
- * 3. Neither the name of the copyright holder nor the
13
- * names of its contributors may be used to endorse or promote products
14
- * derived from this software without specific prior written permission.
3
+ * Copyright (c) 2024 Project CHIP Authors
4
+ * All rights reserved.
15
5
*
16
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26
- * POSSIBILITY OF SUCH DAMAGE .
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License .
27
17
*/
28
18
29
19
#pragma once
30
20
31
- #include <limits.h>
32
- #include <stdio.h>
33
- #include <stdlib.h>
34
- /**
35
- * Enable FreeRTOS threading support
36
- */
37
- #define MBEDTLS_FREERTOS
21
+ #define MBEDTLS_PLATFORM_C
22
+ #define MBEDTLS_PLATFORM_MEMORY
23
+ #define MBEDTLS_VERSION_C
24
+ #define MBEDTLS_VERSION_FEATURES
38
25
39
- /**
40
- * Enable H Crypto and Entropy modules
41
- */
42
- #define MBEDTLS_AES_C
43
- #define MBEDTLS_ECP_C
44
- #define MBEDTLS_ECDH_C
45
- #define MBEDTLS_ENTROPY_C
46
- #define MBEDTLS_SHA256_C
47
- #define MBEDTLS_CIPHER_MODE_CTR
48
- #define MBEDTLS_TRNG_C
26
+ #define MBEDTLS_HKDF_C
27
+ #define MBEDTLS_PKCS5_C
49
28
50
- #define MBEDTLS_NO_PLATFORM_ENTROPY
51
- #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
29
+ // DIC Specific Configurations
30
+ #ifdef DIC_ENABLE
52
31
53
- #if defined(MBEDTLS_ECP_ALT ) && !defined(MBEDTLS_ECP_RESTARTABLE )
54
- typedef void mbedtls_ecp_restart_ctx ;
55
- #endif
32
+ #define MBEDTLS_MPI_MAX_SIZE 512
56
33
57
- #ifdef DIC_ENABLE
58
- #define MBEDTLS_PKCS1_V15
59
- #define MBEDTLS_RSA_NO_CRT
60
34
#define MBEDTLS_CIPHER_MODE_CBC
35
+ #define MBEDTLS_CIPHER_MODE_WITH_PADDING
61
36
#define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
37
+ #define MBEDTLS_PKCS1_V15
62
38
#define MBEDTLS_RSA_C
39
+ #define MBEDTLS_RSA_NO_CRT
63
40
#define MBEDTLS_SHA1_C
64
41
#define MBEDTLS_SSL_IN_CONTENT_LEN 5120
42
+ #define MBEDTLS_SSL_MAX_CONTENT_LEN 5120
65
43
#define MBEDTLS_SSL_OUT_CONTENT_LEN 1560
66
- #define MBEDTLS_DEBUG_C
67
- #define MBEDTLS_CIPHER_MODE_WITH_PADDING
68
- #endif
44
+
45
+ #endif // DIC_ENABLE
46
+
47
+ #ifdef SL_MBEDTLS_USE_TINYCRYPT
48
+ #define TINYCRYPT_PRIMITIVES
49
+ #define OPTIMIZE_TINYCRYPT_ASM
50
+
51
+ #define MBEDTLS_FREERTOS
52
+
53
+ #if (!(DIC_ENABLE ) || !defined(DIC_ENABLE ))
54
+ /**< Maximum windows size used. */
55
+ #define MBEDTLS_MPI_WINDOW_SIZE 1
56
+
57
+ /**< Maximum number of bytes for usable MPIs. */
58
+ #define MBEDTLS_MPI_MAX_SIZE 32
59
+ /**< Maxium fragment length in bytes */
60
+ #define MBEDTLS_SSL_MAX_CONTENT_LEN 768
61
+ #endif // !(DIC_ENABLE)
62
+
63
+ #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
69
64
#define MBEDTLS_PLATFORM_SNPRINTF_MACRO snprintf
70
65
71
66
#define MBEDTLS_AES_ROM_TABLES
72
- #define MBEDTLS_ASN1_PARSE_C
73
- #define MBEDTLS_ASN1_WRITE_C
74
- #define MBEDTLS_BASE64_C
75
- #define MBEDTLS_BIGNUM_C
76
67
#define MBEDTLS_CCM_C
77
- #define MBEDTLS_CIPHER_C
78
68
#define MBEDTLS_CIPHER_MODE_CBC
79
69
#define MBEDTLS_CIPHER_MODE_CFB
80
- #define MBEDTLS_CMAC_C
81
- #define MBEDTLS_CTR_DRBG_C
70
+ #define MBEDTLS_CIPHER_MODE_CTR
71
+ #define MBEDTLS_ECDH_C
82
72
#define MBEDTLS_ECDH_LEGACY_CONTEXT
83
- #define MBEDTLS_ECDSA_C
84
73
#define MBEDTLS_ECDSA_DETERMINISTIC
85
74
#define MBEDTLS_ECJPAKE_C
86
- #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
75
+ #define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
87
76
#define MBEDTLS_ECP_NIST_OPTIM
88
- #define MBEDTLS_ENTROPY_FORCE_SHA256
89
- // TODO: 3R
77
+ #define MBEDTLS_ECP_WINDOW_SIZE 2
90
78
// #define MBEDTLS_ENTROPY_HARDWARE_ALT
91
-
92
79
#define MBEDTLS_ERROR_STRERROR_DUMMY
93
80
#define MBEDTLS_HAVE_ASM
94
- #define MBEDTLS_HKDF_C
95
81
#define MBEDTLS_HMAC_DRBG_C
96
82
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
97
83
#define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
98
84
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
99
- #define MBEDTLS_MD_C
100
- #define MBEDTLS_OID_C
101
- #define MBEDTLS_PEM_PARSE_C
102
- #define MBEDTLS_PEM_WRITE_C
103
- #define MBEDTLS_PK_C
104
- #define MBEDTLS_PK_PARSE_C
105
- #define MBEDTLS_PK_WRITE_C
106
- #define MBEDTLS_PKCS5_C
107
- #define MBEDTLS_PLATFORM_C
108
- #define MBEDTLS_PLATFORM_MEMORY
109
85
#define MBEDTLS_SHA256_SMALLER
110
86
#define MBEDTLS_SHA512_C
111
87
#define MBEDTLS_SSL_CLI_C
@@ -115,38 +91,21 @@ typedef void mbedtls_ecp_restart_ctx;
115
91
#define MBEDTLS_SSL_EXPORT_KEYS
116
92
#define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
117
93
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
118
- #define MBEDTLS_SSL_PROTO_TLS1_2
119
94
#define MBEDTLS_SSL_PROTO_DTLS
95
+ #define MBEDTLS_SSL_PROTO_TLS1_2
120
96
#define MBEDTLS_SSL_SRV_C
121
97
#define MBEDTLS_SSL_TLS_C
122
- #define MBEDTLS_X509_CREATE_C
123
- #define MBEDTLS_X509_CSR_WRITE_C
124
- #define MBEDTLS_X509_CRL_PARSE_C
125
- #define MBEDTLS_X509_CRT_PARSE_C
126
- #define MBEDTLS_X509_CSR_PARSE_C
127
- #define MBEDTLS_X509_USE_C
128
-
129
- #define MBEDTLS_MPI_WINDOW_SIZE 1 /**< Maximum windows size used. */
130
- #ifdef DIC_ENABLE
131
- #define MBEDTLS_MPI_MAX_SIZE 512 /**< Maximum number of bytes for usable MPIs. */
132
- #else
133
- #define MBEDTLS_MPI_MAX_SIZE 32 /**< Maximum number of bytes for usable MPIs. */
134
- #endif
135
- #define MBEDTLS_ECP_MAX_BITS 256 /**< Maximum bit size of groups */
136
- #define MBEDTLS_ECP_WINDOW_SIZE 2 /**< Maximum window size used */
137
- #define MBEDTLS_ECP_FIXED_POINT_OPTIM 0 /**< Enable fixed-point speed-up */
138
- #define MBEDTLS_ENTROPY_MAX_SOURCES 2 /**< Maximum number of sources supported */
139
-
140
- #if OPENTHREAD_CONFIG_COAP_SECURE_API_ENABLE
141
- #define MBEDTLS_SSL_MAX_CONTENT_LEN 900 /**< Maxium fragment length in bytes */
142
- #else
143
- #ifdef DIC_ENABLE
144
- #define MBEDTLS_SSL_MAX_CONTENT_LEN 5120 /**< Maxium fragment length in bytes */
145
- #else
146
- #define MBEDTLS_SSL_MAX_CONTENT_LEN 768 /**< Maxium fragment length in bytes */
147
- #endif // DIC
98
+ #define MBEDTLS_TRNG_C
99
+
100
+ #if defined(MBEDTLS_ECP_ALT ) && !defined(MBEDTLS_ECP_RESTARTABLE )
101
+ typedef void mbedtls_ecp_restart_ctx ;
148
102
#endif
149
103
150
- #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
104
+ #endif // SL_MBEDTLS_USE_TINYCRYPT
105
+
106
+ // SLC GENERATED
107
+ #include "sl_mbedtls_config.h"
151
108
109
+ #if SL_MBEDTLS_USE_TINYCRYPT
152
110
#include "mbedtls/check_config.h"
111
+ #endif // SL_MBEDTLS_USE_TINYCRYPT
0 commit comments