From 99e5a11de13a3283c07f353471e08df241511d19 Mon Sep 17 00:00:00 2001 From: Markus Teich Date: Wed, 13 Jul 2016 14:01:24 +0200 Subject: major random stuff --- crypto.h | 55 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 20 deletions(-) (limited to 'crypto.h') diff --git a/crypto.h b/crypto.h index 8d2983c..6e1d938 100644 --- a/crypto.h +++ b/crypto.h @@ -26,9 +26,11 @@ #include #include +#include + #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 */ -- cgit v1.2.3