diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-09-21 13:50:20 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-09-21 13:50:20 +0200 |
commit | b31da162a85e993e8bb4287db9b5d8bc6ef2e53f (patch) | |
tree | fca58833e5fd19b750ad1aa165661f0bc5200d1b /crypto.c | |
parent | 658cb968460233a04e77d37558275a894e9d345c (diff) | |
download | libbrandt-b31da162a85e993e8bb4287db9b5d8bc6ef2e53f.tar.gz libbrandt-b31da162a85e993e8bb4287db9b5d8bc6ef2e53f.zip |
coding style fixes
Diffstat (limited to 'crypto.c')
-rw-r--r-- | crypto.c | 64 |
1 files changed, 33 insertions, 31 deletions
@@ -816,12 +816,12 @@ quit: | |||
816 | void | 816 | void |
817 | fp_pub_prep_outcome (struct BRANDT_Auction *ad) | 817 | fp_pub_prep_outcome (struct BRANDT_Auction *ad) |
818 | { | 818 | { |
819 | gcry_mpi_t coeff = gcry_mpi_copy (GCRYMPI_CONST_ONE); | 819 | gcry_mpi_t coeff = gcry_mpi_copy (GCRYMPI_CONST_ONE); |
820 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); | 820 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); |
821 | gcry_mpi_point_t *tlta1; | 821 | gcry_mpi_point_t *tlta1; |
822 | gcry_mpi_point_t *tltb1; | 822 | gcry_mpi_point_t *tltb1; |
823 | gcry_mpi_point_t **tlta2; | 823 | gcry_mpi_point_t **tlta2; |
824 | gcry_mpi_point_t **tltb2; | 824 | gcry_mpi_point_t **tltb2; |
825 | 825 | ||
826 | ad->gamma2 = smc_init2 (ad->n, ad->k); | 826 | ad->gamma2 = smc_init2 (ad->n, ad->k); |
827 | brandt_assert (ad->gamma2); | 827 | brandt_assert (ad->gamma2); |
@@ -1045,7 +1045,7 @@ quit: | |||
1045 | void | 1045 | void |
1046 | fp_pub_prep_decryption (struct BRANDT_Auction *ad) | 1046 | fp_pub_prep_decryption (struct BRANDT_Auction *ad) |
1047 | { | 1047 | { |
1048 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); | 1048 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); |
1049 | 1049 | ||
1050 | ad->phi2 = smc_init2 (ad->n, ad->k); | 1050 | ad->phi2 = smc_init2 (ad->n, ad->k); |
1051 | brandt_assert (ad->phi2); | 1051 | brandt_assert (ad->phi2); |
@@ -1162,15 +1162,16 @@ quit: | |||
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | 1164 | ||
1165 | struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad, | 1165 | struct BRANDT_Result * |
1166 | uint16_t *len) | 1166 | fp_pub_determine_outcome (struct BRANDT_Auction *ad, |
1167 | uint16_t *len) | ||
1167 | { | 1168 | { |
1168 | struct BRANDT_Result *ret; | 1169 | struct BRANDT_Result *ret; |
1169 | int32_t price = -1; | 1170 | int32_t price = -1; |
1170 | int32_t winner = -1; | 1171 | int32_t winner = -1; |
1171 | int dlogi = -1; | 1172 | int dlogi = -1; |
1172 | gcry_mpi_point_t sum_gamma = gcry_mpi_point_new (0); | 1173 | gcry_mpi_point_t sum_gamma = gcry_mpi_point_new (0); |
1173 | gcry_mpi_point_t sum_phi = gcry_mpi_point_new (0); | 1174 | gcry_mpi_point_t sum_phi = gcry_mpi_point_new (0); |
1174 | 1175 | ||
1175 | brandt_assert (ad); | 1176 | brandt_assert (ad); |
1176 | 1177 | ||
@@ -1208,7 +1209,7 @@ struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad, | |||
1208 | if (-1 == winner || -1 == price) | 1209 | if (-1 == winner || -1 == price) |
1209 | return NULL; | 1210 | return NULL; |
1210 | 1211 | ||
1211 | ret = GNUNET_new(struct BRANDT_Result); | 1212 | ret = GNUNET_new (struct BRANDT_Result); |
1212 | ret->bidder = winner; | 1213 | ret->bidder = winner; |
1213 | ret->price = price; | 1214 | ret->price = price; |
1214 | ret->status = BRANDT_bidder_won; | 1215 | ret->status = BRANDT_bidder_won; |
@@ -1221,14 +1222,14 @@ struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad, | |||
1221 | void | 1222 | void |
1222 | fp_priv_prep_outcome (struct BRANDT_Auction *ad) | 1223 | fp_priv_prep_outcome (struct BRANDT_Auction *ad) |
1223 | { | 1224 | { |
1224 | gcry_mpi_point_t tmpa = gcry_mpi_point_new (0); | 1225 | gcry_mpi_point_t tmpa = gcry_mpi_point_new (0); |
1225 | gcry_mpi_point_t tmpb = gcry_mpi_point_new (0); | 1226 | gcry_mpi_point_t tmpb = gcry_mpi_point_new (0); |
1226 | gcry_mpi_point_t *tlta1; | 1227 | gcry_mpi_point_t *tlta1; |
1227 | gcry_mpi_point_t *tltb1; | 1228 | gcry_mpi_point_t *tltb1; |
1228 | gcry_mpi_point_t **tlta2; | 1229 | gcry_mpi_point_t **tlta2; |
1229 | gcry_mpi_point_t **tltb2; | 1230 | gcry_mpi_point_t **tltb2; |
1230 | gcry_mpi_point_t **tlta3; | 1231 | gcry_mpi_point_t **tlta3; |
1231 | gcry_mpi_point_t **tltb3; | 1232 | gcry_mpi_point_t **tltb3; |
1232 | 1233 | ||
1233 | ad->gamma3 = smc_init3 (ad->n, ad->n, ad->k); | 1234 | ad->gamma3 = smc_init3 (ad->n, ad->n, ad->k); |
1234 | brandt_assert (ad->gamma3); | 1235 | brandt_assert (ad->gamma3); |
@@ -1452,7 +1453,7 @@ quit: | |||
1452 | void | 1453 | void |
1453 | fp_priv_prep_decryption (struct BRANDT_Auction *ad) | 1454 | fp_priv_prep_decryption (struct BRANDT_Auction *ad) |
1454 | { | 1455 | { |
1455 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); | 1456 | gcry_mpi_point_t tmp = gcry_mpi_point_new (0); |
1456 | 1457 | ||
1457 | ad->phi3 = smc_init3 (ad->n, ad->n, ad->k); | 1458 | ad->phi3 = smc_init3 (ad->n, ad->n, ad->k); |
1458 | brandt_assert (ad->phi3); | 1459 | brandt_assert (ad->phi3); |
@@ -1682,10 +1683,10 @@ fp_priv_recv_decryption_bidder (struct BRANDT_Auction *ad, | |||
1682 | ec_point_parse (phi, (struct ec_mpi *)cur); | 1683 | ec_point_parse (phi, (struct ec_mpi *)cur); |
1683 | proof2 = (struct proof_2dle *)(cur + sizeof (struct ec_mpi)); | 1684 | proof2 = (struct proof_2dle *)(cur + sizeof (struct ec_mpi)); |
1684 | if (smc_zkp_2dle_check (phi, | 1685 | if (smc_zkp_2dle_check (phi, |
1685 | ad->y[h], | 1686 | ad->y[h], |
1686 | ad->phi3[h][i][j], | 1687 | ad->phi3[h][i][j], |
1687 | ec_gen, | 1688 | ec_gen, |
1688 | proof2)) | 1689 | proof2)) |
1689 | { | 1690 | { |
1690 | weprintf ("wrong zkp2 for phi, y received from seller"); | 1691 | weprintf ("wrong zkp2 for phi, y received from seller"); |
1691 | goto quit; | 1692 | goto quit; |
@@ -1717,8 +1718,9 @@ fp_priv_recv_decryption (struct BRANDT_Auction *ad, | |||
1717 | } | 1718 | } |
1718 | 1719 | ||
1719 | 1720 | ||
1720 | struct BRANDT_Result *fp_priv_determine_outcome (struct BRANDT_Auction *ad, | 1721 | struct BRANDT_Result * |
1721 | uint16_t *len) | 1722 | fp_priv_determine_outcome (struct BRANDT_Auction *ad, |
1723 | uint16_t *len) | ||
1722 | { | 1724 | { |
1723 | struct BRANDT_Result *ret; | 1725 | struct BRANDT_Result *ret; |
1724 | int32_t price = -1; | 1726 | int32_t price = -1; |
@@ -1762,7 +1764,7 @@ struct BRANDT_Result *fp_priv_determine_outcome (struct BRANDT_Auction *ad, | |||
1762 | if (-1 == winner || -1 == price) | 1764 | if (-1 == winner || -1 == price) |
1763 | return NULL; | 1765 | return NULL; |
1764 | 1766 | ||
1765 | ret = GNUNET_new(struct BRANDT_Result); | 1767 | ret = GNUNET_new (struct BRANDT_Result); |
1766 | ret->bidder = winner; | 1768 | ret->bidder = winner; |
1767 | ret->price = price; | 1769 | ret->price = price; |
1768 | ret->status = BRANDT_bidder_won; | 1770 | ret->status = BRANDT_bidder_won; |