aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_ecc_gnsrecord.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_ecc_gnsrecord.c')
-rw-r--r--src/util/crypto_ecc_gnsrecord.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/util/crypto_ecc_gnsrecord.c b/src/util/crypto_ecc_gnsrecord.c
index 59efff8ab..a78511105 100644
--- a/src/util/crypto_ecc_gnsrecord.c
+++ b/src/util/crypto_ecc_gnsrecord.c
@@ -114,8 +114,8 @@ GNUNET_CRYPTO_eddsa_sign_with_scalar (
114 * Calculate the derived zone key zk' from the 114 * Calculate the derived zone key zk' from the
115 * derived private scalar. 115 * derived private scalar.
116 */ 116 */
117 crypto_scalarmult_ed25519_base (zk, 117 crypto_scalarmult_ed25519_base_noclamp (zk,
118 sk); 118 sk);
119 119
120 /** 120 /**
121 * Calculate r: 121 * Calculate r:
@@ -352,7 +352,7 @@ GNUNET_CRYPTO_eddsa_private_key_derive (
352 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d); 352 GNUNET_CRYPTO_mpi_print_unsigned (dc, sizeof(dc), d);
353 /** 353 /**
354 * Note that we copy all of SHA512(d) into the result and 354 * Note that we copy all of SHA512(d) into the result and
355 * then overrwrite the derived private scalar. 355 * then overwrite the derived private scalar.
356 * This means that we re-use SHA512(d)[32..63] 356 * This means that we re-use SHA512(d)[32..63]
357 * FIXME: Do we want to derive this part as well?? 357 * FIXME: Do we want to derive this part as well??
358 */ 358 */
@@ -420,3 +420,21 @@ GNUNET_CRYPTO_eddsa_public_key_derive (
420 gcry_ctx_release (ctx); 420 gcry_ctx_release (ctx);
421 421
422} 422}
423
424
425void
426GNUNET_CRYPTO_eddsa_key_get_public_from_scalar (
427 const struct GNUNET_CRYPTO_EddsaPrivateScalar *priv,
428 struct GNUNET_CRYPTO_EddsaPublicKey *pkey)
429{
430 unsigned char sk[32];
431
432 memcpy (sk, priv->s, 32);
433
434 /**
435 * Calculate the derived zone key zk' from the
436 * derived private scalar.
437 */
438 crypto_scalarmult_ed25519_base_noclamp (pkey->q_y,
439 sk);
440}