diff --git a/programs/psa/aead_cipher_psa.c b/programs/psa/aead_cipher_psa.c index 9af50eaa5..c8716d868 100644 --- a/programs/psa/aead_cipher_psa.c +++ b/programs/psa/aead_cipher_psa.c @@ -1,4 +1,7 @@ /* + * This is a simple example of multi-part AEAD computation using both the old + * Cipher API and the new PSA API; its goal is to help migration to PSA Crypto. + * * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * @@ -16,15 +19,12 @@ */ /* - * This is a simple example of multi-part AEAD computation using both the old - * Cipher API and the new PSA API; its goal is to help migration to PSA Crypto. - * - * When in comes to multi-part HMAC operations, the `mbedtls_md_context` - * serves a triple purpose (1) hold the key, (2) store the algorithm, and (3) - * save progress information for the current operation. With PSA those roles - * are held by disinct objects: (1) a psa_key_id_t to hold the key, a (2) - * psa_algorithm_t to represent the algorithm, and (3) a psa_operation_t for - * multi-part progress. + * When used with multi-part AEAD operations, the `mbedtls_cipher_context` + * serves a triple purpose (1) hold the key, (2) store the algorithm when no + * operation is active, and (3) save progress information for the current + * operation. With PSA those roles are held by disinct objects: (1) a + * psa_key_id_t to hold the key, a (2) psa_algorithm_t to represent the + * algorithm, and (3) a psa_operation_t for multi-part progress. * * On the other hand, with PSA, the algorithms encodes the desired tag length; * with Cipher the desired tag length needs to be tracked separately. diff --git a/programs/psa/hmac_md_psa.c b/programs/psa/hmac_md_psa.c index 7230c20cd..130705b33 100644 --- a/programs/psa/hmac_md_psa.c +++ b/programs/psa/hmac_md_psa.c @@ -1,4 +1,7 @@ /* + * This is a simple example of multi-part HMAC computation using both the old + * MD API and the new PSA API; its goal is to help migration to PSA Crypto. + * * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 * @@ -16,9 +19,6 @@ */ /* - * This is a simple example of multi-part HMAC computation using both the old - * MD API and the new PSA API; its goal is to help migration to PSA Crypto. - * * When in comes to multi-part HMAC operations, the `mbedtls_md_context` * serves a dual purpose (1) hold the key, and (2) save progress information * for the current operation. With PSA those roles are held by two disinct @@ -26,7 +26,7 @@ * multi-part progress. * * This program illustrates this by doing the same sequence of multi-part HMAC - * computation with both APIs; looking at the two function md() and mac() side + * computation with both APIs; looking at the two functions md() and mac() side * by side should make the differences and similarities clear. */