Merge pull request #8667 from gilles-peskine-arm/pthread-link-auto-make-followup

Minor cleanups to common.make
diff --git a/include/psa/crypto_extra.h b/include/psa/crypto_extra.h
index f132f7e..fc9bf4f 100644
--- a/include/psa/crypto_extra.h
+++ b/include/psa/crypto_extra.h
@@ -464,10 +464,13 @@
  * \retval #PSA_ERROR_NOT_SUPPORTED \emptydescription
  * \retval #PSA_ERROR_INSUFFICIENT_MEMORY \emptydescription
  */
+#if !defined(PSA_SET_KEY_DOMAIN_PARAMETERS)
+#define PSA_SET_KEY_DOMAIN_PARAMETERS
 psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes,
                                            psa_key_type_t type,
                                            const uint8_t *data,
                                            size_t data_length);
+#endif /* PSA_SET_KEY_DOMAIN_PARAMETERS */
 
 /**
  * \brief Get domain parameters for a key.
diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h
index 5e52ffd..3a19618 100644
--- a/include/psa/crypto_struct.h
+++ b/include/psa/crypto_struct.h
@@ -368,10 +368,13 @@
 
 /* This function is declared in crypto_extra.h, which comes after this
  * header file, but we need the function here, so repeat the declaration. */
+#if !defined(PSA_SET_KEY_DOMAIN_PARAMETERS)
+#define PSA_SET_KEY_DOMAIN_PARAMETERS
 psa_status_t psa_set_key_domain_parameters(psa_key_attributes_t *attributes,
                                            psa_key_type_t type,
                                            const uint8_t *data,
                                            size_t data_length);
+#endif /* PSA_SET_KEY_DOMAIN_PARAMETERS */
 
 static inline void psa_set_key_type(psa_key_attributes_t *attributes,
                                     psa_key_type_t type)
diff --git a/programs/test/benchmark.c b/programs/test/benchmark.c
index 85b7fc6..755a731 100644
--- a/programs/test/benchmark.c
+++ b/programs/test/benchmark.c
@@ -83,7 +83,14 @@
 #include "mbedtls/memory_buffer_alloc.h"
 #endif
 
+#ifdef MBEDTLS_TIMING_ALT
+void mbedtls_set_alarm(int seconds);
+unsigned long mbedtls_timing_hardclock(void);
+extern volatile int mbedtls_timing_alarmed;
+#else
 static void mbedtls_set_alarm(int seconds);
+static unsigned long mbedtls_timing_hardclock(void);
+#endif
 
 /*
  * For heap usage estimates, we need an estimate of the overhead per allocated
@@ -227,6 +234,7 @@
         }                                                                   \
     } while (0)
 
+#if !defined(MBEDTLS_TIMING_ALT)
 #if !defined(HAVE_HARDCLOCK) && defined(MBEDTLS_HAVE_ASM) &&  \
     (defined(_MSC_VER) && defined(_M_IX86)) || defined(__WATCOMC__)
 
@@ -441,6 +449,7 @@
 }
 
 #endif /* _WIN32 && !EFIX64 && !EFI32 */
+#endif /* !MBEDTLS_TIMING_ALT */
 
 static int myrand(void *rng_state, unsigned char *output, size_t len)
 {
@@ -1011,7 +1020,7 @@
         int keysize;
         mbedtls_rsa_context rsa;
 
-        for (keysize = 2048; keysize <= 4096; keysize *= 2) {
+        for (keysize = 2048; keysize <= 4096; keysize += 1024) {
             mbedtls_snprintf(title, sizeof(title), "RSA-%d", keysize);
 
             mbedtls_rsa_init(&rsa);