From a111c0c894238cc134451f267016cc821f903cfd Mon Sep 17 00:00:00 2001 From: Dave Rodgman Date: Wed, 14 Feb 2024 09:31:41 +0000 Subject: [PATCH] Improve docs; pacify check-names Signed-off-by: Dave Rodgman --- library/sha3.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/library/sha3.c b/library/sha3.c index 99a8acbaaf..64a87a8a82 100644 --- a/library/sha3.c +++ b/library/sha3.c @@ -10,9 +10,20 @@ * https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.202.pdf */ -#undef MBEDTLS_SHA3_THETA_UNROLL -#define MBEDTLS_SHA3_RHO_UNROLL -#define MBEDTLS_SHA3_PI_UNROLL +/* + * These macros select manually unrolled implementations of parts of the main permutation function. + * + * Unrolling has a major impact on both performance and code size. gcc performance benefits a lot + * from manually unrolling at higher optimisation levels. + * + * Rolling up the theta loop saves a lot of code-size at small performance cost. The code-size + * saving then enables us to unroll the other loops for a net code-size saving with a net + * performance win. + */ +#undef MBEDTLS_SHA3_THETA_UNROLL //no-check-names +#define MBEDTLS_SHA3_RHO_UNROLL //no-check-names +#define MBEDTLS_SHA3_PI_UNROLL //no-check-names + #include "common.h"