Added new 64-bit implementations of Curve25519 and P-256.
[BearSSL] / test / test_speed.c
index 0e885db..eb1b964 100644 (file)
@@ -1038,6 +1038,32 @@ test_speed_ec_p256_m31(void)
                &br_ec_p256_m31, &br_secp256r1);
 }
 
                &br_ec_p256_m31, &br_secp256r1);
 }
 
+static void
+test_speed_ec_p256_m62(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_p256_m62_get();
+       if (ec != NULL) {
+               test_speed_ec_inner("EC p256_m62", ec, &br_secp256r1);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "EC p256_m62");
+       }
+}
+
+static void
+test_speed_ec_p256_m64(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_p256_m64_get();
+       if (ec != NULL) {
+               test_speed_ec_inner("EC p256_m64", ec, &br_secp256r1);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "EC p256_m64");
+       }
+}
+
 static void
 test_speed_ec_prime_i15(void)
 {
 static void
 test_speed_ec_prime_i15(void)
 {
@@ -1088,6 +1114,32 @@ test_speed_ec_c25519_m31(void)
                &br_ec_c25519_m31, &br_curve25519);
 }
 
                &br_ec_c25519_m31, &br_curve25519);
 }
 
+static void
+test_speed_ec_c25519_m62(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_c25519_m62_get();
+       if (ec != NULL) {
+               test_speed_ec_inner("EC c25519_m62", ec, &br_curve25519);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "EC c25519_m62");
+       }
+}
+
+static void
+test_speed_ec_c25519_m64(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_c25519_m64_get();
+       if (ec != NULL) {
+               test_speed_ec_inner("EC c25519_m64", ec, &br_curve25519);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "EC c25519_m64");
+       }
+}
+
 static void
 test_speed_ecdsa_inner(const char *name,
        const br_ec_impl *impl, const br_ec_curve_def *cd,
 static void
 test_speed_ecdsa_inner(const char *name,
        const br_ec_impl *impl, const br_ec_curve_def *cd,
@@ -1191,6 +1243,38 @@ test_speed_ecdsa_p256_m31(void)
                &br_ecdsa_i31_vrfy_asn1);
 }
 
                &br_ecdsa_i31_vrfy_asn1);
 }
 
+static void
+test_speed_ecdsa_p256_m62(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_p256_m62_get();
+       if (ec != NULL) {
+               test_speed_ecdsa_inner("ECDSA m62 P-256",
+                       ec, &br_secp256r1,
+                       &br_ecdsa_i31_sign_asn1,
+                       &br_ecdsa_i31_vrfy_asn1);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "ECDSA m62 P-256");
+       }
+}
+
+static void
+test_speed_ecdsa_p256_m64(void)
+{
+       const br_ec_impl *ec;
+
+       ec = br_ec_p256_m64_get();
+       if (ec != NULL) {
+               test_speed_ecdsa_inner("ECDSA m64 P-256",
+                       ec, &br_secp256r1,
+                       &br_ecdsa_i31_sign_asn1,
+                       &br_ecdsa_i31_vrfy_asn1);
+       } else {
+               printf("%-30s UNAVAILABLE\n", "ECDSA m64 P-256");
+       }
+}
+
 static void
 test_speed_ecdsa_i15(void)
 {
 static void
 test_speed_ecdsa_i15(void)
 {
@@ -1602,12 +1686,18 @@ static const struct {
        STU(ec_prime_i31),
        STU(ec_p256_m15),
        STU(ec_p256_m31),
        STU(ec_prime_i31),
        STU(ec_p256_m15),
        STU(ec_p256_m31),
+       STU(ec_p256_m62),
+       STU(ec_p256_m64),
        STU(ec_c25519_i15),
        STU(ec_c25519_i31),
        STU(ec_c25519_m15),
        STU(ec_c25519_m31),
        STU(ec_c25519_i15),
        STU(ec_c25519_i31),
        STU(ec_c25519_m15),
        STU(ec_c25519_m31),
+       STU(ec_c25519_m62),
+       STU(ec_c25519_m64),
        STU(ecdsa_p256_m15),
        STU(ecdsa_p256_m31),
        STU(ecdsa_p256_m15),
        STU(ecdsa_p256_m31),
+       STU(ecdsa_p256_m62),
+       STU(ecdsa_p256_m64),
        STU(ecdsa_i15),
        STU(ecdsa_i31),
 
        STU(ecdsa_i15),
        STU(ecdsa_i31),