gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] branch master updated: worked on library


From: gnunet
Subject: [taler-anastasis] branch master updated: worked on library
Date: Wed, 18 Dec 2019 19:03:27 +0100

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

ds-meister pushed a commit to branch master
in repository anastasis.

The following commit(s) were added to refs/heads/master by this push:
     new 789e02c  worked on library
789e02c is described below

commit 789e02c2c315276abf44a512cba6ce3a90ce5270
Author: Dominik Meister <address@hidden>
AuthorDate: Wed Dec 18 19:03:18 2019 +0100

    worked on library
---
 src/include/anastasis_crypto_lib.h | 177 ++++++++++++++++++++++++++++---------
 1 file changed, 133 insertions(+), 44 deletions(-)

diff --git a/src/include/anastasis_crypto_lib.h 
b/src/include/anastasis_crypto_lib.h
index 4b3cf01..1d62dcd 100644
--- a/src/include/anastasis_crypto_lib.h
+++ b/src/include/anastasis_crypto_lib.h
@@ -1,59 +1,91 @@
-/* libanastasisutil */
+#include "anastasis_service.h"
+#include <uuid/uuid.h>
+
 
 struct ANASTASIS_CRYPTO_RecoveryDocument;
 
-struct ANASTASIS_CYRPTO_EscrowProvider;
+struct ANASTASIS_CRYPTO_EscrowMethod;
+
+struct ANASTASIS_CRYPTO_Policy;
+
+struct ANASTASIS_CRYPTO_KeyShare
+{
+  uint32_t key[8];
+};
+
+struct ANASTASIS_CRYPTO_truth_key
+{
+  uint32_t key[8];
+};
+
+struct ANASTASIS_CRYPTO_salt
+{
+  uint32_t key[8];
+};
+
+struct ANASTASIS_CRYPTO_encMasterkey
+{
+  uint32_t key[8];
+};
 
+/**
+ * The UserIdentifier is a Hash from the secret, see kdf_id definition in the 
API
+ */
+struct ANASTASIS_CRYPTO_EscrowMasterKey
+{
+  uint32_t key[8];
+};
+/**
+ * The UserIdentifier is a Hash from the secret, see kdf_id definition in the 
API
+ */
 struct ANASTASIS_CRYPTO_UserIdentifier
 {
   uint32_t hash[32];
 };
-
+/**
+ * the uuids are used as Identifiers for the Truths
+ */
 struct ANASTASIS_CRYPTO_EscrowUuid
 {
-  uint32_t uuid[32];
+  uuid_t uuid;
 };
 
-
+/**
+ * id_data contains the secret provided by the user and the server salt for 
the Generation of the keys
+ * @param id Reference to the generated Hash
+ * @param id_data JSON encoded data, which contains the raw user secret and a 
server salt
+ */
 void
 ANASTASIS_CRYPTO_uid_hash (const json_t *id_data,
-                           struct ANASTASIS_CRYPTO_UserIdentifier *id);
-
-
-
-struct ANASTASIS_EscrowProvider *
-ANASTASIS_CRYPTO_escrow_provider_create (const char *base_url,
-                                         const char *method);
-
-
-struct ANASTASIS_CRYPTO_RecoveryDocument *
-ANASTASIS_CRYPTO_recovery_document_create (const struct
-                                           ANASTASIS_CRYPTO_MasterKeyP *
-                                           master_key);
-
-
-// uuid is RETURNED / set!
-int
-ANASTASIS_CRYPTO_recovery_document_add_escrow (struct
-                                               
ANASTASIS_CRYPTO_RecoveryDocument
-                                               *p,
-                                               struct ANASTASIS_EscrowProvider 
*
-                                               ep,
-                                               struct
-                                               ANASTASIS_CRYPTO_EscrowUuid *
-                                               uuid);
-
-
-// uuids == array!
-int
-ANASTASIS_CRYPTO_recovery_document_add_policy (struct
-                                               
ANASTASIS_CRYPTO_RecoveryDocument
-                                               *p,
-                                               unsigned int uuids_length,
-                                               const struct
-                                               ANASTASIS_CRYPTO_EscrowUuid *
-                                               uuids);
-
+                           struct ANASTASIS_CRYPTO_UserIdentifier
+                           *id);
+/**
+ * Generates the eddsa Public Key
+ * @param uid Hashed Userinput, used as entropy source for the key Generation
+ * @return AccountPrivP the generated eddsa private Key
+ */
+struct ANASTASIS_AccountPrivP *
+ANASTASIS_CRYPTO_privKey (const struct
+                         ANASTASIS_CRYPTO_UserIdentifier
+                         *uid);
+/**
+ * Generates the eddsa public Key from the private Key
+ * @param privP generated eddsa private key
+ * @return AccountPrivP the generated eddsa private Key
+ */
+struct ANASTASIS_AccountPubP *
+ANASTASIS_CRYPTO_pubKey (const struct
+                         ANASTASIS_AccountPrivP
+                         *privP);
+/**
+ * Encrypts the Recoverydocument
+ * @param p Reference to the Recoverydocument which should be encrypted
+ * @param id Hashed User input, used for the generation of the encryption key
+ * @param res return from the result, which contains the encrypted 
recoverydocument
+ * and the nonce and iv used for the encryption as Additional Data
+ * @param res_size size of the result
+ * @return int Status code  FIXME
+ */
 int
 ANASTASIS_CRYPTO_recovery_document_encrypt (const struct
                                             ANASTASIS_CRYPTO_RecoveryDocument 
*p,
@@ -61,8 +93,13 @@ ANASTASIS_CRYPTO_recovery_document_encrypt (const struct
                                             ANASTASIS_CRYPTO_UserIdentifier 
*id,
                                             void **res,
                                             size_t *res_size);
-
-
+/**
+ * Encrypts the Recoverydocument
+ * @param id Hashed User input, used for the generation of the encryption key
+ * @param data, contains the encrypted Recoverydocument and the nonce and iv 
used for the encryption.
+ * @param data_size size of the data
+ * @return Decrypted Recovery Document
+ */
 struct ANASTASIS_RecoveryDocument *
 ANASTASIS_CRYPTO_recovery_document_decrypt (const struct
                                             ANASTASIS_CRYPTO_UserIdentifier 
*id,
@@ -70,6 +107,58 @@ ANASTASIS_CRYPTO_recovery_document_decrypt (const struct
                                             size_t data_size);
 
 
+struct ANASTASIS_CRYPTO_EscrowMasterKey *
+ANASTASIS_CRYPTO_escrow_master_key_create (const struct
+                                           ANASTASIS_CRYPTO_KeyShare *
+                                           keyShare
+                                           unsigned int keyshare_length);
+
+
+
+struct ANASTASIS_CRYPTO_Policy *
+ANSTASIS_CRYPTO_policy_create (const struct
+                               ANASTASIS_CRYPTO_salt *
+                               salt,
+                               ANASTASIS_CRYPTO_encMasterkey *
+                               masterkey,
+                               const struct
+                               ANASTASIS_CRYPTO_EscrowUuid *
+                               uuid,
+                               unsigned int uuid_length);
+
+
+struct ANASTASIS_CRYPTO_EscrowMethod *
+ANASTASIS_CRYPTO_escrow_method_create (const char *base_url,
+                                       const char *method,
+                                       struct
+                                       ANASTASIS_CRYPTO_EscrowUuid *
+                                       uuid,
+                                       struct
+                                       ANASTASIS_CRYPTO_truth_key *
+                                       key,
+                                       ANASTASIS_CRYPTO_salt *
+                                       salt,
+                                       void * challenge,
+                                       size_t challange_size
+                                       );
+
+
+struct ANASTASIS_CRYPTO_RecoveryDocument *
+ANASTASIS_CRYPTO_recovery_document_create (struct
+                                           ANASTASIS_CRYPTO_EscrowMethod *
+                                           escrowMethod,
+                                           unsigned int method_lenght,
+                                           struct
+                                           ANASTASIS_CRYPTO_Policy *
+                                           policy,
+                                           unsigned int policy_lenght);
+
 void
 ANASTASIS_CRYPTO_recovery_document_destroy (struct
                                             ANASTASIS_CRYPTO_RecoveryDocument 
*p);
+void
+ANASTASIS_CRYPTO_escrow_method_destroy (struct
+                                        ANASTASIS_CRYPTO_EscrowMethod *p);
+void
+ANASTASIS_CRYPTO_policy_destroy (struct
+                                 ANASTASIS_CRYPTO_Policy *p);

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



reply via email to

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