donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

donau_pq_lib.h (3163B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2024 Taler Systems SA
      4 
      5   TALER is free software; you can redistribute it and/or modify it under the
      6   terms of the GNU General Public License as published by the Free Software
      7   Foundation; either version 3, or (at your option) any later version.
      8 
      9   TALER 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 General Public License for more details.
     12 
     13   You should have received a copy of the GNU General Public License along with
     14   TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
     15 */
     16 /**
     17  * @file include/donau_pq_lib.h
     18  * @brief helper functions for DB interactions
     19  * @author Johannes Casaburi
     20  * @author Lukas Matyja
     21  */
     22 #ifndef DONAU_PQ_LIB_H_
     23 #define DONAU_PQ_LIB_H_
     24 
     25 #include <gnunet/gnunet_common.h>
     26 #include <gnunet/gnunet_pq_lib.h>
     27 #include "taler/taler_util.h"
     28 
     29 /**
     30  * Generate query parameter for a donation unit public key
     31  * key. Internally, the various attributes of the
     32  * public key will be serialized into on variable-size
     33  * BLOB.
     34  *
     35  * @param donation_unit_pub pointer to the query parameter to pass
     36  */
     37 struct GNUNET_PQ_QueryParam
     38 DONAU_PQ_query_param_donation_unit_pub (
     39   const struct DONAU_DonationUnitPublicKey *donation_unit_pub);
     40 
     41 
     42 /**
     43  * Generate query parameter for an array of blinded donation unit signatures
     44  *
     45  * @param num number of elements in @e du_sigs
     46  * @param du_sigs array of blinded donation unit signatures
     47  * @param db context for the db-connection
     48  */
     49 struct GNUNET_PQ_QueryParam
     50 DONAU_PQ_query_param_array_blinded_donation_unit_sig (
     51   size_t num,
     52   const struct DONAU_BlindedDonationUnitSignature *du_sigs,
     53   struct GNUNET_PQ_Context *db
     54   );
     55 
     56 
     57 /**
     58  * Generate query parameter for an array of donation unit signatures
     59  *
     60  * @param num number of elements in @e du_sigs
     61  * @param du_sigs array of donation unit signatures
     62  * @param db context for the db-connection
     63  */
     64 struct GNUNET_PQ_QueryParam
     65 DONAU_PQ_query_param_array_donation_unit_sig (
     66   size_t num,
     67   const struct DONAU_DonationUnitSignature *du_sigs,
     68   struct GNUNET_PQ_Context *db
     69   );
     70 
     71 
     72 /**
     73  * Donation unit public key expected.
     74  *
     75  * @param name name of the field in the table
     76  * @param[out] donation_unit_pub where to store the public key
     77  * @return array entry for the result specification to use
     78  */
     79 struct GNUNET_PQ_ResultSpec
     80 DONAU_PQ_result_spec_donation_unit_pub (
     81   const char *name,
     82   struct DONAU_DonationUnitPublicKey *donation_unit_pub);
     83 
     84 
     85 /**
     86  * Array of blinded donation unit signature expected
     87  *
     88  * @param db context of the database connection
     89  * @param name name of the field in the table
     90  * @param[out] num number of elements in @e denomdu_sigs_sigs
     91  * @param[out] du_sigs where to store the result
     92  * @return array entry for the result specification to use
     93  */
     94 struct GNUNET_PQ_ResultSpec
     95 DONAU_PQ_result_spec_array_blinded_donation_unit_sig (
     96   struct GNUNET_PQ_Context *db,
     97   const char *name,
     98   size_t *num,
     99   struct DONAU_BlindedDonationUnitSignature **du_sigs);
    100 
    101 #endif  /* DONAU_PQ_LIB_H_ */
    102 
    103 /* end of include/donau_pq_lib.h */