aboutsummaryrefslogtreecommitdiff
path: root/src/util/crypto_ecc_dlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_ecc_dlog.c')
-rw-r--r--src/util/crypto_ecc_dlog.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/util/crypto_ecc_dlog.c b/src/util/crypto_ecc_dlog.c
index 13ee1e6be..29cba3336 100644
--- a/src/util/crypto_ecc_dlog.c
+++ b/src/util/crypto_ecc_dlog.c
@@ -407,6 +407,28 @@ GNUNET_CRYPTO_ecc_add (struct GNUNET_CRYPTO_EccDlogContext *edc,
407 407
408 408
409/** 409/**
410 * Multiply the point @a p on the elliptic curve by @a val.
411 *
412 * @param edc calculation context for ECC operations
413 * @param p point to multiply
414 * @param val (positive) value to encode into a point
415 * @return representation of the value as an ECC point,
416 * must be freed using #GNUNET_CRYPTO_ecc_free()
417 */
418gcry_mpi_point_t
419GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
420 gcry_mpi_point_t p,
421 gcry_mpi_t val)
422{
423 gcry_mpi_point_t r;
424
425 r = gcry_mpi_point_new (0);
426 gcry_mpi_ec_mul (r, val, p, edc->ctx);
427 return r;
428}
429
430
431/**
410 * Obtain a random point on the curve and its 432 * Obtain a random point on the curve and its
411 * additive inverse. Both returned values 433 * additive inverse. Both returned values
412 * must be freed using #GNUNET_CRYPTO_ecc_free(). 434 * must be freed using #GNUNET_CRYPTO_ecc_free().