22 psa_key_handle_t key_handle;
23 psa_key_type_t key_type;
26 psa_key_usage_t usage;
27 psa_algorithm_t key_alg;
29 size_t expected_iv_length;
30 psa_status_t expected_status;
34 #ifdef ARCH_TEST_CIPER_MODE_CTR 35 #ifdef ARCH_TEST_AES_128 36 {
"Test psa_cipher_generate_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, 16, 16,
44 #ifdef ARCH_TEST_AES_192 45 {
"Test psa_cipher_generate_iv 24 Byte AES\n", 2, PSA_KEY_TYPE_AES,
46 {0x24, 0x13, 0x61, 0x47, 0x61, 0xB8, 0xC8, 0xF0, 0xDF, 0xAB, 0x5A, 0x0E, 0x87,
47 0x40, 0xAC, 0xA3, 0x90, 0x77, 0x83, 0x52, 0x31, 0x74, 0xF9}, AES_24B_KEY_SIZE,
48 PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR, 16, 16,
53 #ifdef ARCH_TEST_AES_256 54 {
"Test psa_cipher_generate_iv 32 Byte AES\n", 3, PSA_KEY_TYPE_AES,
55 {0xEA, 0xD5, 0xE6, 0xC8, 0x51, 0xF9, 0xEC, 0xBB, 0x9B, 0x57, 0x7C, 0xED, 0xD2,
56 0x4B, 0x82, 0x84, 0x9F, 0x9F, 0xE6, 0x73, 0x21, 0x3D, 0x1A, 0x05, 0xC9, 0xED,
57 0xDF, 0x25, 0x17, 0x68, 0x86, 0xAE}, AES_32B_KEY_SIZE,
58 PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR, 16, 16,
64 #ifdef ARCH_TEST_CBC_NO_PADDING 65 #ifdef ARCH_TEST_DES_1KEY 66 {
"Test psa_cipher_generate_iv DES 64 bit key\n", 4, PSA_KEY_TYPE_DES,
67 {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
68 DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
74 #ifdef ARCH_TEST_DES_2KEY 75 {
"Test psa_cipher_generate_iv Triple DES 2-Key\n", 5, PSA_KEY_TYPE_DES,
76 {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
78 DES3_2KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
84 #ifdef ARCH_TEST_DES_3KEY 85 {
"Test psa_cipher_generate_iv Triple DES 3-Key\n", 6, PSA_KEY_TYPE_DES,
86 {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
87 0xF1, 0xE0, 0xD3, 0xC2, 0xB5, 0xA4, 0x97, 0x86,
88 0xFE, 0xDC, 0xBA, 0x98, 0x76, 0x54, 0x32, 0x10},
89 DES3_3KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
96 #ifdef ARCH_TEST_CIPER_MODE_CTR 97 #ifdef ARCH_TEST_AES_128 98 {
"Test psa_cipher_generate_iv AES - small iv buffer\n", 7, PSA_KEY_TYPE_AES,
99 {0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
100 0x5F, 0xC9, 0xD0}, AES_16B_KEY_SIZE,
101 PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR, 8, 16,
102 PSA_ERROR_BUFFER_TOO_SMALL
107 #ifdef ARCH_TEST_CBC_NO_PADDING 108 #ifdef ARCH_TEST_DES_1KEY 109 {
"Test psa_cipher_generate_iv DES - small iv buffer\n", 8, PSA_KEY_TYPE_DES,
110 {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
111 DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
113 PSA_ERROR_BUFFER_TOO_SMALL
118 #ifdef ARCH_TEST_CIPER_MODE_CTR 119 #ifdef ARCH_TEST_AES_128 120 {
"Test psa_cipher_generate_iv AES - large iv buffer\n", 9, PSA_KEY_TYPE_AES,
121 {0x49, 0x8E, 0xC7, 0x7D, 0x01, 0x95, 0x0D, 0x94, 0x2C, 0x16, 0xA5, 0x3E, 0x99,
122 0x5F, 0xC9, 0xD0}, AES_16B_KEY_SIZE,
123 PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CTR, 32, 16,
129 #ifdef ARCH_TEST_CBC_NO_PADDING 130 #ifdef ARCH_TEST_DES_1KEY 131 {
"Test psa_cipher_generate_iv DES - large iv buffer\n", 10, PSA_KEY_TYPE_DES,
132 {0x70, 0x24, 0x55, 0x0C, 0x14, 0x9D, 0xED, 0x29},
133 DES_8B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CBC_NO_PADDING,
Copyright (c) 2018-2019, Arm Limited or its affiliates.