Mistake on this page?
Report an issue in GitHub or email us
compliance_crypto/test_c031/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[64];
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_HMAC
33 #ifdef ARCH_TEST_SHA224
34 {"Test psa_mac_abort HMAC SHA 224\n", 1, PSA_KEY_TYPE_HMAC,
35 {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
36  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 20,
37  PSA_KEY_USAGE_SIGN, PSA_ALG_HMAC(PSA_ALG_SHA_224),
38  PSA_SUCCESS
39 },
40 #endif
41 
42 #ifdef ARCH_TEST_SHA256
43 {"Test psa_mac_abort HMAC SHA 256\n", 2, PSA_KEY_TYPE_HMAC,
44 {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
45  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 20,
46  PSA_KEY_USAGE_SIGN, PSA_ALG_HMAC(PSA_ALG_SHA_256),
47  PSA_SUCCESS
48 },
49 #endif
50 
51 #ifdef ARCH_TEST_SHA512
52 {"Test psa_mac_abort HMAC SHA 512\n", 3, PSA_KEY_TYPE_HMAC,
53 {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
54  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 20,
55  PSA_KEY_USAGE_SIGN, PSA_ALG_HMAC(PSA_ALG_SHA_512),
56  PSA_SUCCESS
57 },
58 #endif
59 
60 #ifdef ARCH_TEST_SHA224
61 {"Test psa_mac_abort HMAC SHA 224 (truncated to 8 Byte)\n", 4, PSA_KEY_TYPE_HMAC,
62 {0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b,
63  0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b}, 20,
64  PSA_KEY_USAGE_SIGN, PSA_ALG_TRUNCATED_MAC(PSA_ALG_HMAC(PSA_ALG_SHA_224), 8),
65  PSA_SUCCESS
66 },
67 #endif
68 #endif
69 
70 #ifdef ARCH_TEST_AES_128
71 #ifdef ARCH_TEST_CMAC
72 {"Test psa_mac_abort CMAC AES 128\n", 5, PSA_KEY_TYPE_AES,
73 {0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09,
74  0xcf, 0x4f, 0x3c}, 16,
75  PSA_KEY_USAGE_SIGN, PSA_ALG_CMAC,
76  PSA_SUCCESS
77 },
78 #endif
79 #endif
80 };
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.