Skip to content

Commit 3fddf15

Browse files
Merge pull request Mbed-TLS#14 from ronald-cron-arm/configs
Define typical configurations and test them
2 parents 400ea6a + 7ae8f89 commit 3fddf15

File tree

5 files changed

+443
-0
lines changed

5 files changed

+443
-0
lines changed

configs/ccm-aes-sha256-secp256r1.h

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
/**
2+
* \file psa/ccm-aes-sha256-secp256r1.h
3+
*
4+
* \brief PSA crypto configuration with symmetric cryptography and asymmetric
5+
* cryptography based on the secp256r1 elliptic curve: CCM-AES, SHA-256,
6+
* HMAC, ECDSA, ECDH and key derivation.
7+
*/
8+
/*
9+
* Copyright The Mbed TLS Contributors
10+
* SPDX-License-Identifier: Apache-2.0
11+
*
12+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
13+
* not use this file except in compliance with the License.
14+
* You may obtain a copy of the License at
15+
*
16+
* http://www.apache.org/licenses/LICENSE-2.0
17+
*
18+
* Unless required by applicable law or agreed to in writing, software
19+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
20+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
* See the License for the specific language governing permissions and
22+
* limitations under the License.
23+
*/
24+
25+
#ifndef PSA_CRYPTO_CONFIG_H
26+
#define PSA_CRYPTO_CONFIG_H
27+
28+
/**
29+
* \name SECTION: General configuration options
30+
*
31+
* \{
32+
*/
33+
34+
//#define PSA_CRYPTO_SPM
35+
//#define PSA_CRYPTO_STD_FUNCTIONS
36+
#define PSA_CRYPTO_FS_IO
37+
#define PSA_CRYPTO_MEMORY_BUFFER_ALLOC
38+
39+
/** \} name SECTION: General configuration options */
40+
41+
/**
42+
* \name SECTION: PSA cryptography interface configuration
43+
*
44+
* This section allows for configuring the PSA cryptography interface as
45+
* specified in psa-conditional-inclusion-c.md.
46+
*
47+
* \{
48+
*/
49+
50+
#define PSA_WANT_ALG_CCM 1
51+
#define PSA_WANT_ALG_DETERMINISTIC_ECDSA 1
52+
#define PSA_WANT_ALG_ECDH 1
53+
#define PSA_WANT_ALG_ECDSA 1
54+
#define PSA_WANT_ALG_HKDF 1
55+
#define PSA_WANT_ALG_HMAC 1
56+
#define PSA_WANT_ALG_SHA_256 1
57+
#define PSA_WANT_ALG_TLS12_PRF 1
58+
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
59+
#define PSA_WANT_ECC_SECP_R1_256 1
60+
#define PSA_WANT_KEY_TYPE_DERIVE 1
61+
#define PSA_WANT_KEY_TYPE_HMAC 1
62+
#define PSA_WANT_KEY_TYPE_AES 1
63+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR 1
64+
#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1
65+
#define PSA_WANT_KEY_TYPE_RAW_DATA 1
66+
67+
68+
/** \} name SECTION: PSA cryptography interface configuration */
69+
70+
/**
71+
* \name SECTION: PSA cryptography core configuration options
72+
*
73+
* This section allows for the configuration of the PSA cryptography core
74+
* which provides the key management, the generation of random numbers and
75+
* the dispatch to drivers.
76+
* \{
77+
*/
78+
79+
#define PSA_CRYPTO_KEY_ID_ENCODES_OWNER
80+
//#define PSA_CRYPTO_BUILTIN_KEYS
81+
//#define PSA_CRYPTO_EXTERNAL_RNG
82+
#define PSA_CRYPTO_STORAGE_C
83+
#define PSA_CRYPTO_ITS_FILE_C
84+
//#define PSA_CRYPTO_HMAC_DRBG_HASH PSA_ALG_SHA_256
85+
//#define PSA_CRYPTO_KEY_SLOT_COUNT 32
86+
//#define PSA_CRYPTO_PLATFORM_ENTROPY
87+
#define PSA_CRYPTO_ENTROPY_NV_SEED
88+
#define PSA_CRYPTO_ENTROPY_NV_SEED_FILE "seedfile"
89+
90+
/** \} name SECTION: PSA cryptography core configuration options */
91+
92+
/**
93+
* \name SECTION: PSA driver interface implementation configuration options
94+
*
95+
* This section allows for the configuration of the PSA cryptography driver
96+
* interface implementation which implements the PSA cryptographic mechanisms.
97+
* \{
98+
*/
99+
100+
#define PSA_CRYPTO_HAVE_ASM
101+
//#define PSA_CRYPTO_NO_UDBL_DIVISION
102+
#define PSA_CRYPTO_NO_64BIT_MULTIPLICATION
103+
#define PSA_CRYPTO_AES_ROM_TABLES
104+
#define PSA_CRYPTO_AES_FEWER_TABLES
105+
//#define PSA_CRYPTO_CAMELLIA_SMALL_MEMORY
106+
#define PSA_CRYPTO_ECC_NIST_OPTIM
107+
#define PSA_CRYPTO_SHA256_SMALLER
108+
//#define PSA_CRYPTO_SHA512_SMALLER
109+
110+
/** \} name SECTION: PSA driver interface implementation configuration options */
111+
112+
#endif /* PSA_CRYPTO_CONFIG_H */

configs/ccm-aes-sha256.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
/**
2+
* \file configs/ccm-aes-sha256.h
3+
*
4+
* \brief PSA crypto configuration with only symmetric cryptography: CCM-AES,
5+
* SHA-256, HMAC and key derivation
6+
*/
7+
/*
8+
* Copyright The Mbed TLS Contributors
9+
* SPDX-License-Identifier: Apache-2.0
10+
*
11+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
12+
* not use this file except in compliance with the License.
13+
* You may obtain a copy of the License at
14+
*
15+
* http://www.apache.org/licenses/LICENSE-2.0
16+
*
17+
* Unless required by applicable law or agreed to in writing, software
18+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
19+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20+
* See the License for the specific language governing permissions and
21+
* limitations under the License.
22+
*/
23+
24+
#ifndef PSA_CRYPTO_CONFIG_H
25+
#define PSA_CRYPTO_CONFIG_H
26+
27+
/**
28+
* \name SECTION: General configuration options
29+
*
30+
* \{
31+
*/
32+
33+
//#define PSA_CRYPTO_SPM
34+
//#define PSA_CRYPTO_STD_FUNCTIONS
35+
#define PSA_CRYPTO_FS_IO
36+
#define PSA_CRYPTO_MEMORY_BUFFER_ALLOC
37+
38+
/** \} name SECTION: General configuration options */
39+
40+
/**
41+
* \name SECTION: PSA cryptography interface configuration
42+
*
43+
* This section allows for configuring the PSA cryptography interface as
44+
* specified in psa-conditional-inclusion-c.md.
45+
*
46+
* \{
47+
*/
48+
49+
#define PSA_WANT_ALG_CCM 1
50+
#define PSA_WANT_ALG_HMAC 1
51+
#define PSA_WANT_ALG_SHA_256 1
52+
#define PSA_WANT_ALG_TLS12_PRF 1
53+
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
54+
#define PSA_WANT_KEY_TYPE_DERIVE 1
55+
#define PSA_WANT_KEY_TYPE_HMAC 1
56+
#define PSA_WANT_KEY_TYPE_AES 1
57+
#define PSA_WANT_KEY_TYPE_RAW_DATA 1
58+
59+
/** \} name SECTION: PSA cryptography interface configuration */
60+
61+
/**
62+
* \name SECTION: PSA cryptography core configuration options
63+
*
64+
* This section allows for the configuration of the PSA cryptography core
65+
* which provides the key management, the generation of random numbers and
66+
* the dispatch to drivers.
67+
* \{
68+
*/
69+
70+
#define PSA_CRYPTO_KEY_ID_ENCODES_OWNER
71+
//#define PSA_CRYPTO_BUILTIN_KEYS
72+
//#define PSA_CRYPTO_EXTERNAL_RNG
73+
#define PSA_CRYPTO_STORAGE_C
74+
#define PSA_CRYPTO_ITS_FILE_C
75+
//#define PSA_CRYPTO_HMAC_DRBG_HASH PSA_ALG_SHA_256
76+
//#define PSA_CRYPTO_KEY_SLOT_COUNT 32
77+
//#define PSA_CRYPTO_PLATFORM_ENTROPY
78+
#define PSA_CRYPTO_ENTROPY_NV_SEED
79+
//#define PSA_CRYPTO_ENTROPY_NV_SEED_FILE "seedfile"
80+
81+
/** \} name SECTION: PSA cryptography core configuration options */
82+
83+
/**
84+
* \name SECTION: PSA driver interface implementation configuration options
85+
*
86+
* This section allows for the configuration of the PSA cryptography driver
87+
* interface implementation which implements the PSA cryptographic mechanisms.
88+
* \{
89+
*/
90+
91+
#define PSA_CRYPTO_HAVE_ASM
92+
//#define PSA_CRYPTO_NO_UDBL_DIVISION
93+
#define PSA_CRYPTO_NO_64BIT_MULTIPLICATION
94+
#define PSA_CRYPTO_AES_ROM_TABLES
95+
#define PSA_CRYPTO_AES_FEWER_TABLES
96+
//#define PSA_CRYPTO_CAMELLIA_SMALL_MEMORY
97+
//#define PSA_CRYPTO_ECC_NIST_OPTIM
98+
#define PSA_CRYPTO_SHA256_SMALLER
99+
//#define PSA_CRYPTO_SHA512_SMALLER
100+
101+
/** \} name SECTION: PSA driver interface implementation configuration options */
102+
103+
#endif /* PSA_CRYPTO_CONFIG_H */
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/**
2+
* \file psa/gcm-ccm-cbc-aes-sha256_512-secp256_384r1-rsa
3+
*
4+
* \brief PSA crypto configuration with symmetric cryptography and asymmetric
5+
* cryptography based on the secp256r1 or secp384r1 elliptic curves or
6+
* RSA: GCM/CCM/CBC-AES, SHA-256, SHA-512, HMAC, ECDSA, ECDH,
7+
* RSA-PKCS#1 v1.5, RSA-OAEP, RSA-PSS and key derivation.
8+
*/
9+
/*
10+
* Copyright The Mbed TLS Contributors
11+
* SPDX-License-Identifier: Apache-2.0
12+
*
13+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
14+
* not use this file except in compliance with the License.
15+
* You may obtain a copy of the License at
16+
*
17+
* http://www.apache.org/licenses/LICENSE-2.0
18+
*
19+
* Unless required by applicable law or agreed to in writing, software
20+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22+
* See the License for the specific language governing permissions and
23+
* limitations under the License.
24+
*/
25+
26+
#ifndef PSA_CRYPTO_CONFIG_H
27+
#define PSA_CRYPTO_CONFIG_H
28+
29+
/**
30+
* \name SECTION: General configuration options
31+
*
32+
* \{
33+
*/
34+
35+
//#define PSA_CRYPTO_SPM
36+
//#define PSA_CRYPTO_STD_FUNCTIONS
37+
#define PSA_CRYPTO_FS_IO
38+
#define PSA_CRYPTO_MEMORY_BUFFER_ALLOC
39+
40+
/** \} name SECTION: General configuration options */
41+
42+
/**
43+
* \name SECTION: PSA cryptography interface configuration
44+
*
45+
* This section allows for configuring the PSA cryptography interface as
46+
* specified in psa-conditional-inclusion-c.md.
47+
*
48+
* \{
49+
*/
50+
51+
#define PSA_WANT_ALG_CBC_NO_PADDING 1
52+
#define PSA_WANT_ALG_CBC_PKCS7 1
53+
#define PSA_WANT_ALG_CCM 1
54+
#define PSA_WANT_ALG_DETERMINISTIC_ECDSA 1
55+
#define PSA_WANT_ALG_ECDH 1
56+
#define PSA_WANT_ALG_ECDSA 1
57+
#define PSA_WANT_ALG_GCM 1
58+
#define PSA_WANT_ALG_HKDF 1
59+
#define PSA_WANT_ALG_HMAC 1
60+
#define PSA_WANT_ALG_RSA_OAEP 1
61+
#define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT 1
62+
#define PSA_WANT_ALG_RSA_PKCS1V15_SIGN 1
63+
#define PSA_WANT_ALG_RSA_PSS 1
64+
#define PSA_WANT_ALG_SHA_256 1
65+
#define PSA_WANT_ALG_SHA_512 1
66+
#define PSA_WANT_ALG_TLS12_PRF 1
67+
#define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
68+
#define PSA_WANT_ECC_SECP_R1_256 1
69+
#define PSA_WANT_ECC_SECP_R1_384 1
70+
#define PSA_WANT_KEY_TYPE_DERIVE 1
71+
#define PSA_WANT_KEY_TYPE_HMAC 1
72+
#define PSA_WANT_KEY_TYPE_AES 1
73+
#define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR 1
74+
#define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1
75+
#define PSA_WANT_KEY_TYPE_RAW_DATA 1
76+
#define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR 1
77+
#define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1
78+
79+
/** \} name SECTION: PSA cryptography interface configuration */
80+
81+
/**
82+
* \name SECTION: PSA cryptography core configuration options
83+
*
84+
* This section allows for the configuration of the PSA cryptography core
85+
* which provides the key management, the generation of random numbers and
86+
* the dispatch to drivers.
87+
* \{
88+
*/
89+
90+
#define PSA_CRYPTO_KEY_ID_ENCODES_OWNER
91+
//#define PSA_CRYPTO_BUILTIN_KEYS
92+
//#define PSA_CRYPTO_EXTERNAL_RNG
93+
#define PSA_CRYPTO_STORAGE_C
94+
#define PSA_CRYPTO_ITS_FILE_C
95+
//#define PSA_CRYPTO_HMAC_DRBG_HASH PSA_ALG_SHA_256
96+
//#define PSA_CRYPTO_KEY_SLOT_COUNT 32
97+
//#define PSA_CRYPTO_PLATFORM_ENTROPY
98+
#define PSA_CRYPTO_ENTROPY_NV_SEED
99+
#define PSA_CRYPTO_ENTROPY_NV_SEED_FILE "seedfile"
100+
101+
/** \} name SECTION: PSA cryptography core configuration options */
102+
103+
/**
104+
* \name SECTION: PSA driver interface implementation configuration options
105+
*
106+
* This section allows for the configuration of the PSA cryptography driver
107+
* interface implementation which implements the PSA cryptographic mechanisms.
108+
* \{
109+
*/
110+
111+
#define PSA_CRYPTO_HAVE_ASM
112+
//#define PSA_CRYPTO_NO_UDBL_DIVISION
113+
#define PSA_CRYPTO_NO_64BIT_MULTIPLICATION
114+
#define PSA_CRYPTO_AES_ROM_TABLES
115+
#define PSA_CRYPTO_AES_FEWER_TABLES
116+
//#define PSA_CRYPTO_CAMELLIA_SMALL_MEMORY
117+
#define PSA_CRYPTO_ECC_NIST_OPTIM
118+
#define PSA_CRYPTO_SHA256_SMALLER
119+
//#define PSA_CRYPTO_SHA512_SMALLER
120+
121+
/** \} name SECTION: PSA driver interface implementation configuration options */
122+
123+
#endif /* PSA_CRYPTO_CONFIG_H */

0 commit comments

Comments
 (0)