]> git.xonotic.org Git - xonotic/d0_blind_id.git/blobdiff - main.c
separate RSA modulus from DL modulus; we still need the RSA modulus to generate the...
[xonotic/d0_blind_id.git] / main.c
diff --git a/main.c b/main.c
index 50197e6e4cfb919a0edc98b41c6d25de383fd5b7..5da16d066629c4bdfdd085e38f8ef66288f1691d 100644 (file)
--- a/main.c
+++ b/main.c
@@ -53,13 +53,24 @@ int main(int argc, char **argv)
        ctx_self = d0_blind_id_new();
        ctx_other = d0_blind_id_new();
 
-       if(!d0_blind_id_generate_private_keys(ctx_self, 1024))
+       printf("keygen RSA...\n");
+       if(!d0_blind_id_generate_private_key(ctx_self, 1024))
                errx(1, "keygen fail");
-       bufsize = sizeof(buf); if(!d0_blind_id_write_public_keys(ctx_self, buf, &bufsize))
+       bufsize = sizeof(buf); if(!d0_blind_id_write_public_key(ctx_self, buf, &bufsize))
                errx(2, "writepub fail");
-       if(!d0_blind_id_read_public_keys(ctx_other, buf, bufsize))
+       if(!d0_blind_id_read_public_key(ctx_other, buf, bufsize))
                errx(3, "readpub fail");
 
+       printf("keygen modulus...\n");
+       if(!d0_blind_id_generate_private_id_modulus(ctx_other))
+               errx(1, "keygen fail");
+       /*
+       bufsize = sizeof(buf); if(!d0_blind_id_write_private_id_modulus(ctx_other, buf, &bufsize))
+               errx(2, "writepub fail");
+       if(!d0_blind_id_read_private_id_modulus(ctx_self, buf, bufsize))
+               errx(3, "readpub fail");
+       */
+
        signal(SIGINT, mysignal);
 
        int n = 0;
@@ -100,10 +111,10 @@ int main(int argc, char **argv)
        while(!quit)
        {
                bench(&bench_auth);
-               bufsize = sizeof(buf); if(!d0_blind_id_authenticate_with_private_id_start(ctx_other, 1, "hello world", 11, buf, &bufsize))
+               bufsize = sizeof(buf); if(!d0_blind_id_authenticate_with_private_id_start(ctx_other, 1, 1, "hello world", 11, buf, &bufsize))
                        errx(9, "start fail");
                bench(&bench_chall);
-               buf2size = sizeof(buf2); if(!d0_blind_id_authenticate_with_private_id_challenge(ctx_self, 1, buf, bufsize, buf2, &buf2size, NULL))
+               buf2size = sizeof(buf2); if(!d0_blind_id_authenticate_with_private_id_challenge(ctx_self, 1, 1, buf, bufsize, buf2, &buf2size, NULL))
                        errx(10, "challenge fail");
                bench(&bench_resp);
                bufsize = sizeof(buf); if(!d0_blind_id_authenticate_with_private_id_response(ctx_other, buf2, buf2size, buf, &bufsize))