[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r36318 - in gnunet/src: include util
From: |
gnunet |
Subject: |
[GNUnet-SVN] r36318 - in gnunet/src: include util |
Date: |
Sat, 5 Sep 2015 19:44:50 +0200 |
Author: grothoff
Date: 2015-09-05 19:44:50 +0200 (Sat, 05 Sep 2015)
New Revision: 36318
Modified:
gnunet/src/include/gnunet_applications.h
gnunet/src/include/gnunet_crypto_lib.h
gnunet/src/include/gnunet_protocols.h
gnunet/src/util/crypto_ecc_dlog.c
Log:
add GNUNET_CRYPTO_ecc_pmul_mpi
Modified: gnunet/src/include/gnunet_applications.h
===================================================================
--- gnunet/src/include/gnunet_applications.h 2015-09-05 17:02:45 UTC (rev
36317)
+++ gnunet/src/include/gnunet_applications.h 2015-09-05 17:44:50 UTC (rev
36318)
@@ -116,6 +116,10 @@
*/
#define GNUNET_APPLICATION_TYPE_MULTICAST 26
+/**
+ * Vectorproduct, ECC variant. Used for two-peer scalarproduct operations
+ */
+#define GNUNET_APPLICATION_TYPE_SCALARPRODUCT_ECC 27
#if 0 /* keep Emacsens' auto-indent happy */
{
Modified: gnunet/src/include/gnunet_crypto_lib.h
===================================================================
--- gnunet/src/include/gnunet_crypto_lib.h 2015-09-05 17:02:45 UTC (rev
36317)
+++ gnunet/src/include/gnunet_crypto_lib.h 2015-09-05 17:44:50 UTC (rev
36318)
@@ -1358,6 +1358,21 @@
/**
+ * Multiply the point @a p on the elliptic curve by @a val.
+ *
+ * @param edc calculation context for ECC operations
+ * @param p point to multiply
+ * @param val (positive) value to encode into a point
+ * @return representation of the value as an ECC point,
+ * must be freed using #GNUNET_CRYPTO_ecc_free()
+ */
+gcry_mpi_point_t
+GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
+ gcry_mpi_point_t p,
+ gcry_mpi_t val);
+
+
+/**
* Convert point value to binary representation.
*
* @param edc calculation context for ECC operations
Modified: gnunet/src/include/gnunet_protocols.h
===================================================================
--- gnunet/src/include/gnunet_protocols.h 2015-09-05 17:02:45 UTC (rev
36317)
+++ gnunet/src/include/gnunet_protocols.h 2015-09-05 17:44:50 UTC (rev
36318)
@@ -2117,9 +2117,25 @@
*/
#define GNUNET_MESSAGE_TYPE_SCALARPRODUCT_RESULT 649
+/**
+ * Alice -> Bob ECC session initialization
+ */
+#define GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_SESSION_INITIALIZATION 650
+/**
+ * Alice -> Bob ECC crypto data
+ */
+#define GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_ALICE_CRYPTODATA 651
+/**
+ * Bob -> Alice ECC crypto data
+ */
+#define GNUNET_MESSAGE_TYPE_SCALARPRODUCT_ECC_BOB_CRYPTODATA 652
+
+
+
+
/*******************************************************************************
* PSYCSTORE message types
******************************************************************************/
@@ -2127,47 +2143,47 @@
/**
* Store a membership event.
*/
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_STORE 650
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_STORE 660
/**
* Test for membership of a member at a particular point in time.
*/
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_TEST 651
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MEMBERSHIP_TEST 661
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_STORE 652
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_STORE 662
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_GET 653
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_FRAGMENT_GET 663
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET 654
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET 664
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET_FRAGMENT 655
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_MESSAGE_GET_FRAGMENT 665
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET 656
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET 666
/* 657 */
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_MODIFY 658
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_MODIFY 668
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_SYNC 659
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_SYNC 669
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_RESET 660
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_RESET 670
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_HASH_UPDATE 661
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_HASH_UPDATE 671
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET 662
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET 672
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET_PREFIX 663
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_STATE_GET_PREFIX 673
/**
* Generic response from PSYCstore service with success and/or error message.
*/
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE 664
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE 674
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_FRAGMENT 665
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_FRAGMENT 675
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS 666
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS 676
-#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_STATE 667
+#define GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_STATE 677
/*******************************************************************************
Modified: gnunet/src/util/crypto_ecc_dlog.c
===================================================================
--- gnunet/src/util/crypto_ecc_dlog.c 2015-09-05 17:02:45 UTC (rev 36317)
+++ gnunet/src/util/crypto_ecc_dlog.c 2015-09-05 17:44:50 UTC (rev 36318)
@@ -407,6 +407,28 @@
/**
+ * Multiply the point @a p on the elliptic curve by @a val.
+ *
+ * @param edc calculation context for ECC operations
+ * @param p point to multiply
+ * @param val (positive) value to encode into a point
+ * @return representation of the value as an ECC point,
+ * must be freed using #GNUNET_CRYPTO_ecc_free()
+ */
+gcry_mpi_point_t
+GNUNET_CRYPTO_ecc_pmul_mpi (struct GNUNET_CRYPTO_EccDlogContext *edc,
+ gcry_mpi_point_t p,
+ gcry_mpi_t val)
+{
+ gcry_mpi_point_t r;
+
+ r = gcry_mpi_point_new (0);
+ gcry_mpi_ec_mul (r, val, p, edc->ctx);
+ return r;
+}
+
+
+/**
* Obtain a random point on the curve and its
* additive inverse. Both returned values
* must be freed using #GNUNET_CRYPTO_ecc_free().
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r36318 - in gnunet/src: include util,
gnunet <=