Added generic HKDF implementation.
[BearSSL] / test / test_speed.c
index 43d062a..b1cd9f2 100644 (file)
@@ -518,16 +518,19 @@ SPEED_EAX(AES, aes, 128, small)
 SPEED_EAX(AES, aes, 128, ct)
 SPEED_EAX(AES, aes, 128, ct64)
 SPEED_EAX(AES, aes, 128, x86ni)
+SPEED_EAX(AES, aes, 128, pwr8)
 SPEED_EAX(AES, aes, 192, big)
 SPEED_EAX(AES, aes, 192, small)
 SPEED_EAX(AES, aes, 192, ct)
 SPEED_EAX(AES, aes, 192, ct64)
 SPEED_EAX(AES, aes, 192, x86ni)
+SPEED_EAX(AES, aes, 192, pwr8)
 SPEED_EAX(AES, aes, 256, big)
 SPEED_EAX(AES, aes, 256, small)
 SPEED_EAX(AES, aes, 256, ct)
 SPEED_EAX(AES, aes, 256, ct64)
 SPEED_EAX(AES, aes, 256, x86ni)
+SPEED_EAX(AES, aes, 256, pwr8)
 
 static const unsigned char RSA_N[] = {
        0xE9, 0xF2, 0x4A, 0x2F, 0x96, 0xDF, 0x0A, 0x23,
@@ -684,7 +687,11 @@ test_speed_rsa_inner(char *name,
        unsigned char tmp[sizeof RSA_N];
        int i;
        long num;
+       /*
        br_hmac_drbg_context rng;
+       */
+       br_aesctr_drbg_context rng;
+       const br_block_ctr_class *ictr;
 
        memset(tmp, 'R', sizeof tmp);
        tmp[0] = 0;
@@ -744,7 +751,21 @@ test_speed_rsa_inner(char *name,
                fflush(stdout);
                return;
        }
+       /*
        br_hmac_drbg_init(&rng, &br_sha256_vtable, "RSA keygen seed", 15);
+       */
+       ictr = br_aes_x86ni_ctr_get_vtable();
+       if (ictr == NULL) {
+               ictr = br_aes_pwr8_ctr_get_vtable();
+               if (ictr == NULL) {
+#if BR_64
+                       ictr = &br_aes_ct64_ctr_vtable;
+#else
+                       ictr = &br_aes_ct_ctr_vtable;
+#endif
+               }
+       }
+       br_aesctr_drbg_init(&rng, ictr, "RSA keygen seed", 15);
 
        num = 10;
        for (;;) {
@@ -1459,6 +1480,9 @@ static const struct {
        STU(eax_aes128_x86ni),
        STU(eax_aes192_x86ni),
        STU(eax_aes256_x86ni),
+       STU(eax_aes128_pwr8),
+       STU(eax_aes192_pwr8),
+       STU(eax_aes256_pwr8),
 
        STU(rsa_i15),
        STU(rsa_i31),