File tree Expand file tree Collapse file tree 4 files changed +66
-0
lines changed
connectivity/mbedtls/platform/inc
platform/FEATURE_EXPERIMENTAL_API/FEATURE_PSA Expand file tree Collapse file tree 4 files changed +66
-0
lines changed Original file line number Diff line number Diff line change 50
50
51
51
#define MBEDTLS_ENTROPY_HARDWARE_ALT
52
52
53
+ #define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
54
+
53
55
#endif // defined(FEATURE_EXPERIMENTAL_API) && defined(FEATURE_PSA)
54
56
55
57
#if DEVICE_TRNG
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ target_include_directories(mbed-psa
17
17
18
18
target_sources (mbed-psa
19
19
INTERFACE
20
+ src/mbedtls_crypto_setup.c
20
21
src/psa_hrng.c
21
22
)
22
23
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2021 Arm Limited
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ *
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.
17
+ */
18
+
19
+ #ifndef __CRYPTO_PLATFORM_H_
20
+ #define __CRYPTO_PLATFORM_H_
21
+
22
+ // Unused platform-defined crypto context
23
+ // required by mbedtls_platform_context
24
+ typedef struct {
25
+ char unused ;
26
+ } crypto_platform_ctx ;
27
+
28
+ #endif // __CRYPTO_PLATFORM_H_
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2021 Arm Limited
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ *
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.
17
+ */
18
+
19
+ #include "crypto_device_platform.h"
20
+ #include "psa/crypto.h"
21
+
22
+ // Required by mbedtls_platform_setup()
23
+
24
+ int crypto_platform_setup (crypto_platform_ctx * unused )
25
+ {
26
+ psa_status_t status = psa_crypto_init ();
27
+ return (int ) status ;
28
+ }
29
+
30
+ void crypto_platform_terminate (crypto_platform_ctx * unused )
31
+ {
32
+ // The PSA Crypto API does not provide a deinit function.
33
+ // By specification, psa_crypto_init() can be called any
34
+ // number of times.
35
+ }
You can’t perform that action at this time.
0 commit comments