Mistake on this page?
Report an issue in GitHub or email us
compliance_crypto/test_c035/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  uint8_t iv[32];
29  size_t iv_size;
30  psa_status_t expected_status;
31 } test_data;
32 
33 static test_data check1[] = {
34 #ifdef ARCH_TEST_CIPER_MODE_CTR
35 #ifdef ARCH_TEST_AES_128
36 {"Test psa_cipher_set_iv 16 Byte AES\n", 1, PSA_KEY_TYPE_AES,
37 {0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
38  0x5F, 0xC9, 0xD0}, AES_16B_KEY_SIZE,
39  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
40 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
41  0x0D, 0x0E, 0x0F}, 16,
42  PSA_SUCCESS
43 },
44 #endif
45 
46 #ifdef ARCH_TEST_AES_192
47 {"Test psa_cipher_set_iv 24 Byte AES\n", 2, PSA_KEY_TYPE_AES,
48 {0x24, 0x13, 0x61, 0x47, 0x61, 0xB8, 0xC8, 0xF0, 0xDF, 0xAB, 0x5A, 0x0E, 0x87,
49  0x40, 0xAC, 0xA3, 0x90, 0x77, 0x83, 0x52, 0x31, 0x74, 0xF9}, AES_24B_KEY_SIZE,
50  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
51 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
52  0x0D, 0x0E, 0x0F}, 16,
53  PSA_SUCCESS
54 },
55 #endif
56 
57 #ifdef ARCH_TEST_AES_256
58 {"Test psa_cipher_set_iv 32 Byte AES\n", 3, PSA_KEY_TYPE_AES,
59 {0xEA, 0xD5, 0xE6, 0xC8, 0x51, 0xF9, 0xEC, 0xBB, 0x9B, 0x57, 0x7C, 0xED, 0xD2,
60  0x4B, 0x82, 0x84, 0x9F, 0x9F, 0xE6, 0x73, 0x21, 0x3D, 0x1A, 0x05, 0xC9, 0xED,
61  0xDF, 0x25, 0x17, 0x68, 0x86, 0xAE}, AES_32B_KEY_SIZE,
62  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
63 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
64  0x0D, 0x0E, 0x0F}, 16,
65  PSA_SUCCESS
66 },
67 #endif
68 #endif
69 
70 #ifdef ARCH_TEST_CBC_AES_NO_PADDING
71 #ifdef ARCH_TEST_DES_1KEY
72 {"Test psa_cipher_set_iv DES 64 bit key\n", 4, PSA_KEY_TYPE_DES,
73  {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
74  DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
75  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8,
76  PSA_SUCCESS
77 },
78 
79 #endif
80 
81 #ifdef ARCH_TEST_DES_2KEY
82 {"Test psa_cipher_set_iv Triple DES 2-Key\n", 5, PSA_KEY_TYPE_DES,
83 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
85  DES3_2KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
86  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8,
87  PSA_SUCCESS
88 },
89 #endif
90 
91 #ifdef ARCH_TEST_DES_3KEY
92 {"Test psa_cipher_set_iv Triple DES 3-Key\n", 6, PSA_KEY_TYPE_DES,
93 {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
94  0xF1, 0xE0, 0xD3, 0xC2, 0xB5, 0xA4, 0x97, 0x86,
95  0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},
96  DES3_3KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
97  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8,
98  PSA_SUCCESS
99 },
100 #endif
101 #endif
102 
103 #ifdef ARCH_TEST_CIPER_MODE_CTR
104 #ifdef ARCH_TEST_AES_128
105 {"Test psa_cipher_set_iv AES - small iv buffer\n", 7, PSA_KEY_TYPE_AES,
106 {0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
107  0x5F, 0xC9, 0xD0}, AES_16B_KEY_SIZE,
108  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
109  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07}, 8,
110  PSA_ERROR_INVALID_ARGUMENT
111 },
112 #endif
113 #endif
114 
115 #ifdef ARCH_TEST_CBC_AES_NO_PADDING
116 #ifdef ARCH_TEST_DES_1KEY
117 {"Test psa_cipher_set_iv DES - small iv buffer\n", 8, PSA_KEY_TYPE_DES,
118  {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
119  DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
120 {0x00, 0x01, 0x02, 0x03,}, 4,
121  PSA_ERROR_INVALID_ARGUMENT
122 },
123 #endif
124 #endif
125 
126 #ifdef ARCH_TEST_CIPER_MODE_CTR
127 #ifdef ARCH_TEST_AES_128
128 {"Test psa_cipher_set_iv AES - large iv buffer\n", 9, PSA_KEY_TYPE_AES,
129 {0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
130  0x5F, 0xC9, 0xD0}, AES_16B_KEY_SIZE,
131  PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR,
132 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
133  0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
134  0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F}, 32,
135  PSA_ERROR_INVALID_ARGUMENT
136 },
137 #endif
138 #endif
139 
140 #ifdef ARCH_TEST_CBC_AES_NO_PADDING
141 #ifdef ARCH_TEST_DES_1KEY
142 {"Test psa_cipher_set_iv DES - large iv buffer\n", 10, PSA_KEY_TYPE_DES,
143  {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
144  DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
145 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C,
146  0x0D, 0x0E, 0x0F}, 16,
147  PSA_ERROR_INVALID_ARGUMENT
148 },
149 #endif
150 #endif
151 };
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.