diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-09-27 20:32:30 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-09-27 20:32:30 +0200 |
commit | bf8b9d1435a196c9b7c3293904da2a3baba7210a (patch) | |
tree | b722367def8d35bff70938db77323de61efd0348 /src/include/taler_mintdb_lib.h | |
parent | a67fefa9fbcf9774d277a9c94aeebdf78d2051d1 (diff) | |
parent | 1bfba318ec0f3393de2dfc66821dec6165eef90a (diff) | |
download | exchange-bf8b9d1435a196c9b7c3293904da2a3baba7210a.tar.xz |
mention need to audit randomness of gamma
Diffstat (limited to 'src/include/taler_mintdb_lib.h')
-rw-r--r-- | src/include/taler_mintdb_lib.h | 103 |
1 files changed, 85 insertions, 18 deletions
diff --git a/src/include/taler_mintdb_lib.h b/src/include/taler_mintdb_lib.h index 24f677617..7dfef8dc5 100644 --- a/src/include/taler_mintdb_lib.h +++ b/src/include/taler_mintdb_lib.h @@ -37,6 +37,12 @@ */ #define TALER_MINTDB_DIR_DENOMINATION_KEYS "denomkeys" +/** + * Subdirectory under the mint's base directory which contains + * the mint's auditing information. + */ +#define TALER_MINTDB_DIR_AUDITORS "auditors" + GNUNET_NETWORK_STRUCT_BEGIN @@ -62,7 +68,7 @@ struct TALER_MINTDB_PrivateSigningKeyInformationP /** * Information about a denomination key. - */ + */ struct TALER_MINTDB_DenominationKeyInformationP { @@ -124,23 +130,6 @@ typedef int /** - * @brief Iterator over denomination keys. - * - * @param cls closure - * @param dki the denomination key - * @param alias coin alias - * @return #GNUNET_OK to continue to iterate, - * #GNUNET_NO to stop iteration with no error, - * #GNUNET_SYSERR to abort iteration with error! - */ -typedef int -(*TALER_MINTDB_DenominationKeyIterator)(void *cls, - const char *alias, - const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); - - - -/** * Call @a it for each signing key found in the @a mint_base_dir. * * @param mint_base_dir base directory for the mint, @@ -158,6 +147,23 @@ TALER_MINTDB_signing_keys_iterate (const char *mint_base_dir, void *it_cls); + +/** + * @brief Iterator over denomination keys. + * + * @param cls closure + * @param dki the denomination key + * @param alias coin alias + * @return #GNUNET_OK to continue to iterate, + * #GNUNET_NO to stop iteration with no error, + * #GNUNET_SYSERR to abort iteration with error! + */ +typedef int +(*TALER_MINTDB_DenominationKeyIterator)(void *cls, + const char *alias, + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); + + /** * Call @a it for each denomination key found in the @a mint_base_dir. * @@ -202,6 +208,67 @@ TALER_MINTDB_denomination_key_read (const char *filename, /** + * @brief Iterator over auditor information. + * + * @param cls closure + * @param apub the auditor's public key + * @param mpub the mint's public key (as expected by the auditor) + * @param dki_len length of @a asig and @a dki arrays + * @param asigs array of the auditor's signatures over the @a dks, of length @a dki_len + * @param dki array of denomination coin data signed by the auditor, of length @a dki_len + * @return #GNUNET_OK to continue to iterate, + * #GNUNET_NO to stop iteration with no error, + * #GNUNET_SYSERR to abort iteration with error! + */ +typedef int +(*TALER_MINTDB_AuditorIterator)(void *cls, + const struct TALER_AuditorPublicKeyP *apub, + const struct TALER_MasterPublicKeyP *mpub, + unsigned int dki_len, + const struct TALER_AuditorSignatureP *asigs, + const struct TALER_DenominationKeyValidityPS *dki); + + +/** + * Call @a it with information for each auditor found in the @a mint_base_dir. + * + * @param mint_base_dir base directory for the mint, + * the signing keys must be in the #TALER_MINTDB_DIR_DENOMINATION_KEYS + * subdirectory + * @param it function to call with auditor information + * @param it_cls closure for @a it + * @return -1 on error, 0 if no files were found, otherwise + * a positive number (however, even with a positive + * number it is possible that @a it was never called + * as maybe none of the files were well-formed) + */ +int +TALER_MINTDB_auditor_iterate (const char *mint_base_dir, + TALER_MINTDB_AuditorIterator it, + void *it_cls); + + +/** + * Write auditor information to the given file. + * + * @param filename the file where to write the auditor information to + * @param apub the auditor's public key + * @param asigs the auditor's signatures, array of length @a dki_len + * @param mpub the mint's public key (as expected by the auditor) + * @param dki_len length of @a dki and @a asigs arrays + * @param dki array of denomination coin data signed by the auditor + * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure. + */ +int +TALER_MINTDB_auditor_write (const char *filename, + const struct TALER_AuditorPublicKeyP *apub, + const struct TALER_AuditorSignatureP *asigs, + const struct TALER_MasterPublicKeyP *mpub, + unsigned int dki_len, + const struct TALER_DenominationKeyValidityPS *dki); + + +/** * Initialize the plugin. * * @param cfg configuration to use |