gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: minor style fixes


From: gnunet
Subject: [taler-anastasis] branch master updated: minor style fixes
Date: Sat, 28 Mar 2020 22:56:48 +0100

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

grothoff pushed a commit to branch master
in repository anastasis.

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

commit da080efe44d62cf495cb30680495f1e08edb0a60
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Mar 28 22:56:46 2020 +0100

    minor style fixes
---
 src/util/anastasis_crypto.c      | 39 ++++++++++++++++++++++++++-------------
 src/util/test_anastasis_crypto.c | 13 +++++++++----
 2 files changed, 35 insertions(+), 17 deletions(-)

diff --git a/src/util/anastasis_crypto.c b/src/util/anastasis_crypto.c
index 2e01e92..aed3038 100644
--- a/src/util/anastasis_crypto.c
+++ b/src/util/anastasis_crypto.c
@@ -78,6 +78,7 @@ get_iv_key (const void *msec,
   memcpy (iv, &res[AES_KEY_SIZE], AES_IV_SIZE);
 }
 
+
 /**
  * Encryption of data like recovery document etc.
  *
@@ -88,7 +89,7 @@ get_iv_key (const void *msec,
  * @param res ciphertext output
  * @param res_size size of the ciphertext
  */
-void
+static void
 encrypt (const void *msec,
          const void *data,
          size_t data_size,
@@ -139,6 +140,7 @@ encrypt (const void *msec,
   gcry_cipher_close (cipher);
 }
 
+
 /**
  * Decryption of data like encrypted recovery document etc.
  *
@@ -149,7 +151,7 @@ encrypt (const void *msec,
  * @param res plaintext output
  * @param res_size size of the plaintext
  */
-void
+static void
 decrypt (const void *msec,
          const void *data,
          size_t data_size,
@@ -195,6 +197,7 @@ decrypt (const void *msec,
   gcry_cipher_close (cipher);
 }
 
+
 /**
  * Creates the UserIdentifier, it is used as entropy source for the encryption 
keys and
  * for the public and private key for signing the data.
@@ -206,18 +209,20 @@ ANASTASIS_CRYPTO_user_identifier_derive (
   const json_t *id_data,
   struct ANASTASIS_CRYPTO_UserIdentifier *id)
 {
-  GNUNET_assert (0 == gcry_kdf_derive (id_data,
-                                       sizeof (*id_data),
-                                       GCRY_KDF_SCRYPT,
-                                       1, // subalgo
-                                       "SERVER_SALT", // FIXME: Set real salt 
value!!!
-                                       strlen ("SERVER_SALT"),
-                                       1000, // iterations
-                                       sizeof (struct
-                                               
ANASTASIS_CRYPTO_UserIdentifier),
-                                       id));
+  GNUNET_assert (0 ==
+                 gcry_kdf_derive (id_data,
+                                  sizeof (*id_data),
+                                  GCRY_KDF_SCRYPT,
+                                  1, // subalgo
+                                  "SERVER_SALT", // FIXME: Set real salt 
value!!!
+                                  strlen ("SERVER_SALT"),
+                                  1000, // iterations
+                                  sizeof (struct
+                                          ANASTASIS_CRYPTO_UserIdentifier),
+                                  id));
 }
 
+
 /**
  * Generates the eddsa public Key used as the account identifier on the 
providers
  * @param id holds a hashed user secret which is used as entropy source for 
the public key generation
@@ -231,6 +236,7 @@ ANASTASIS_CRYPTO_account_public_key_derive (
 
 }
 
+
 /**
  * Encrypt and signs the recovery document with AES256, the recovery document 
is
  * encrypted with a derivation from the user identifier and the salt "erd".
@@ -257,6 +263,7 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (
   encrypt (id, data, data_size, salt, res, res_size);
 }
 
+
 /**
  * Decrypts the recovery document with AES256, the decryption key is generated 
with
  * the user identifier provided by the user and the salt "erd". The nonce and 
IV used for the encryption
@@ -284,6 +291,7 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (
   decrypt (id, data, data_size, salt, res, res_size);
 }
 
+
 /**
  * Encrypts a keyshare with a key generated with the user identification as 
entropy and the salt "eks".
  *
@@ -312,6 +320,7 @@ ANASTASIS_CRYPTO_key_share_encrypt (
            res_size);
 }
 
+
 /**
  * Decrypts a keyshare with a key generated with the user identification as 
entropy and the salt "eks".
  *
@@ -335,6 +344,7 @@ ANASTASIS_CRYPTO_key_share_decrypt (
   decrypt (id, enc_key_share, eks_size, salt, key_share, ks_size);
 }
 
+
 /**
  * Encrypts the truth data which contains the hashed answer or the phone 
number..
  * It is encrypted with AES256, the key is generated with the user 
identification as
@@ -363,6 +373,7 @@ ANASTASIS_CRYPTO_truth_encrypt (
   encrypt (truth_enc_key, data, data_size, salt, res, res_size);
 }
 
+
 /**
  * Decrypts the truth data which contains the hashed answer or the phone 
number..
  * It is decrypted with AES256, the key is generated with the user 
identification as
@@ -451,6 +462,7 @@ ANASTASIS_CRYPTO_core_secret_encrypt (
 
 }
 
+
 /**
  * Decrypts the core secret with the master key. First the master key is 
decrypted with the provided policy key.
  * Afterwards the core secret is encrypted with the master key. The core 
secret is returned.
@@ -474,4 +486,5 @@ ANASTASIS_CRYPTO_core_secret_recover (
 
 }
 
-/* end of anastasis_crypto.c */
\ No newline at end of file
+
+/* end of anastasis_crypto.c */
diff --git a/src/util/test_anastasis_crypto.c b/src/util/test_anastasis_crypto.c
index 3f477c6..97ef7e9 100644
--- a/src/util/test_anastasis_crypto.c
+++ b/src/util/test_anastasis_crypto.c
@@ -33,7 +33,7 @@
  * Testing derivation of the user identifier
  */
 static int
-test_user_identifier_derive ()
+test_user_identifier_derive (void)
 {
   json_t *id_data_1;
   json_t *id_data_2;
@@ -69,12 +69,13 @@ test_user_identifier_derive ()
   return 0;
 }
 
+
 /**
  * Testing the encryption of an recovery document and the
  * decryption of the encrypted recovery document
  */
 static int
-test_recovery_document ()
+test_recovery_document (void)
 {
   void *ciphertext;
   size_t size_ciphertext;
@@ -108,8 +109,9 @@ test_recovery_document ()
   return GNUNET_memcmp (test, plaintext);
 }
 
+
 static int
-test_key_share ()
+test_key_share (void)
 {
   void *ciphertext;
   size_t size_ciphertext;
@@ -145,8 +147,9 @@ test_key_share ()
   return GNUNET_memcmp (&key_share, plaintext);
 }
 
+
 static int
-test_truth ()
+test_truth (void)
 {
   void *ciphertext;
   size_t size_ciphertext;
@@ -180,6 +183,7 @@ test_truth ()
   return GNUNET_memcmp ("TEST_TRUTH", plaintext);
 }
 
+
 int
 main (int argc,
       const char *const argv[])
@@ -198,4 +202,5 @@ main (int argc,
 
 }
 
+
 /* end of test_anastasis_crypto.c */

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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