frosix

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

frosix-httpd_dkg.h (4071B)


      1 /*
      2   This file is part of Frosix
      3   Copyright (C) 2022, 2023 Joel Urech
      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 backend/frosix-httpd_dkg.h
     18  * @brief functions to handle incoming requests on /dkg-*
     19  * @author Joel Urech
     20  */
     21 #ifndef FROSIX_HTTPD_DKG_H
     22 #define FROSIX_HTTPD_DKG_H
     23 #include "frosix-httpd.h"
     24 #include "keygen.h"
     25 #include "frosix_service.h"
     26 #include "frosix_util_lib.h"
     27 #include <microhttpd.h>
     28 #include <taler/taler_mhd_lib.h>
     29 
     30 
     31 /**
     32  *
     33  *
     34  * @param[out] dkg_comm
     35  * @param[in] context_string
     36  * @param[in] additional_data
     37  * @param identifier
     38  * @param threshold
     39  * @param num_of_participants
     40  * @return GNUNET_OK or GNUNET_NO
     41 */
     42 enum GNUNET_GenericReturnValue
     43 FROSIX_dkg_commitment_generate_ (
     44   struct FROST_DkgCommitment *dkg_comm,
     45   const struct FROST_DkgContextString *context_string,
     46   const struct FROST_HashCode *additional_data,
     47   uint8_t identifier,
     48   uint8_t threshold,
     49   uint8_t num_of_participants);
     50 
     51 /**
     52  * FIXME
     53 */
     54 enum GNUNET_GenericReturnValue
     55 FROSIX_dkg_shares_generate_ (
     56   struct FROST_DkgShare dkg_shares[],
     57   const struct FROST_DkgContextString *context_string,
     58   const struct FROST_HashCode *additional_data,
     59   uint8_t identifier,
     60   uint8_t threshold,
     61   uint8_t num_of_participants);
     62 
     63 /**
     64  *
     65 */
     66 enum GNUNET_GenericReturnValue
     67 FROSIX_dkg_derive_context_string_ (
     68   struct FROST_DkgContextString *resulting_context_string,
     69   uint8_t provider_index,
     70   uint8_t threshold,
     71   const struct FROSIX_DkgContextStringP *input_context_string,
     72   const struct FROSIX_ChallengeHashP *auth_hash,
     73   const struct GNUNET_CRYPTO_EddsaPublicKey provider_public_keys[],
     74   size_t length,
     75   const struct FROSIX_SecretProviderSaltP*secret_provider_salt);
     76 
     77 
     78 /**
     79  *
     80 */
     81 enum GNUNET_GenericReturnValue
     82 FROSIX_dkg_validate_request_id_ (
     83   const struct FROSIX_DkgRequestIdP *request_id,
     84   const struct FROSIX_DkgContextStringP *context_string,
     85   const struct FROSIX_ChallengeHashP *auth_hash,
     86   const struct FROSIX_ProviderSaltP *secret_provider_salt,
     87   uint8_t identifier,
     88   uint8_t num_of_participants,
     89   uint8_t threshold);
     90 
     91 /**
     92  * FIXME
     93 */
     94 MHD_RESULT
     95 FH_handler_dkg_commitment_post (
     96   struct MHD_Connection *connection,
     97   struct TM_HandlerContext *hc,
     98   const struct FROSIX_DkgRequestIdP *dkg_id,
     99   const struct FROSIX_ProviderSaltP *provider_salt,
    100   const struct FROSIX_SecretProviderSaltP *secret_provider_salt,
    101   const struct GNUNET_CRYPTO_EddsaPrivateKey *priv_sig_key,
    102   const struct GNUNET_CRYPTO_EddsaPublicKey *pub_sig_key,
    103   const char *dkg_commitment_data,
    104   size_t *dkg_commitment_data_size);
    105 
    106 /**
    107  * FIXME
    108 */
    109 MHD_RESULT
    110 FH_handler_dkg_shares_post (
    111   struct MHD_Connection *connection,
    112   struct TM_HandlerContext *hc,
    113   const struct FROSIX_DkgRequestIdP *dkg_id,
    114   const struct FROSIX_ProviderSaltP *provider_salt,
    115   const struct FROSIX_SecretProviderSaltP *secret_provider_salt,
    116   const char *dkg_commitment_data,
    117   size_t *dkg_commitment_data_size);
    118 
    119 /**
    120  * FIXME
    121 */
    122 MHD_RESULT
    123 FH_handler_dkg_key_post (
    124   struct MHD_Connection *connection,
    125   struct TM_HandlerContext *hc,
    126   const struct FROSIX_DkgRequestIdP *dkg_id,
    127   const struct FROSIX_ProviderSaltP *provider_salt,
    128   const struct FROSIX_SecretProviderSaltP *secret_provider_salt,
    129   const struct GNUNET_CRYPTO_EddsaPrivateKey *priv_sig_key,
    130   const char *dkg_commitment_data,
    131   size_t *dkg_commitment_data_size);
    132 
    133 /**
    134  * FIXME
    135 */
    136 MHD_RESULT
    137 FH_handler_key_delete (
    138   struct MHD_Connection *connection,
    139   struct TM_HandlerContext *hc,
    140   const struct FROSIX_DkgRequestIdP *id);
    141 
    142 #endif