diff options
Diffstat (limited to 'crypto.h')
-rw-r--r-- | crypto.h | 55 |
1 files changed, 35 insertions, 20 deletions
@@ -26,9 +26,11 @@ #include <gcrypt.h> #include <stdint.h> +#include <gnunet/gnunet_util_lib.h> + #include "internals.h" -void brandt_crypto_init (); +void brandt_crypto_init (struct GNUNET_CRYPTO_EccDlogContext *dlogctx); /* --- HASHING --- */ @@ -48,6 +50,7 @@ struct ec_mpi { unsigned char data[256 / 8]; }; +void ec_point_copy (gcry_mpi_point_t dst, const gcry_mpi_point_t src); int ec_point_cmp (const gcry_mpi_point_t a, const gcry_mpi_point_t b); void ec_skey_create (gcry_mpi_t skey); void ec_keypair_create (gcry_mpi_point_t pkey, gcry_mpi_t skey); @@ -111,30 +114,42 @@ int smc_zkp_0og_check (const gcry_mpi_point_t y, /* --- Protocol implementation --- */ -unsigned char *smc_gen_keyshare (struct AuctionData *ad, size_t *buflen); -int smc_recv_keyshare (struct AuctionData *ad, - unsigned char *buf, +unsigned char *smc_gen_keyshare (struct BRANDT_Auction *ad, size_t *buflen); +int smc_recv_keyshare (struct BRANDT_Auction *ad, + const unsigned char *buf, size_t buflen, uint16_t sender_index); -unsigned char *smc_encrypt_bid (struct AuctionData *ad, size_t *buflen); -int smc_recv_encrypted_bid (struct AuctionData *ad, - unsigned char *buf, +unsigned char *smc_encrypt_bid (struct BRANDT_Auction *ad, size_t *buflen); +int smc_recv_encrypted_bid (struct BRANDT_Auction *ad, + const unsigned char *buf, size_t buflen, uint16_t sender_index); -unsigned char *smc_compute_outcome (struct AuctionData *ad, size_t *buflen); -int smc_recv_outcome (struct AuctionData *ad, - unsigned char *buf, - size_t buflen, - uint16_t sender); - -unsigned char *smc_decrypt_outcome (struct AuctionData *ad, size_t *buflen); -int smc_recv_decryption (struct AuctionData *ad, - unsigned char *buf, - size_t buflen, - uint16_t sender); - -int32_t smc_determine_outcome (struct AuctionData *ad); +unsigned char *fp_priv_compute_outcome (struct BRANDT_Auction *ad, size_t *buflen); +int fp_priv_recv_outcome (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +unsigned char *fp_priv_decrypt_outcome (struct BRANDT_Auction *ad, size_t *buflen); +int fp_priv_recv_decryption (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +unsigned char *fp_pub_compute_outcome (struct BRANDT_Auction *ad, size_t *buflen); +int fp_pub_recv_outcome (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +unsigned char *fp_pub_decrypt_outcome (struct BRANDT_Auction *ad, size_t *buflen); +int fp_pub_recv_decryption (struct BRANDT_Auction *ad, + const unsigned char *buf, + size_t buflen, + uint16_t sender); + +int32_t fp_priv_determine_outcome (struct BRANDT_Auction *ad); #endif /* ifndef _BRANDT_CRYPTO_H */ |