diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-05-29 08:18:55 +0000 |
commit | 022002438e4047d235a688cfd9da7b63ab990103 (patch) | |
tree | 8d0cb444a3ab376b5a8f614fb87bdeb31e7b3327 /src/namestore/test_plugin_namestore.c | |
parent | b62eb443ee3af84f87030fad9fd11a948b1a2503 (diff) | |
download | gnunet-022002438e4047d235a688cfd9da7b63ab990103.tar.gz gnunet-022002438e4047d235a688cfd9da7b63ab990103.zip |
-switching GNS from RSA to ECC
Diffstat (limited to 'src/namestore/test_plugin_namestore.c')
-rw-r--r-- | src/namestore/test_plugin_namestore.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/namestore/test_plugin_namestore.c b/src/namestore/test_plugin_namestore.c index ea0bc781c..b7d2341e4 100644 --- a/src/namestore/test_plugin_namestore.c +++ b/src/namestore/test_plugin_namestore.c | |||
@@ -95,19 +95,19 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
95 | */ | 95 | */ |
96 | static void | 96 | static void |
97 | test_record (void *cls, | 97 | test_record (void *cls, |
98 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *zone_key, | 98 | const struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded *zone_key, |
99 | struct GNUNET_TIME_Absolute expire, | 99 | struct GNUNET_TIME_Absolute expire, |
100 | const char *name, | 100 | const char *name, |
101 | unsigned int rd_count, | 101 | unsigned int rd_count, |
102 | const struct GNUNET_NAMESTORE_RecordData *rd, | 102 | const struct GNUNET_NAMESTORE_RecordData *rd, |
103 | const struct GNUNET_CRYPTO_RsaSignature *signature) | 103 | const struct GNUNET_CRYPTO_EccSignature *signature) |
104 | { | 104 | { |
105 | int *idp = cls; | 105 | int *idp = cls; |
106 | int id = *idp; | 106 | int id = *idp; |
107 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded tzone_key; | 107 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded tzone_key; |
108 | char tname[64]; | 108 | char tname[64]; |
109 | unsigned int trd_count = 1 + (id % 1024); | 109 | unsigned int trd_count = 1 + (id % 1024); |
110 | struct GNUNET_CRYPTO_RsaSignature tsignature; | 110 | struct GNUNET_CRYPTO_EccSignature tsignature; |
111 | unsigned int i; | 111 | unsigned int i; |
112 | 112 | ||
113 | GNUNET_snprintf (tname, sizeof (tname), | 113 | GNUNET_snprintf (tname, sizeof (tname), |
@@ -122,8 +122,8 @@ test_record (void *cls, | |||
122 | memset (&tzone_key, (id % 241), sizeof (tzone_key)); | 122 | memset (&tzone_key, (id % 241), sizeof (tzone_key)); |
123 | memset (&tsignature, (id % 243), sizeof (tsignature)); | 123 | memset (&tsignature, (id % 243), sizeof (tsignature)); |
124 | GNUNET_assert (0 == strcmp (name, tname)); | 124 | GNUNET_assert (0 == strcmp (name, tname)); |
125 | GNUNET_assert (0 == memcmp (&tzone_key, zone_key, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))); | 125 | GNUNET_assert (0 == memcmp (&tzone_key, zone_key, sizeof (struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded))); |
126 | GNUNET_assert (0 == memcmp (&tsignature, signature, sizeof (struct GNUNET_CRYPTO_RsaSignature))); | 126 | GNUNET_assert (0 == memcmp (&tsignature, signature, sizeof (struct GNUNET_CRYPTO_EccSignature))); |
127 | } | 127 | } |
128 | 128 | ||
129 | 129 | ||
@@ -139,12 +139,12 @@ get_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | |||
139 | static void | 139 | static void |
140 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) | 140 | put_record (struct GNUNET_NAMESTORE_PluginFunctions *nsp, int id) |
141 | { | 141 | { |
142 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 142 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded zone_key; |
143 | struct GNUNET_TIME_Absolute expire; | 143 | struct GNUNET_TIME_Absolute expire; |
144 | char name[64]; | 144 | char name[64]; |
145 | unsigned int rd_count = 1 + (id % 1024); | 145 | unsigned int rd_count = 1 + (id % 1024); |
146 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; | 146 | struct GNUNET_NAMESTORE_RecordData rd[rd_count]; |
147 | struct GNUNET_CRYPTO_RsaSignature signature; | 147 | struct GNUNET_CRYPTO_EccSignature signature; |
148 | unsigned int i; | 148 | unsigned int i; |
149 | 149 | ||
150 | GNUNET_snprintf (name, sizeof (name), | 150 | GNUNET_snprintf (name, sizeof (name), |
@@ -175,7 +175,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
175 | const struct GNUNET_CONFIGURATION_Handle *cfg) | 175 | const struct GNUNET_CONFIGURATION_Handle *cfg) |
176 | { | 176 | { |
177 | struct GNUNET_NAMESTORE_PluginFunctions *nsp; | 177 | struct GNUNET_NAMESTORE_PluginFunctions *nsp; |
178 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded zone_key; | 178 | struct GNUNET_CRYPTO_EccPublicKeyBinaryEncoded zone_key; |
179 | struct GNUNET_CRYPTO_ShortHashCode zone; | 179 | struct GNUNET_CRYPTO_ShortHashCode zone; |
180 | 180 | ||
181 | ok = 0; | 181 | ok = 0; |