exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

secmod_eddsa.h (3935B)


      1 /*
      2   This file is part of TALER
      3   Copyright (C) 2020 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 util/secmod_eddsa.h
     18  * @brief IPC messages for the EDDSA crypto helper.
     19  * @author Christian Grothoff
     20  */
     21 #ifndef TALER_EXCHANGE_SECMOD_EDDSA_H
     22 #define TALER_EXCHANGE_SECMOD_EDDSA_H
     23 
     24 #define TALER_HELPER_EDDSA_MT_PURGE 11
     25 #define TALER_HELPER_EDDSA_MT_AVAIL 12
     26 
     27 #define TALER_HELPER_EDDSA_MT_REQ_INIT 14
     28 #define TALER_HELPER_EDDSA_MT_REQ_SIGN 15
     29 #define TALER_HELPER_EDDSA_MT_REQ_REVOKE 16
     30 
     31 #define TALER_HELPER_EDDSA_MT_RES_SIGNATURE 17
     32 #define TALER_HELPER_EDDSA_MT_RES_SIGN_FAILURE 18
     33 
     34 #define TALER_HELPER_EDDSA_SYNCED 19
     35 
     36 
     37 GNUNET_NETWORK_STRUCT_BEGIN
     38 
     39 /**
     40  * Message sent if a key is available.
     41  */
     42 struct TALER_CRYPTO_EddsaKeyAvailableNotification
     43 {
     44   /**
     45    * Type is #TALER_HELPER_EDDSA_MT_AVAIL
     46    */
     47   struct GNUNET_MessageHeader header;
     48 
     49   /**
     50    * For now, always zero.
     51    */
     52   uint32_t reserved;
     53 
     54   /**
     55    * When does the key become available?
     56    */
     57   struct GNUNET_TIME_TimestampNBO anchor_time;
     58 
     59   /**
     60    * How long is the key available after @e anchor_time?
     61    */
     62   struct GNUNET_TIME_RelativeNBO duration;
     63 
     64   /**
     65    * Public key used to generate the @e sicm_sig.
     66    */
     67   struct TALER_SecurityModulePublicKeyP secm_pub;
     68 
     69   /**
     70    * Signature affirming the announcement, of
     71    * purpose #TALER_SIGNATURE_SM_SIGNING_KEY.
     72    */
     73   struct TALER_SecurityModuleSignatureP secm_sig;
     74 
     75   /**
     76    * The public key.
     77    */
     78   struct TALER_ExchangePublicKeyP exchange_pub;
     79 
     80 };
     81 
     82 
     83 /**
     84  * Message sent if a key was purged.
     85  */
     86 struct TALER_CRYPTO_EddsaKeyPurgeNotification
     87 {
     88   /**
     89    * Type is #TALER_HELPER_EDDSA_MT_PURGE.
     90    */
     91   struct GNUNET_MessageHeader header;
     92 
     93   /**
     94    * For now, always zero.
     95    */
     96   uint32_t reserved;
     97 
     98   /**
     99    * The public key.
    100    */
    101   struct TALER_ExchangePublicKeyP exchange_pub;
    102 
    103 };
    104 
    105 
    106 /**
    107  * Message sent if a signature is requested.
    108  */
    109 struct TALER_CRYPTO_EddsaSignRequest
    110 {
    111   /**
    112    * Type is #TALER_HELPER_EDDSA_MT_REQ_SIGN.
    113    */
    114   struct GNUNET_MessageHeader header;
    115 
    116   /**
    117    * For now, always zero.
    118    */
    119   uint32_t reserved;
    120 
    121   /**
    122    * What should be signed over.
    123    */
    124   struct GNUNET_CRYPTO_SignaturePurpose purpose;
    125 
    126   /* followed by rest of data to sign */
    127 };
    128 
    129 
    130 /**
    131  * Message sent if a key was revoked.
    132  */
    133 struct TALER_CRYPTO_EddsaRevokeRequest
    134 {
    135   /**
    136    * Type is #TALER_HELPER_EDDSA_MT_REQ_REVOKE.
    137    */
    138   struct GNUNET_MessageHeader header;
    139 
    140   /**
    141    * For now, always zero.
    142    */
    143   uint32_t reserved;
    144 
    145   /**
    146    * The public key to revoke.
    147    */
    148   struct TALER_ExchangePublicKeyP exchange_pub;
    149 
    150 };
    151 
    152 
    153 /**
    154  * Message sent if a signature was successfully computed.
    155  */
    156 struct TALER_CRYPTO_EddsaSignResponse
    157 {
    158   /**
    159    * Type is #TALER_HELPER_EDDSA_MT_RES_SIGNATURE.
    160    */
    161   struct GNUNET_MessageHeader header;
    162 
    163   /**
    164    * For now, always zero.
    165    */
    166   uint32_t reserved;
    167 
    168   /**
    169    * The public key used for the signature.
    170    */
    171   struct TALER_ExchangePublicKeyP exchange_pub;
    172 
    173   /**
    174    * The public key to use for the signature.
    175    */
    176   struct TALER_ExchangeSignatureP exchange_sig;
    177 
    178 };
    179 
    180 
    181 /**
    182  * Message sent if signing failed.
    183  */
    184 struct TALER_CRYPTO_EddsaSignFailure
    185 {
    186   /**
    187    * Type is #TALER_HELPER_EDDSA_MT_RES_SIGN_FAILURE.
    188    */
    189   struct GNUNET_MessageHeader header;
    190 
    191   /**
    192    * If available, Taler error code. In NBO.
    193    */
    194   uint32_t ec;
    195 
    196 };
    197 
    198 
    199 GNUNET_NETWORK_STRUCT_END
    200 
    201 
    202 #endif