simplify encrypt_bid
This commit is contained in:
parent
6654fc3c01
commit
b4694f8d06
8
crypto.c
8
crypto.c
@ -714,6 +714,8 @@ smc_encrypt_bid (struct BRANDT_Auction *ad, size_t *buflen)
|
||||
(sizeof (struct ec_mpi) * 2 +
|
||||
sizeof (*proof3)) +
|
||||
sizeof (struct proof_2dle)); /* proof2 */
|
||||
if (0 < ad->m)
|
||||
*buflen += sizeof (struct proof_2dle);
|
||||
ret = GNUNET_new_array (*buflen, unsigned char);
|
||||
|
||||
head = (struct msg_head *)ret;
|
||||
@ -750,11 +752,7 @@ smc_encrypt_bid (struct BRANDT_Auction *ad, size_t *buflen)
|
||||
* subset of bids as well */
|
||||
if (0 < ad->m)
|
||||
{
|
||||
struct proof_2dle *proof2;
|
||||
*buflen += sizeof (struct proof_2dle);
|
||||
ret = GNUNET_realloc (ret, *buflen);
|
||||
proof2 = (struct proof_2dle *)(ret + *buflen -
|
||||
sizeof (struct proof_2dle));
|
||||
struct proof_2dle *proof2 = (struct proof_2dle *)(ret + *buflen) - 1;
|
||||
smc_zkp_2dle (NULL, NULL, ad->Y, ec_gen, r_sum2, proof2);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user