pkcs5: Add missing break statements when checking crypto primitives
[strongswan.git] / scripts / pubkey_speed.c
index 255f650..ba3ad1f 100644 (file)
@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <time.h>
 #include <library.h>
-#include <debug.h>
+#include <utils/debug.h>
 #include <credentials/keys/private_key.h>
 
 void start_timing(struct timespec *start)
@@ -58,7 +58,7 @@ int main(int argc, char *argv[])
        }
 
        library_init(NULL);
-       lib->plugins->load(lib->plugins, NULL, argv[1]);
+       lib->plugins->load(lib->plugins, argv[1]);
        atexit(library_deinit);
 
        keydata = chunk_create(buf, 0);
@@ -79,23 +79,23 @@ int main(int argc, char *argv[])
        {
                switch (private->get_keysize(private))
                {
-                       case 32:
+                       case 256:
                                scheme = SIGN_ECDSA_256;
                                break;
-                       case 48:
+                       case 384:
                                scheme = SIGN_ECDSA_384;
                                break;
-                       case 66:
+                       case 521:
                                scheme = SIGN_ECDSA_521;
                                break;
                        default:
                                printf("%d bit ECDSA private key size not supported",
-                                               private->get_keysize(private) * 8);
+                                               private->get_keysize(private));
                                exit(1);
                }
        }
 
-       printf("%4d bit %N: ", private->get_keysize(private)*8,
+       printf("%4d bit %N: ", private->get_keysize(private),
                key_type_names, type);
 
        sigs = malloc(sizeof(chunk_t) * rounds);