Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api-tests/dev_apis/crypto/common/test_crypto_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,18 @@ const uint8_t additional_data[] = {
0x40, 0xa2, 0x7c, 0x1d, 0x1e, 0x23, 0xea, 0x3d, 0xbe, 0x80, 0x56, 0xb2, 0x77, 0x48, 0x61, 0xa4,
0xa2, 0x01, 0xcc, 0xe4, 0x9f, 0x19, 0x99, 0x7d, 0x19, 0x20, 0x6d, 0x8c, 0x8a, 0x34, 0x39, 0x51};

const uint8_t ccm_star_no_tag_key_data[] = {
0x90, 0x92, 0x9a, 0x4b, 0x0a, 0xc6, 0x5b, 0x35, 0x0a, 0xd1, 0x59, 0x16, 0x11, 0xfe, 0x48, 0x29};

const uint8_t ccm_star_no_tag_plaintext[] = {0x4b, 0xfe, 0x4e, 0x35, 0x78, 0x4f, 0x0a, 0x65, 0xb5,
0x45, 0x47, 0x7e, 0x5e, 0x2f, 0x4b, 0xae, 0x0e, 0x1e, 0x6f, 0xa7, 0x17, 0xea, 0xf2, 0xcb};

const uint8_t ccm_star_no_tag_iv[] = {0x5a, 0x8a, 0xa4, 0x85, 0xc3, 0x16, 0xe9, 0x40, 0x3a, 0xff,
0x85, 0x9f, 0xbb};

const uint8_t ccm_star_no_tag_ciphertext[] = {0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71, 0x72,
0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53, 0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97};

const uint8_t plaintext[] = {
0x45, 0x35, 0xd1, 0x2b, 0x43, 0x77, 0x92, 0x8a,
0x7c, 0x0a, 0x61, 0xc9, 0xf8, 0x25, 0xa4, 0x86,
Expand Down
5 changes: 5 additions & 0 deletions api-tests/dev_apis/crypto/common/test_crypto_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ extern uint8_t expected_output[BUFFER_SIZE];

extern void crypto_common_exit_action(void);

extern const uint8_t ccm_star_no_tag_iv[];
extern const uint8_t ccm_star_no_tag_plaintext[];
extern const uint8_t ccm_star_no_tag_ciphertext[];
extern const uint8_t ccm_star_no_tag_key_data[];

#ifdef ARCH_TEST_FFDHE2048
extern const uint8_t ffdh_key_data_2048[];
extern const uint8_t ffdh_peer_key_data_2048[];
Expand Down
19 changes: 19 additions & 0 deletions api-tests/dev_apis/crypto/test_c037/test_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ static const test_data check1[] = {
.expected_status = PSA_SUCCESS
},
#endif
#ifdef ARCH_TEST_CCM_STAR_NO_TAG
{
.test_desc = "Test psa_cipher_finish - Encrypt - CCM* No tag\n",
.type = PSA_KEY_TYPE_AES,
.data = ccm_star_no_tag_key_data,
.data_length = AES_16B_KEY_SIZE,
.usage_flags = PSA_KEY_USAGE_ENCRYPT,
.alg = PSA_ALG_CCM_STAR_NO_TAG,
.iv = ccm_star_no_tag_iv,
.iv_length = 13,
.input = ccm_star_no_tag_plaintext,
.input_length = 24,
.output = expected_output,
.output_size = BUFFER_SIZE,
.expected_output = ccm_star_no_tag_ciphertext,
.expected_output_length = 24,
.expected_status = PSA_SUCCESS
},
#endif
#endif

#ifdef ARCH_TEST_CBC_NO_PADDING
Expand Down
10 changes: 10 additions & 0 deletions api-tests/dev_apis/crypto/test_c050/test_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ static const test_data check1[] = {
0xb2, 0xbd}, 31, PSA_SUCCESS
},
#endif

#ifdef ARCH_TEST_CCM_STAR_NO_TAG
{"Test psa_cipher_encrypt - Encrypt - CCM_STAR_NO_TAG\n", PSA_KEY_TYPE_AES,
{0x90, 0x92, 0x9a, 0x4b, 0x0a, 0xc6, 0x5b, 0x35, 0x0a, 0xd1, 0x59, 0x16, 0x11, 0xfe, 0x48, 0x29},
AES_16B_KEY_SIZE, PSA_KEY_USAGE_ENCRYPT, PSA_ALG_CCM_STAR_NO_TAG,
{0x4b, 0xfe, 0x4e, 0x35, 0x78, 0x4f, 0x0a, 0x65, 0xb5, 0x45, 0x47, 0x7e, 0x5e, 0x2f, 0x4b, 0xae,
0x0e, 0x1e, 0x6f, 0xa7, 0x17, 0xea, 0xf2, 0xcb}, 24, PSA_CIPHER_ENCRYPT_OUTPUT_MAX_SIZE(24),
{0xa1, 0x6a, 0x2e, 0x74, 0x1f, 0x1c, 0xd9, 0x71, 0x72, 0x85, 0xb6, 0xd8, 0x82, 0xc1, 0xfc, 0x53,
0x65, 0x5e, 0x97, 0x73, 0x76, 0x1a, 0xd6, 0x97}, 37, PSA_SUCCESS},
#endif
#endif

#ifdef ARCH_TEST_CBC_NO_PADDING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,17 @@
*/
#define ARCH_TEST_CCM

/**
* \def ARCH_TEST_CCM_STAR_NO_TAG
*
* Enable the CCM* mode with a zero-length authentication field, i.e.
* confidentiality without authenticity (IEEE P802.15-4/0537r2). PSA exposes
* this as the cipher algorithm PSA_ALG_CCM_STAR_NO_TAG.
*
* Requires: ARCH_TEST_AES
*/
#define ARCH_TEST_CCM_STAR_NO_TAG

/**
* \def ARCH_TEST_GCM
*
Expand Down