gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: -style fixes


From: gnunet
Subject: [gnunet] branch master updated: -style fixes
Date: Sat, 19 Feb 2022 12:26:29 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 25ef40ef7 -style fixes
25ef40ef7 is described below

commit 25ef40ef768743a10b7b29881c267e0fdc9fc677
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sat Feb 19 12:26:18 2022 +0100

    -style fixes
---
 src/include/gnunet_json_lib.h |  8 ++++----
 src/util/crypto_cs.c          | 32 +++++++++++++-------------------
 2 files changed, 17 insertions(+), 23 deletions(-)

diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h
index 7d101196c..6e73a3365 100644
--- a/src/include/gnunet_json_lib.h
+++ b/src/include/gnunet_json_lib.h
@@ -48,10 +48,10 @@ struct GNUNET_JSON_Specification;
  * @return #GNUNET_SYSERR on error,
  *         #GNUNET_OK on success
  */
-typedef int
-(*GNUNET_JSON_Parser) (void *cls,
-                       json_t *root,
-                       struct GNUNET_JSON_Specification *spec);
+typedef enum GNUNET_GenericReturnValue
+(*GNUNET_JSON_Parser)(void *cls,
+                      json_t *root,
+                      struct GNUNET_JSON_Specification *spec);
 
 
 /**
diff --git a/src/util/crypto_cs.c b/src/util/crypto_cs.c
index 9bd81efa5..1889e62f6 100644
--- a/src/util/crypto_cs.c
+++ b/src/util/crypto_cs.c
@@ -69,14 +69,15 @@ GNUNET_CRYPTO_cs_private_key_get_public (const struct
 
 
 /**
- * maps 32 random bytes to a scalar
- * this is necessary because libsodium expects scalar to be in the prime order 
subgroup
- * @param[out] scalar containing 32 byte char array, is modified to be in 
prime order subgroup
+ * Maps 32 random bytes to a scalar.  This is necessary because libsodium
+ * expects scalar to be in the prime order subgroup.
+ *
+ * @param[in,out] scalar containing 32 byte char array, is modified to be in 
prime order subgroup
  */
 static void
 map_to_scalar_subgroup (struct GNUNET_CRYPTO_Cs25519Scalar *scalar)
 {
-  // perform clamping as described in RFC7748
+  /* perform clamping as described in RFC7748 */
   scalar->d[0] &= 248;
   scalar->d[31] &= 127;
   scalar->d[31] |= 64;
@@ -100,21 +101,14 @@ GNUNET_CRYPTO_cs_r_derive (const struct 
GNUNET_CRYPTO_CsNonce *nonce,
                            const struct GNUNET_CRYPTO_CsPrivateKey *lts,
                            struct GNUNET_CRYPTO_CsRSecret r[2])
 {
-  GNUNET_assert (GNUNET_YES ==
-                 GNUNET_CRYPTO_hkdf (r,
-                                     sizeof (struct GNUNET_CRYPTO_CsRSecret)
-                                     * 2,
-                                     GCRY_MD_SHA512,
-                                     GCRY_MD_SHA256,
-                                     "r",
-                                     strlen ("r"),
-                                     lts,
-                                     sizeof (*lts),
-                                     nonce,
-                                     sizeof (*nonce),
-                                     NULL,
-                                     0));
-
+  GNUNET_assert (
+    GNUNET_YES ==
+    GNUNET_CRYPTO_kdf (
+      r,     sizeof (struct GNUNET_CRYPTO_CsRSecret) * 2,
+      "r",   strlen ("r"),
+      lts,   sizeof (*lts),
+      nonce, sizeof (*nonce),
+      NULL,  0));
   map_to_scalar_subgroup (&r[0].scalar);
   map_to_scalar_subgroup (&r[1].scalar);
 }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]