Link namesotre to libgnunetgnsrecord too
[oweals/gnunet.git] / src / psycstore / psycstore_api.c
index 5b9bb7e89e919630821b026a3863e8b077bd6490..02f29ecb1ef376e225cf877982c83385791ff4d6 100644 (file)
@@ -37,7 +37,7 @@
 
 typedef void (*DataCallback) ();
 
-/** 
+/**
  * Handle for an operation with the PSYCstore service.
  */
 struct GNUNET_PSYCSTORE_OperationHandle
@@ -162,9 +162,9 @@ get_next_op_id (struct GNUNET_PSYCSTORE_Handle *h)
 }
 
 
-/** 
+/**
  * Find operation by ID.
- * 
+ *
  * @return OperationHandle if found, or NULL otherwise.
  */
 static struct GNUNET_PSYCSTORE_OperationHandle *
@@ -188,8 +188,7 @@ find_op_by_id (struct GNUNET_PSYCSTORE_Handle *h, uint32_t op_id)
  * @param tc scheduler context
  */
 static void
-reconnect (void *cls,
-          const struct GNUNET_SCHEDULER_TaskContext *tc);
+reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
 
 
 /**
@@ -239,18 +238,15 @@ transmit_next (struct GNUNET_PSYCSTORE_Handle *h);
  * @param msg message received, NULL on timeout or fatal error
  */
 static void
-message_handler (void *cls,
-                const struct GNUNET_MessageHeader *msg)
+message_handler (void *cls, const struct GNUNET_MessageHeader *msg)
 {
   struct GNUNET_PSYCSTORE_Handle *h = cls;
   struct GNUNET_PSYCSTORE_OperationHandle *op;
   const struct OperationResult *opres;
-  const struct MasterCountersResult *mcres;
-  const struct SlaveCountersResult *scres;
+  const struct CountersResult *cres;
   const struct FragmentResult *fres;
   const struct StateResult *sres;
   const char *str;
-  uint16_t size;
 
   if (NULL == msg)
   {
@@ -260,8 +256,9 @@ message_handler (void *cls,
   LOG (GNUNET_ERROR_TYPE_DEBUG,
        "Received message of type %d from PSYCstore service\n",
        ntohs (msg->type));
-  size = ntohs (msg->size);
-  switch (ntohs (msg->type))
+  uint16_t size = ntohs (msg->size);
+  uint16_t type = ntohs (msg->type);
+  switch (type)
   {
   case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_CODE:
     if (size < sizeof (struct OperationResult))
@@ -269,7 +266,7 @@ message_handler (void *cls,
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received message of type %d with length %lu bytes. "
            "Expected >= %lu\n",
-           ntohs (msg->type), size, sizeof (struct OperationResult));
+           type, size, sizeof (struct OperationResult));
       GNUNET_break (0);
       reschedule_connect (h);
       return;
@@ -291,8 +288,9 @@ message_handler (void *cls,
     if (NULL == op)
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received result of an unkown operation ID: %ld\n",
-           ntohl (opres->op_id));
+           "Received result message (type %d) "
+           "with an unknown operation ID: %ld\n",
+           type, ntohl (opres->op_id));
     }
     else
     {
@@ -323,67 +321,38 @@ message_handler (void *cls,
     }
     break;
 
-  case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS_MASTER:
-    if (size != sizeof (struct MasterCountersResult))
-    {
-      LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received message of type %d with length %lu bytes. "
-           "Expected %lu\n",
-           ntohs (msg->type), size, sizeof (struct MasterCountersResult));
-      GNUNET_break (0);
-      reschedule_connect (h);
-      return;
-    }
-
-    mcres = (const struct MasterCountersResult *) msg;
-
-    op = find_op_by_id (h, ntohl (mcres->op_id));
-    if (NULL == op)
-    {
-      LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received result of an unkown operation ID: %ld\n",
-           ntohl (mcres->op_id));
-    }
-    else
-    {
-      GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op);
-      if (NULL != op->data_cb)
-        ((GNUNET_PSYCSTORE_MasterCountersCallback)
-         op->data_cb) (op->cls,
-                       GNUNET_ntohll (mcres->fragment_id),
-                       GNUNET_ntohll (mcres->message_id),
-                       GNUNET_ntohll (mcres->group_generation));
-      GNUNET_free (op);
-    }
-    break;
-
-  case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS_SLAVE:
-    if (size != sizeof (struct SlaveCountersResult))
+  case GNUNET_MESSAGE_TYPE_PSYCSTORE_RESULT_COUNTERS:
+    if (size != sizeof (struct CountersResult))
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received message of type %d with length %lu bytes. "
            "Expected %lu\n",
-           ntohs (msg->type), size, sizeof (struct SlaveCountersResult));
+           type, size, sizeof (struct CountersResult));
       GNUNET_break (0);
       reschedule_connect (h);
       return;
     }
 
-    scres = (const struct SlaveCountersResult *) msg;
+    cres = (const struct CountersResult *) msg;
 
-    op = find_op_by_id (h, ntohl (scres->op_id));
+    op = find_op_by_id (h, ntohl (cres->op_id));
     if (NULL == op)
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received result of an unkown operation ID: %ld\n",
-           ntohl (scres->op_id));
+           "Received counters result message (type %d) "
+           "with an unknown operation ID: %ld\n",
+           ntohl (cres->op_id));
     }
     else
     {
       GNUNET_CONTAINER_DLL_remove (h->op_head, h->op_tail, op);
       if (NULL != op->data_cb)
-        ((GNUNET_PSYCSTORE_SlaveCountersCallback)
-         op->data_cb) (op->cls, GNUNET_ntohll (scres->max_known_msg_id));
+        ((GNUNET_PSYCSTORE_CountersCallback)
+         op->data_cb) (op->cls, ntohl (cres->result_code),
+                       GNUNET_ntohll (cres->max_fragment_id),
+                       GNUNET_ntohll (cres->max_message_id),
+                       GNUNET_ntohll (cres->max_group_generation),
+                       GNUNET_ntohll (cres->max_state_message_id));
       GNUNET_free (op);
     }
     break;
@@ -394,7 +363,7 @@ message_handler (void *cls,
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received message of type %d with length %lu bytes. "
            "Expected >= %lu\n",
-           ntohs (msg->type), size, sizeof (struct FragmentResult));
+           type, size, sizeof (struct FragmentResult));
       GNUNET_break (0);
       reschedule_connect (h);
       return;
@@ -408,7 +377,7 @@ message_handler (void *cls,
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received message of type %d with length %lu bytes. "
            "Expected = %lu\n",
-           ntohs (msg->type), size,
+           type, size,
            sizeof (struct FragmentResult) + ntohs (mmsg->header.size));
       GNUNET_break (0);
       reschedule_connect (h);
@@ -419,8 +388,9 @@ message_handler (void *cls,
     if (NULL == op)
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received result of an unkown operation ID: %ld\n",
-           ntohl (fres->op_id));
+           "Received fragment result message (type %d) "
+           "with an unknown operation ID: %ld\n",
+           type, ntohl (fres->op_id));
     }
     else
     {
@@ -436,7 +406,7 @@ message_handler (void *cls,
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received message of type %d with length %lu bytes. "
            "Expected >= %lu\n",
-           ntohs (msg->type), size, sizeof (struct StateResult));
+           type, size, sizeof (struct StateResult));
       GNUNET_break (0);
       reschedule_connect (h);
       return;
@@ -450,7 +420,7 @@ message_handler (void *cls,
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
            "Received state result message (type %d) with invalid name.\n",
-           ntohs (msg->type), name_size, name);
+           type);
       GNUNET_break (0);
       reschedule_connect (h);
       return;
@@ -460,14 +430,15 @@ message_handler (void *cls,
     if (NULL == op)
     {
       LOG (GNUNET_ERROR_TYPE_ERROR,
-           "Received result of an unkown operation ID: %ld\n",
-           ntohl (sres->op_id));
+           "Received state result message (type %d) "
+           "with an unknown operation ID: %ld\n",
+           type, ntohl (sres->op_id));
     }
     else
     {
       if (NULL != op->data_cb)
         ((GNUNET_PSYCSTORE_StateCallback)
-         op->data_cb) (op->cls, name, (void *) &sres[1] + name_size,
+         op->data_cb) (op->cls, name, (char *) &sres[1] + name_size,
                        ntohs (sres->header.size) - sizeof (*sres) - name_size);
     }
     break;
@@ -590,9 +561,8 @@ reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 struct GNUNET_PSYCSTORE_Handle *
 GNUNET_PSYCSTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg)
 {
-  struct GNUNET_PSYCSTORE_Handle *h;
-
-  h = GNUNET_new (struct GNUNET_PSYCSTORE_Handle);
+  struct GNUNET_PSYCSTORE_Handle *h
+    = GNUNET_new (struct GNUNET_PSYCSTORE_Handle);
   h->cfg = cfg;
   h->reconnect_delay = GNUNET_TIME_UNIT_ZERO;
   h->reconnect_task = GNUNET_SCHEDULER_add_now (&reconnect, h);
@@ -609,7 +579,6 @@ void
 GNUNET_PSYCSTORE_disconnect (struct GNUNET_PSYCSTORE_Handle *h)
 {
   GNUNET_assert (NULL != h);
-  GNUNET_assert (h->op_head == h->op_tail);
   if (h->reconnect_task != GNUNET_SCHEDULER_NO_TASK)
   {
     GNUNET_SCHEDULER_cancel (h->reconnect_task);
@@ -665,7 +634,7 @@ GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op)
 }
 
 
-/** 
+/**
  * Store join/leave events for a PSYC channel in order to be able to answer
  * membership test queries later.
  *
@@ -686,8 +655,8 @@ GNUNET_PSYCSTORE_operation_cancel (struct GNUNET_PSYCSTORE_OperationHandle *op)
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                    int did_join,
                                    uint64_t announced_at,
                                    uint64_t effective_since,
@@ -730,7 +699,7 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Test if a member was admitted to the channel at the given message ID.
  *
  * This is useful when relaying and replaying messages to check if a particular
@@ -752,8 +721,8 @@ GNUNET_PSYCSTORE_membership_store (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                  const struct GNUNET_CRYPTO_EccPublicSignKey *slave_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                                  const struct GNUNET_CRYPTO_EddsaPublicKey *slave_key,
                                   uint64_t message_id,
                                   uint64_t group_generation,
                                   GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -785,7 +754,7 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Store a message fragment sent to a channel.
  *
  * @param h Handle for the PSYCstore.
@@ -795,12 +764,12 @@ GNUNET_PSYCSTORE_membership_test (struct GNUNET_PSYCSTORE_Handle *h,
  *        state modifiers.
  * @param rcb Callback to call with the result of the operation.
  * @param rcb_cls Closure for the callback.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
-                                 const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                 const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                  const struct GNUNET_MULTICAST_MessageHeader *message,
                                  uint32_t psycstore_flags,
                                  GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -832,7 +801,7 @@ GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Retrieve a message fragment by fragment ID.
  *
  * @param h Handle for the PSYCstore.
@@ -841,12 +810,12 @@ GNUNET_PSYCSTORE_fragment_store (struct GNUNET_PSYCSTORE_Handle *h,
  * @param fcb Callback to call with the retrieved fragments.
  * @param rcb Callback to call with the result of the operation.
  * @param cls Closure for the callbacks.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t fragment_id,
                                GNUNET_PSYCSTORE_FragmentCallback fcb,
                                GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -877,7 +846,7 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Retrieve all fragments of a message.
  *
  * @param h Handle for the PSYCstore.
@@ -886,12 +855,12 @@ GNUNET_PSYCSTORE_fragment_get (struct GNUNET_PSYCSTORE_Handle *h,
  * @param fcb Callback to call with the retrieved fragments.
  * @param rcb Callback to call with the result of the operation.
  * @param cls Closure for the callbacks.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                              const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                               uint64_t message_id,
                               GNUNET_PSYCSTORE_FragmentCallback fcb,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -922,7 +891,7 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Retrieve a fragment of message specified by its message ID and fragment
  * offset.
  *
@@ -933,12 +902,12 @@ GNUNET_PSYCSTORE_message_get (struct GNUNET_PSYCSTORE_Handle *h,
  * @param fcb Callback to call with the retrieved fragments.
  * @param rcb Callback to call with the result of the operation.
  * @param cls Closure for the callbacks.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
-                                       const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                       const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                        uint64_t message_id,
                                        uint64_t fragment_offset,
                                        GNUNET_PSYCSTORE_FragmentCallback fcb,
@@ -971,7 +940,7 @@ GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Retrieve latest values of counters for a channel master.
  *
  * The current value of counters are needed when a channel master is restarted,
@@ -981,68 +950,25 @@ GNUNET_PSYCSTORE_message_get_fragment (struct GNUNET_PSYCSTORE_Handle *h,
  * @param channel_key Public key that identifies the channel.
  * @param mccb Callback to call with the result.
  * @param mccb_cls Closure for the callback.
- * 
- * @return Handle that can be used to cancel the operation.
- */
-struct GNUNET_PSYCSTORE_OperationHandle *
-GNUNET_PSYCSTORE_counters_get_master (struct GNUNET_PSYCSTORE_Handle *h,
-                                      struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                      GNUNET_PSYCSTORE_MasterCountersCallback mccb,
-                                      void *mccb_cls)
-{
-  struct OperationRequest *req;
-  struct GNUNET_PSYCSTORE_OperationHandle *op
-    = GNUNET_malloc (sizeof (*op) + sizeof (*req));
-  op->h = h;
-  op->data_cb = mccb;
-  op->cls = mccb_cls;
-
-  req = (struct OperationRequest *) &op[1];
-  op->msg = (struct GNUNET_MessageHeader *) req;
-  req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET_MASTER);
-  req->header.size = htons (sizeof (*req));
-  req->channel_key = *channel_key;
-
-  op->op_id = get_next_op_id (h);
-  req->op_id = htonl (op->op_id);
-
-  GNUNET_CONTAINER_DLL_insert_tail (h->transmit_head, h->transmit_tail, op);
-  transmit_next (h);
-
-  return op;
-}
-
-
-
-/** 
- * Retrieve latest values of counters for a channel slave.
- *
- * The current value of counters are needed when a channel slave rejoins
- * and starts the state synchronization process.
  *
- * @param h Handle for the PSYCstore.
- * @param channel_key Public key that identifies the channel.
- * @param sccb Callback to call with the result.
- * @param sccb_cls Closure for the callback.
- * 
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
-GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h,
-                                     struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
-                                     GNUNET_PSYCSTORE_SlaveCountersCallback sccb,
-                                     void *sccb_cls)
+GNUNET_PSYCSTORE_counters_get (struct GNUNET_PSYCSTORE_Handle *h,
+                               struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
+                               GNUNET_PSYCSTORE_CountersCallback ccb,
+                               void *mccb_cls)
 {
   struct OperationRequest *req;
   struct GNUNET_PSYCSTORE_OperationHandle *op
     = GNUNET_malloc (sizeof (*op) + sizeof (*req));
   op->h = h;
-  op->data_cb = sccb;
-  op->cls = sccb_cls;
+  op->data_cb = ccb;
+  op->cls = mccb_cls;
 
   req = (struct OperationRequest *) &op[1];
   op->msg = (struct GNUNET_MessageHeader *) req;
-  req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET_SLAVE);
+  req->header.type = htons (GNUNET_MESSAGE_TYPE_PSYCSTORE_COUNTERS_GET);
   req->header.size = htons (sizeof (*req));
   req->channel_key = *channel_key;
 
@@ -1056,7 +982,7 @@ GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Apply modifiers of a message to the current channel state.
  *
  * An error is returned if there are missing messages containing state
@@ -1070,12 +996,12 @@ GNUNET_PSYCSTORE_counters_get_slave (struct GNUNET_PSYCSTORE_Handle *h,
  * @param modifiers List of modifiers to apply.
  * @param rcb Callback to call with the result of the operation.
  * @param rcb_cls Closure for the callback.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
-                               const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                               const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                uint64_t message_id,
                                uint64_t state_delta,
                                size_t modifier_count,
@@ -1114,7 +1040,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
       : 0;
 
     memcpy (&req[1], modifiers[i].name, name_size);
-    memcpy ((void *) &req[1] + name_size, modifiers[i].value, modifiers[i].value_size);
+    memcpy ((char *) &req[1] + name_size, modifiers[i].value, modifiers[i].value_size);
 
     op->op_id = get_next_op_id (h);
     req->op_id = htonl (op->op_id);
@@ -1129,7 +1055,7 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Store synchronized state.
  *
  * @param h Handle for the PSYCstore.
@@ -1139,12 +1065,12 @@ GNUNET_PSYCSTORE_state_modify (struct GNUNET_PSYCSTORE_Handle *h,
  * @param modifiers Full state to store.
  * @param rcb Callback to call with the result of the operation.
  * @param rcb_cls Closure for the callback.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
-                             const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                             const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                              uint64_t message_id,
                              size_t modifier_count,
                              const struct GNUNET_ENV_Modifier *modifiers,
@@ -1180,7 +1106,7 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
       : 0;
 
     memcpy (&req[1], modifiers[i].name, name_size);
-    memcpy ((void *) &req[1] + name_size, modifiers[i].value, modifiers[i].value_size);
+    memcpy ((char *) &req[1] + name_size, modifiers[i].value, modifiers[i].value_size);
 
     op->op_id = get_next_op_id (h);
     req->op_id = htonl (op->op_id);
@@ -1192,7 +1118,7 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Reset the state of a channel.
  *
  * Delete all state variables stored for the given channel.
@@ -1201,12 +1127,12 @@ GNUNET_PSYCSTORE_state_sync (struct GNUNET_PSYCSTORE_Handle *h,
  * @param channel_key The channel we are interested in.
  * @param rcb Callback to call with the result of the operation.
  * @param rcb_cls Closure for the callback.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
-                              const struct GNUNET_CRYPTO_EccPublicSignKey
+                              const struct GNUNET_CRYPTO_EddsaPublicKey
                               *channel_key,
                               GNUNET_PSYCSTORE_ResultCallback rcb,
                               void *rcb_cls)
@@ -1235,7 +1161,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
 
 
 
-/** 
+/**
  * Update signed values of state variables in the state store.
  *
  * @param h Handle for the PSYCstore.
@@ -1248,7 +1174,7 @@ GNUNET_PSYCSTORE_state_reset (struct GNUNET_PSYCSTORE_Handle *h,
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
-                                    const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                    const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                     uint64_t message_id,
                                     const struct GNUNET_HashCode *hash,
                                     GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -1278,7 +1204,7 @@ GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
 }
 
 
-/** 
+/**
  * Retrieve the best matching state variable.
  *
  * @param h Handle for the PSYCstore.
@@ -1287,12 +1213,12 @@ GNUNET_PSYCSTORE_state_hash_update (struct GNUNET_PSYCSTORE_Handle *h,
  * @param scb Callback to return the matching state variable.
  * @param rcb Callback to call with the result of the operation.
  * @param cls Closure for the callbacks.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
-                            const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                            const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                             const char *name,
                             GNUNET_PSYCSTORE_StateCallback scb,
                             GNUNET_PSYCSTORE_ResultCallback rcb,
@@ -1325,7 +1251,7 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
 
 
 
-/** 
+/**
  * Retrieve all state variables for a channel with the given prefix.
  *
  * @param h Handle for the PSYCstore.
@@ -1334,12 +1260,12 @@ GNUNET_PSYCSTORE_state_get (struct GNUNET_PSYCSTORE_Handle *h,
  * @param scb Callback to return matching state variables.
  * @param rcb Callback to call with the result of the operation.
  * @param cls Closure for the callbacks.
- * 
+ *
  * @return Handle that can be used to cancel the operation.
  */
 struct GNUNET_PSYCSTORE_OperationHandle *
 GNUNET_PSYCSTORE_state_get_prefix (struct GNUNET_PSYCSTORE_Handle *h,
-                                   const struct GNUNET_CRYPTO_EccPublicSignKey *channel_key,
+                                   const struct GNUNET_CRYPTO_EddsaPublicKey *channel_key,
                                    const char *name_prefix,
                                    GNUNET_PSYCSTORE_StateCallback scb,
                                    GNUNET_PSYCSTORE_ResultCallback rcb,