-use valid ECC keys for testing
[oweals/gnunet.git] / src / gns / test_gns_simple_shorten.c
index c6d49f82f6d25a0febf894d8f3da4dcf957cc3a9..9b61a41c833bcc2d49d83c10f484a5d81fe3106c 100644 (file)
@@ -61,10 +61,10 @@ static struct GNUNET_GNS_Handle *gns_handle;
 
 const struct GNUNET_CONFIGURATION_Handle *cfg;
 
-struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded priv_pkey;
-struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded short_pkey;
-struct GNUNET_CRYPTO_RsaPrivateKey *priv_key;
-struct GNUNET_CRYPTO_RsaPrivateKey *short_key;
+struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded priv_pkey;
+struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded short_pkey;
+struct GNUNET_CRYPTO_EccPrivateKey *priv_key;
+struct GNUNET_CRYPTO_EccPrivateKey *short_key;
 
 struct GNUNET_CRYPTO_ShortHashCode priv_zone;
 struct GNUNET_CRYPTO_ShortHashCode short_zone;
@@ -170,15 +170,15 @@ void do_check (void *cls,
               const struct GNUNET_CONFIGURATION_Handle *ccfg,
               struct GNUNET_TESTING_Peer *peer)
 {
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded our_pkey;
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded alice_pkey;
-  struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded bob_pkey;
-  struct GNUNET_CRYPTO_RsaPrivateKey *our_key;
-  struct GNUNET_CRYPTO_RsaPrivateKey *alice_key;
-  struct GNUNET_CRYPTO_RsaPrivateKey *bob_key;
+  struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded our_pkey;
+  struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded alice_pkey;
+  struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded bob_pkey;
+  struct GNUNET_CRYPTO_EccPrivateKey *our_key;
+  struct GNUNET_CRYPTO_EccPrivateKey *alice_key;
+  struct GNUNET_CRYPTO_EccPrivateKey *bob_key;
   struct GNUNET_CRYPTO_ShortHashCode bob_hash;
   struct GNUNET_CRYPTO_ShortHashCode alice_hash;
-  struct GNUNET_CRYPTO_RsaSignature *sig;
+  struct GNUNET_CRYPTO_EccSignature *sig;
   char* our_keyfile;
   char* private_keyfile;
   char* shorten_keyfile;
@@ -226,22 +226,22 @@ void do_check (void *cls,
     return;
   }
 
-  our_key = GNUNET_CRYPTO_rsa_key_create_from_file (our_keyfile);
+  our_key = GNUNET_CRYPTO_ecc_key_create_from_file (our_keyfile);
   GNUNET_free(our_keyfile);
 
-  bob_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_BOB);
-  alice_key = GNUNET_CRYPTO_rsa_key_create_from_file (KEYFILE_ALICE);
-  priv_key = GNUNET_CRYPTO_rsa_key_create_from_file (private_keyfile);
-  short_key = GNUNET_CRYPTO_rsa_key_create_from_file (shorten_keyfile);
+  bob_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_BOB);
+  alice_key = GNUNET_CRYPTO_ecc_key_create_from_file (KEYFILE_ALICE);
+  priv_key = GNUNET_CRYPTO_ecc_key_create_from_file (private_keyfile);
+  short_key = GNUNET_CRYPTO_ecc_key_create_from_file (shorten_keyfile);
 
   GNUNET_free(shorten_keyfile);
   GNUNET_free(private_keyfile);
   
-  GNUNET_CRYPTO_rsa_key_get_public (our_key, &our_pkey);
-  GNUNET_CRYPTO_rsa_key_get_public (alice_key, &alice_pkey);
-  GNUNET_CRYPTO_rsa_key_get_public (bob_key, &bob_pkey);
-  GNUNET_CRYPTO_rsa_key_get_public (priv_key, &priv_pkey);
-  GNUNET_CRYPTO_rsa_key_get_public (short_key, &short_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (our_key, &our_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (alice_key, &alice_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (bob_key, &bob_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (priv_key, &priv_pkey);
+  GNUNET_CRYPTO_ecc_key_get_public (short_key, &short_pkey);
 
   GNUNET_CRYPTO_short_hash(&priv_pkey, sizeof(priv_pkey), &priv_zone);
   GNUNET_CRYPTO_short_hash(&short_pkey, sizeof(short_pkey), &short_zone);
@@ -318,11 +318,11 @@ void do_check (void *cls,
                                NULL);
 
   GNUNET_free(web);
-  GNUNET_CRYPTO_rsa_key_free(our_key);
-  GNUNET_CRYPTO_rsa_key_free(bob_key);
-  GNUNET_CRYPTO_rsa_key_free(alice_key);
-  GNUNET_CRYPTO_rsa_key_free(priv_key);
-  GNUNET_CRYPTO_rsa_key_free(short_key);
+  GNUNET_CRYPTO_ecc_key_free(our_key);
+  GNUNET_CRYPTO_ecc_key_free(bob_key);
+  GNUNET_CRYPTO_ecc_key_free(alice_key);
+  GNUNET_CRYPTO_ecc_key_free(priv_key);
+  GNUNET_CRYPTO_ecc_key_free(short_key);
 
 }