From 75cfa6370bc902765c26b50bb858c9a5bc1e8e48 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 18 Apr 2021 21:11:08 +0200 Subject: SCALARPRODUCT: migrating logic from libgcrypt to libsodium (#6818). --- src/scalarproduct/scalarproduct_api.c | 50 ++++++++++++++--------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'src/scalarproduct/scalarproduct_api.c') diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c index b2a90c222..4ac39614a 100644 --- a/src/scalarproduct/scalarproduct_api.c +++ b/src/scalarproduct/scalarproduct_api.c @@ -42,14 +42,10 @@ * @param status processing status code */ typedef void -(*GNUNET_SCALARPRODUCT_ResponseMessageHandler) (struct - GNUNET_SCALARPRODUCT_ComputationHandle - *h, - const struct - ClientResponseMessage *msg, - enum - GNUNET_SCALARPRODUCT_ResponseStatus - status); +(*GNUNET_SCALARPRODUCT_ResponseMessageHandler) ( + struct GNUNET_SCALARPRODUCT_ComputationHandle *h, + const struct ClientResponseMessage *msg, + enum GNUNET_SCALARPRODUCT_ResponseStatus status); /** @@ -172,13 +168,12 @@ check_unique (const struct GNUNET_SCALARPRODUCT_Element *elements, uint32_t element_count) { struct GNUNET_CONTAINER_MultiHashMap *map; - uint32_t i; int ok; ok = GNUNET_OK; map = GNUNET_CONTAINER_multihashmap_create (2 * element_count, GNUNET_YES); - for (i = 0; i < element_count; i++) + for (uint32_t i = 0; i < element_count; i++) if (GNUNET_OK != GNUNET_CONTAINER_multihashmap_put (map, &elements[i].key, @@ -227,16 +222,13 @@ mq_error_handler (void *cls, * @return a new handle for this computation */ struct GNUNET_SCALARPRODUCT_ComputationHandle * -GNUNET_SCALARPRODUCT_accept_computation (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const struct - GNUNET_HashCode *session_key, - const struct - GNUNET_SCALARPRODUCT_Element *elements, - uint32_t element_count, - GNUNET_SCALARPRODUCT_ContinuationWithStatus - cont, - void *cont_cls) +GNUNET_SCALARPRODUCT_accept_computation ( + const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_HashCode *session_key, + const struct GNUNET_SCALARPRODUCT_Element *elements, + uint32_t element_count, + GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, + void *cont_cls) { struct GNUNET_SCALARPRODUCT_ComputationHandle *h = GNUNET_new (struct GNUNET_SCALARPRODUCT_ComputationHandle); @@ -389,16 +381,14 @@ process_result_message (struct GNUNET_SCALARPRODUCT_ComputationHandle *h, * @return a new handle for this computation */ struct GNUNET_SCALARPRODUCT_ComputationHandle * -GNUNET_SCALARPRODUCT_start_computation (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const struct - GNUNET_HashCode *session_key, - const struct GNUNET_PeerIdentity *peer, - const struct - GNUNET_SCALARPRODUCT_Element *elements, - uint32_t element_count, - GNUNET_SCALARPRODUCT_DatumProcessor cont, - void *cont_cls) +GNUNET_SCALARPRODUCT_start_computation ( + const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_HashCode *session_key, + const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_SCALARPRODUCT_Element *elements, + uint32_t element_count, + GNUNET_SCALARPRODUCT_DatumProcessor cont, + void *cont_cls) { struct GNUNET_SCALARPRODUCT_ComputationHandle *h = GNUNET_new (struct GNUNET_SCALARPRODUCT_ComputationHandle); -- cgit v1.2.3