frosix

Multiparty signature service (experimental)
Log | Files | Refs | README | LICENSE

frosix_backend.h (5241B)


      1 /*
      2   This file is part of Frosix
      3   Copyright (C) 2022, 2023 Frosix
      4 
      5   Frosix is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU Affero General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   Frosix is distributed in the hope that it will be useful, but WITHOUT ANY
     10   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     11   A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.
     12 
     13   You should have received a copy of the GNU Affero General Public License along with
     14   Frosix; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file include/frost_high.h
     18  * @brief frosix high level api to create a signature share
     19  * @author Joel Urech
     20 */
     21 #ifndef FROSIX_BACKEND_H
     22 #define FROSIX_BACKEND_H
     23 
     24 #include <gnunet/gnunet_util_lib.h>
     25 #include "frost_low.h"
     26 #include "frosix.h"
     27 
     28 /**
     29  * Server to client: this is the policy version.
     30  */
     31 // #define FROSIX_HTTP_HEADER_POLICY_VERSION "Frosix-Version"
     32 
     33 /**
     34  * Server to client: this is the policy expiration time.
     35  */
     36 // #define ANASTASIS_HTTP_HEADER_POLICY_EXPIRATION "Anastasis-Policy-Expiration"
     37 
     38 /**
     39  * Client to server: use this to decrypt the truth.
     40  */
     41 /*#define ANASTASIS_HTTP_HEADER_TRUTH_DECRYPTION_KEY \
     42   "Anastasis-Truth-Decryption-Key"*/
     43 
     44 /**
     45  * Client to server: please store this meta data.
     46  */
     47 // #define ANASTASIS_HTTP_HEADER_POLICY_META_DATA "Anastasis-Policy-Meta-Data"
     48 
     49 
     50 /**
     51  * Client to server: I paid using this payment secret.
     52  */
     53 // #define ANASTASIS_HTTP_HEADER_PAYMENT_IDENTIFIER
     54 // "Anastasis-Payment-Identifier"
     55 
     56 /**
     57  * Client to server: I am authorized to update this policy, or
     58  * server to client: I prove this is a valid policy.
     59  */
     60 // #define ANASTASIS_HTTP_HEADER_POLICY_SIGNATURE "Anastasis-Policy-Signature"
     61 
     62 /**
     63  * Server to client: Taler Payto-URI.
     64  */
     65 // #define ANASTASIS_HTTP_HEADER_TALER "Taler"
     66 
     67 
     68 GNUNET_NETWORK_STRUCT_BEGIN
     69 
     70 /**
     71  * An EdDSA public key that is used to identify a user's account.
     72  */
     73 /*struct FROSIX_CRYPTO_AccountPublicKeyP
     74 {
     75   struct GNUNET_CRYPTO_EddsaPublicKey pub;
     76 };*/
     77 
     78 
     79 /**
     80  * An EdDSA private key that is used to identify a user's account.
     81  */
     82 /*struct ANASTASIS_CRYPTO_AccountPrivateKeyP
     83 {
     84   struct GNUNET_CRYPTO_EddsaPrivateKey priv;
     85 };*/
     86 
     87 
     88 /**
     89  * Specifies a TruthKey which is used to decrypt the Truth stored by the user.
     90  */
     91 /*struct ANASTASIS_CRYPTO_TruthKeyP
     92 {
     93   struct FROST_HashCode key;
     94 };*/
     95 
     96 
     97 /**
     98  * Specifies a salt value used to encrypt the master public key.
     99  */
    100 /*struct ANASTASIS_CRYPTO_MasterSaltP
    101 {
    102   struct FROST_HashCode salt;
    103 };*/
    104 
    105 
    106 
    107 
    108 
    109 /**
    110  * Specifies a policy key which is used to decrypt the master key
    111  */
    112 /*struct ANASTASIS_CRYPTO_PolicyKeyP
    113 {
    114   struct FROST_HashCode key;
    115 };*/
    116 
    117 
    118 /**
    119  * Nonce used for encryption, 24 bytes.
    120  */
    121 /*struct ANASTASIS_CRYPTO_NonceP
    122 {
    123   uint8_t nonce[crypto_secretbox_NONCEBYTES];
    124 };*/
    125 
    126 
    127 /**
    128  * Header that is prepended to a ciphertext, consisting of nonce and MAC.
    129  */
    130 /*struct ANASTASIS_CRYPTO_CiphertextHeaderP
    131 {
    132   uint8_t header[crypto_secretbox_NONCEBYTES + crypto_secretbox_MACBYTES];
    133 };*/
    134 
    135 
    136 /**
    137  * Specifies a key used for symmetric encryption, 32 bytes.
    138  */
    139 /*struct ANASTASIS_CRYPTO_SymKeyP
    140 {
    141   uint32_t key[8];
    142 };*/
    143 
    144 
    145 /**
    146  * Specifies a Key Share from an escrow provider, the combined
    147  * keyshares generate the EscrowMasterKey which is used to decrypt the
    148  * Secret from the user.
    149  */
    150 /*struct ANASTASIS_CRYPTO_KeyShareP
    151 {
    152   uint32_t key[8];
    153 };*/
    154 
    155 
    156 /**
    157  * Specifies an encrypted KeyShare
    158  */
    159 /*struct FROSIX_CRYPTO_EncryptedKeyShareP
    160 {
    161   //
    162    * Ciphertext.
    163    //
    164   struct ANASTASIS_CRYPTO_CiphertextHeaderP header;
    165 
    166   //
    167    * The actual key share, encrypted.
    168    //
    169   struct ANASTASIS_CRYPTO_KeyShareP keyshare;
    170 };*/
    171 
    172 
    173 /**
    174  * The escrow master key is the key used to encrypt the user secret (MasterKey).
    175  */
    176 /*struct ANASTASIS_CRYPTO_EscrowMasterKeyP
    177 {
    178   uint32_t key[8];
    179 };*/
    180 
    181 
    182 /**
    183  * The user identifier consists of user information and the server salt. It is used as
    184  * entropy source to generate the account public key and the encryption keys.
    185  */
    186 /*struct ANASTASIS_CRYPTO_UserIdentifierP
    187 {
    188   struct FROST_HashCode hash;
    189 };*/
    190 
    191 
    192 
    193 
    194 
    195 /**
    196  * Data signed by the account public key of a sync client to
    197  * authorize the upload of the backup.
    198  */
    199 /* struct ANASTASIS_UploadSignaturePS
    200 {
    201   //
    202    * Set to #TALER_SIGNATURE_ANASTASIS_POLICY_UPLOAD.
    203    //
    204   struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
    205 
    206   //
    207    * Hash of the new backup.
    208    //
    209   struct FROST_HashCode new_recovery_data_hash;
    210 
    211 }; */
    212 
    213 
    214 /**
    215  * Signature made with an account's public key.
    216  */
    217 /*struct FROSIX_AccountSignatureP
    218 {*/
    219 /**
    220    * We use EdDSA.
    221    */
    222 /*struct GNUNET_CRYPTO_EddsaSignature eddsa_sig;
    223 };*/
    224 
    225 
    226   GNUNET_NETWORK_STRUCT_END
    227 
    228 /**
    229  * Result of encrypting the core secret.
    230  */
    231 // struct ANASTASIS_CoreSecretEncryptionResult
    232 // {
    233 /**
    234    * Encrypted core secret.
    235    */
    236 // void *enc_core_secret;
    237 
    238 /**
    239    * Size of the encrypted core secret.
    240    */
    241 // size_t enc_core_secret_size;
    242 
    243 /**
    244    * Array of encrypted master keys.  Each key is encrypted
    245    * to a different policy key.
    246    */
    247 // void **enc_master_keys;
    248 
    249 /**
    250    * Sizes of the encrypted master keys.
    251    */
    252 // size_t *enc_master_key_sizes;
    253 // };
    254 
    255 
    256 #endif