@@ -71,16 +71,15 @@ ZTEST(psa_crypto_test, test_aead_aes_ccm)
7171 PSA_SUCCESS , "Failed to encrypt" );
7272
7373 zassert_equal (out_len , sizeof (expect_cipher_tag_buf ));
74- zassert_mem_equal (cipher_tag_buf , expect_cipher_tag_buf , sizeof ( expect_cipher_tag_buf ));
75-
74+ zassert_mem_equal (cipher_tag_buf , expect_cipher_tag_buf ,
75+ sizeof ( expect_cipher_tag_buf ));
7676 zassert_equal (psa_aead_decrypt (key_id , alg , aes_nonce_buf , sizeof (aes_nonce_buf ),
77- aes_ad_buf , sizeof (aes_ad_buf ), cipher_tag_buf , out_len ,
78- decrypted , sizeof (decrypted ), & out_len ),
79- PSA_SUCCESS , "Failed to decrypt" );
77+ aes_ad_buf , sizeof (aes_ad_buf ), cipher_tag_buf , out_len ,
78+ decrypted , sizeof (decrypted ), & out_len ),
79+ PSA_SUCCESS , "Failed to decrypt" );
8080
8181 zassert_equal (out_len , sizeof (aes_plaintext ));
8282 zassert_mem_equal (decrypted , aes_plaintext , sizeof (aes_plaintext ));
83-
8483 zassert_equal (psa_destroy_key (key_id ), PSA_SUCCESS , "Failed to destroy key" );
8584}
8685
@@ -103,21 +102,21 @@ ZTEST(psa_crypto_test, test_aead_aes_gcm)
103102 psa_set_key_algorithm (& attributes , alg );
104103
105104 zassert_equal (psa_import_key (& attributes , aes_key_buf , sizeof (aes_key_buf ), & key_id ),
106- PSA_SUCCESS , "Failed to import key" );
105+ PSA_SUCCESS , "Failed to import key" );
107106
108107 zassert_equal (psa_aead_encrypt (key_id , alg , aes_nonce_buf , sizeof (aes_nonce_buf ),
109- aes_ad_buf , sizeof (aes_ad_buf ), aes_plaintext ,
110- sizeof (aes_plaintext ), cipher_tag_buf ,
111- sizeof (cipher_tag_buf ), & out_len ),
112- PSA_SUCCESS , "Failed to encrypt" );
108+ aes_ad_buf , sizeof (aes_ad_buf ), aes_plaintext ,
109+ sizeof (aes_plaintext ), cipher_tag_buf ,
110+ sizeof (cipher_tag_buf ), & out_len ),
111+ PSA_SUCCESS , "Failed to encrypt" );
113112
114113 zassert_equal (out_len , sizeof (expect_cipher_tag_buf ));
115114 zassert_mem_equal (cipher_tag_buf , expect_cipher_tag_buf , sizeof (expect_cipher_tag_buf ));
116115
117116 zassert_equal (psa_aead_decrypt (key_id , alg , aes_nonce_buf , sizeof (aes_nonce_buf ),
118- aes_ad_buf , sizeof (aes_ad_buf ), cipher_tag_buf , out_len ,
119- decrypted , sizeof (decrypted ), & out_len ),
120- PSA_SUCCESS , "Failed to decrypt" );
117+ aes_ad_buf , sizeof (aes_ad_buf ), cipher_tag_buf , out_len ,
118+ decrypted , sizeof (decrypted ), & out_len ),
119+ PSA_SUCCESS , "Failed to decrypt" );
121120
122121 zassert_equal (out_len , sizeof (aes_plaintext ));
123122 zassert_mem_equal (decrypted , aes_plaintext , sizeof (aes_plaintext ));
@@ -130,7 +129,6 @@ ZTEST(psa_crypto_test, test_aead_chacha20_poly1305)
130129 uint8_t cipher_tag_buf [130 ]; /* Ciphertext + Tag */
131130 uint8_t decrypted [sizeof (chachapoly_plaintext )] = {0 };
132131 size_t out_len ;
133-
134132 psa_key_id_t key_id ;
135133 psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT ;
136134 psa_algorithm_t alg = PSA_ALG_CHACHA20_POLY1305 ;
@@ -162,6 +160,5 @@ ZTEST(psa_crypto_test, test_aead_chacha20_poly1305)
162160
163161 zassert_equal (out_len , sizeof (chachapoly_plaintext ));
164162 zassert_mem_equal (decrypted , chachapoly_plaintext , sizeof (chachapoly_plaintext ));
165-
166163 zassert_equal (psa_destroy_key (key_id ), PSA_SUCCESS , "Failed to destroy key" );
167164}
0 commit comments