Mistake on this page?
Report an issue in GitHub or email us
compliance_crypto/test_c038/test_data.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 #include "val_crypto.h"
19 
20 typedef struct {
21  char test_desc[75];
22  psa_key_handle_t key_handle;
23  psa_key_type_t key_type;
24  uint8_t key_data[32];
25  uint32_t key_length;
26  psa_key_usage_t usage;
27  psa_algorithm_t key_alg;
28  psa_status_t expected_status;
29 } test_data;
30 
31 static test_data check1[] = {
32 #ifdef ARCH_TEST_AES_128
33 #ifdef ARCH_TEST_CBC_NO_PADDING
34 {"Test psa_cipher_abort - Encrypt - AES CBC_NO_PADDING\n", 1, PSA_KEY_TYPE_AES,
35 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
36  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
37  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
38  PSA_SUCCESS
39 },
40 #endif
41 
42 #ifdef ARCH_TEST_CBC_PKCS7
43 {"Test psa_cipher_abort - Encrypt - AES CBC_PKCS7\n", 2, PSA_KEY_TYPE_AES,
44 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
45  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
46  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_PKCS7,
47  PSA_SUCCESS
48 },
49 #endif
50 
51 #ifdef ARCH_TEST_CIPER_MODE_CTR
52 {"Test psa_cipher_abort - Encrypt - AES CTR\n", 3, PSA_KEY_TYPE_AES,
53 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
54  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
55  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
56  PSA_SUCCESS
57 },
58 #endif
59 #endif
60 
61 #ifdef ARCH_TEST_CBC_NO_PADDING
62 #ifdef ARCH_TEST_DES_1KEY
63 {"Test psa_cipher_abort - Encrypt - DES CBC (nopad)\n", 4, PSA_KEY_TYPE_DES,
64 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e}, DES_8B_KEY_SIZE,
65  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
66  PSA_SUCCESS
67 },
68 #endif
69 
70 #ifdef ARCH_TEST_DES_2KEY
71 {"Test psa_cipher_abort - Encrypt - 2-key 3DE -CBC (nopad)\n", 5, PSA_KEY_TYPE_DES,
72 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, 0xc1, 0xc2, 0xc4, 0xc7, 0xc8,
73  0xcb, 0xcd, 0xce}, DES3_2KEY_SIZE,
74  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
75  PSA_SUCCESS
76 },
77 #endif
78 
79 #ifdef ARCH_TEST_DES_3KEY
80 {"Test psa_cipher_abort - Encrypt - 3-key 3DE -CBC (nopad)\n", 6, PSA_KEY_TYPE_DES,
81 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, 0xc1, 0xc2, 0xc4, 0xc7, 0xc8,
82  0xcb, 0xcd, 0xce, 0x31, 0x32, 0x34, 0x37, 0x38, 0x3b, 0x3d, 0x3e}, DES3_3KEY_SIZE,
83  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
84  PSA_SUCCESS
85 },
86 #endif
87 #endif
88 
89 #ifdef ARCH_TEST_AES_128
90 #ifdef ARCH_TEST_CBC_NO_PADDING
91 {"Test psa_cipher_abort - Decrypt - AES CBC_NO_PADDING\n", 7, PSA_KEY_TYPE_AES,
92 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
93  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
94  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CBC_NO_PADDING,
95  PSA_SUCCESS
96 },
97 #endif
98 
99 #ifdef ARCH_TEST_CBC_PKCS7
100 {"Test psa_cipher_abort - Decrypt - AES CBC_PKCS7\n", 8, PSA_KEY_TYPE_AES,
101 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
102  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
103  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CBC_PKCS7,
104  PSA_SUCCESS
105 },
106 #endif
107 
108 #ifdef ARCH_TEST_CIPER_MODE_CTR
109 {"Test psa_cipher_abort - Decrypt - AES CTR\n", 9, PSA_KEY_TYPE_AES,
110 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
111  0xcf, 0x4f, 0x3c}, AES_16B_KEY_SIZE,
112  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CTR,
113  PSA_SUCCESS
114 },
115 #endif
116 #endif
117 
118 #ifdef ARCH_TEST_CBC_NO_PADDING
119 #ifdef ARCH_TEST_DES_1KEY
120 {"Test psa_cipher_abort - Decrypt - DES CBC (nopad)\n", 10, PSA_KEY_TYPE_DES,
121 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e}, DES_8B_KEY_SIZE,
122  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CBC_NO_PADDING,
123  PSA_SUCCESS
124 },
125 #endif
126 
127 #ifdef ARCH_TEST_DES_2KEY
128 {"Test psa_cipher_abort - Decrypt - 2-key 3DE -CBC (nopad)\n", 11, PSA_KEY_TYPE_DES,
129 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, 0xc1, 0xc2, 0xc4, 0xc7, 0xc8,
130  0xcb, 0xcd, 0xce}, DES3_2KEY_SIZE,
131  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CBC_NO_PADDING,
132  PSA_SUCCESS
133 },
134 #endif
135 
136 #ifdef ARCH_TEST_DES_3KEY
137 {"Test psa_cipher_abort - Decrypt - 3-key 3DE -CBC (nopad)\n", 12, PSA_KEY_TYPE_DES,
138 {0x01, 0x02, 0x04, 0x07, 0x08, 0x0b, 0x0d, 0x0e, 0xc1, 0xc2, 0xc4, 0xc7, 0xc8,
139  0xcb, 0xcd, 0xce, 0x31, 0x32, 0x34, 0x37, 0x38, 0x3b, 0x3d, 0x3e}, DES3_3KEY_SIZE,
140  PSA_KEY_USAGE_DECRYPT, PSA_ALG_CBC_NO_PADDING,
141  PSA_SUCCESS
142 },
143 #endif
144 #endif
145 };
Copyright (c) 2018-2019, Arm Limited or its affiliates.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.