Minor fixup of SKIP_IF test macro documentation verbiage

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman 2021-02-10 17:02:05 +01:00
parent 28a45ed8db
commit 1e9c042085

View File

@ -101,20 +101,21 @@ psa_status_t mbedtls_test_record_status( psa_status_t status,
#endif /* defined(RECORD_PSA_STATUS_COVERAGE_LOG) */ #endif /* defined(RECORD_PSA_STATUS_COVERAGE_LOG) */
/** Skip a test case if the given key is an 192 bits AES key and the AES /** Skip a test case if the given key is a 192 bits AES key and the AES
* implementation is at least partially an alternative implementation. * implementation is at least partially provided by an accelerator or
*
* Call this macro in a test case when a cryptography operation that may
* involve an AES operation returns with the PSA_ERROR_NOT_SUPPORTED error
* code to skip and not fail the test case in case the operation involves an
* 192 bits AES key and the AES implementation is at least partially an
* alternative implementation. * alternative implementation.
* *
* Hardware AES implementations are likely to not support 192 bits keys. * Call this macro in a test case when a cryptographic operation that may
* involve an AES operation returns a #PSA_ERROR_NOT_SUPPORTED error code.
* The macro call will skip and not fail the test case in case the operation
* involves a 192 bits AES key and the AES implementation is at least
* partially provided by an accelerator or alternative implementation.
*
* Hardware AES implementations not supporting 192 bits keys commonly exist.
* Consequently, PSA test cases aim at not failing when an AES operation with * Consequently, PSA test cases aim at not failing when an AES operation with
* an 192 bits key performed by an alternative AES implementation returns * a 192 bits key performed by an alternative AES implementation returns
* with the PSA_ERROR_NOT_SUPPORTED error code. The purpose of this macro * with the #PSA_ERROR_NOT_SUPPORTED error code. The purpose of this macro
* is to facilitate this and make the related code more readable. * is to facilitate this and make the test case code more readable.
* *
* \param key_type Key type * \param key_type Key type
* \param key_bits Key length in number of bits. * \param key_bits Key length in number of bits.
@ -140,27 +141,28 @@ psa_status_t mbedtls_test_record_status( psa_status_t status,
} \ } \
while( 0 ) while( 0 )
/** Skip a test case in case of a GCM operation with a nonce length different /** Skip a test case if a GCM operation with a nonce length different from
* from 12 bytes. * 12 bytes fails and was performed by an accelerator or alternative
* implementation.
* *
* Call this macro in a test case when an AEAD cryptography operation that * Call this macro in a test case when an AEAD cryptography operation that
* may involve the GCM mode returns with the PSA_ERROR_NOT_SUPPORTED error * may involve the GCM mode returns with a #PSA_ERROR_NOT_SUPPORTED error
* code to skip and not fail the test case in case the operation involves the * code. The macro call will skip and not fail the test case in case the
* GCM mode, a nonce with a length different from 12 bytes and the GCM mode * operation involves the GCM mode, a nonce with a length different from
* implementation is an alternative one. * 12 bytes and the GCM mode implementation is an alternative one.
* *
* Hardware GCM implementations are likely to not support nonce lengths * Hardware GCM implementations not supporting nonce lengths different from
* different from 12 are those imply additional computations involving the * 12 bytes commonly exist, as supporting a non-12-byte nonce requires
* GHASH function. Consequently, PSA test cases aim at not failing when an * additional computations involving the GHASH function.
* AEAD operation in GCM mode with a nonce length different from 12 bytes * Consequently, PSA test cases aim at not failing when an AEAD operation in
* performed by an alternative GCM implementation returns with the * GCM mode with a nonce length different from 12 bytes is performed by an
* PSA_ERROR_NOT_SUPPORTED error code. The purpose of this macro is to * alternative GCM implementation and returns with a #PSA_ERROR_NOT_SUPPORTED
* facilitate this and make the related code more readable. * error code. The purpose of this macro is to facilitate this check and make
* the test case code more readable.
* *
* \param alg The AEAD algorithm. * \param alg The AEAD algorithm.
* \param nonce_length The nonce length in number of bytes. * \param nonce_length The nonce length in number of bytes.
*/ */
#if defined(MBEDTLS_GCM_ALT) || \ #if defined(MBEDTLS_GCM_ALT) || \
defined(MBEDTLS_PSA_ACCEL_ALG_GCM) defined(MBEDTLS_PSA_ACCEL_ALG_GCM)
#define MBEDTLS_TEST_HAVE_ALT_GCM 1 #define MBEDTLS_TEST_HAVE_ALT_GCM 1