diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util/gnunet-crypto-tvg.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/util/gnunet-crypto-tvg.c b/src/util/gnunet-crypto-tvg.c index 0071f3e90..76c379784 100644 --- a/src/util/gnunet-crypto-tvg.c +++ b/src/util/gnunet-crypto-tvg.c | |||
@@ -1201,6 +1201,45 @@ output_vectors () | |||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | { | 1203 | { |
1204 | json_t *vec = vec_for (vecs, "edx25519_derive"); | ||
1205 | struct GNUNET_CRYPTO_Edx25519PrivateKey priv1_edx; | ||
1206 | struct GNUNET_CRYPTO_Edx25519PublicKey pub1_edx; | ||
1207 | struct GNUNET_CRYPTO_Edx25519PrivateKey priv2_edx; | ||
1208 | struct GNUNET_CRYPTO_Edx25519PublicKey pub2_edx; | ||
1209 | struct GNUNET_HashCode seed; | ||
1210 | |||
1211 | GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, | ||
1212 | &seed, | ||
1213 | sizeof (struct GNUNET_HashCode)); | ||
1214 | GNUNET_CRYPTO_edx25519_key_create (&priv1_edx); | ||
1215 | GNUNET_CRYPTO_edx25519_key_get_public (&priv1_edx, &pub1_edx); | ||
1216 | GNUNET_CRYPTO_edx25519_private_key_derive (&priv1_edx, | ||
1217 | &seed, | ||
1218 | sizeof (seed), | ||
1219 | &priv2_edx); | ||
1220 | GNUNET_CRYPTO_edx25519_public_key_derive (&pub1_edx, | ||
1221 | &seed, | ||
1222 | sizeof (seed), | ||
1223 | &pub2_edx); | ||
1224 | |||
1225 | d2j (vec, "priv1_edx", | ||
1226 | &priv1_edx, | ||
1227 | sizeof (struct GNUNET_CRYPTO_Edx25519PrivateKey)); | ||
1228 | d2j (vec, "pub1_edx", | ||
1229 | &pub1_edx, | ||
1230 | sizeof (struct GNUNET_CRYPTO_Edx25519PublicKey)); | ||
1231 | d2j (vec, "seed", | ||
1232 | &seed, | ||
1233 | sizeof (struct GNUNET_HashCode)); | ||
1234 | d2j (vec, "priv2_edx", | ||
1235 | &priv2_edx, | ||
1236 | sizeof (struct GNUNET_CRYPTO_Edx25519PrivateKey)); | ||
1237 | d2j (vec, "pub2_edx", | ||
1238 | &pub2_edx, | ||
1239 | sizeof (struct GNUNET_CRYPTO_Edx25519PublicKey)); | ||
1240 | } | ||
1241 | |||
1242 | { | ||
1204 | json_t *vec = vec_for (vecs, "rsa_blind_signing"); | 1243 | json_t *vec = vec_for (vecs, "rsa_blind_signing"); |
1205 | 1244 | ||
1206 | struct GNUNET_CRYPTO_RsaPrivateKey *skey; | 1245 | struct GNUNET_CRYPTO_RsaPrivateKey *skey; |