add key-share generation
This commit is contained in:
parent
6824ebe008
commit
cbb4714027
14
crypto.c
14
crypto.c
@ -425,6 +425,20 @@ smc_compute_pkey (struct AuctionData *ad)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
smc_gen_keyshare (struct AuctionData *ad)
|
||||||
|
{
|
||||||
|
uint16_t i;
|
||||||
|
|
||||||
|
ad->y = calloc(ad->n, sizeof(*ad->y));
|
||||||
|
for (i = 0; i < ad->n; i++)
|
||||||
|
ad->y[0] = gcry_mpi_point_new (0);
|
||||||
|
|
||||||
|
ad->x = gcry_mpi_new (0);
|
||||||
|
ec_keypair_create (ad->y[ad->i], ad->x);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* smc_zkp_dl
|
* smc_zkp_dl
|
||||||
*
|
*
|
||||||
|
9
crypto.h
9
crypto.h
@ -25,6 +25,8 @@
|
|||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "internals.h"
|
||||||
|
|
||||||
void brandt_crypto_init ();
|
void brandt_crypto_init ();
|
||||||
|
|
||||||
|
|
||||||
@ -64,8 +66,6 @@ void ec_keypair_create_base (gcry_mpi_point_t pkey,
|
|||||||
const gcry_mpi_point_t base);
|
const gcry_mpi_point_t base);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* --- Zero knowledge proofs --- */
|
/* --- Zero knowledge proofs --- */
|
||||||
|
|
||||||
void smc_zkp_dl (const gcry_mpi_point_t v,
|
void smc_zkp_dl (const gcry_mpi_point_t v,
|
||||||
@ -124,4 +124,9 @@ int smc_zkp_0og_check (const gcry_mpi_point_t alpha,
|
|||||||
const gcry_mpi_t r1,
|
const gcry_mpi_t r1,
|
||||||
const gcry_mpi_t r2);
|
const gcry_mpi_t r2);
|
||||||
|
|
||||||
|
/* --- Protocol implementation --- */
|
||||||
|
|
||||||
|
void smc_gen_keyshare (struct AuctionData *ad);
|
||||||
|
void smc_compute_pkey (struct AuctionData *ad);
|
||||||
|
|
||||||
#endif /* ifndef _BRANDT_CRYPTO_H */
|
#endif /* ifndef _BRANDT_CRYPTO_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user