diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-03 01:28:51 +0200 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2016-08-03 01:28:51 +0200 |
commit | fd52f708ddb8a985d785fac9c51c8da3fe2ff937 (patch) | |
tree | 6d77e0abef948610ec0046d2f892fdb5f16d815a /brandt.c | |
parent | 017a90a88cf17a680f82aa99e733785709c05613 (diff) | |
download | libbrandt-fd52f708ddb8a985d785fac9c51c8da3fe2ff937.tar.gz libbrandt-fd52f708ddb8a985d785fac9c51c8da3fe2ff937.zip |
update tests
Diffstat (limited to 'brandt.c')
-rw-r--r-- | brandt.c | 66 |
1 files changed, 0 insertions, 66 deletions
@@ -26,72 +26,6 @@ | |||
26 | #include "util.h" | 26 | #include "util.h" |
27 | 27 | ||
28 | 28 | ||
29 | typedef int | ||
30 | (*msg_recv)(struct BRANDT_Auction *ad, | ||
31 | const unsigned char *buf, | ||
32 | size_t buflen, | ||
33 | uint16_t sender); | ||
34 | |||
35 | |||
36 | enum { | ||
37 | auction_firstPrice, | ||
38 | auction_mPlusFirstPrice, | ||
39 | auction_last | ||
40 | }; | ||
41 | |||
42 | |||
43 | enum { | ||
44 | outcome_private, | ||
45 | outcome_public, | ||
46 | outcome_last | ||
47 | }; | ||
48 | |||
49 | |||
50 | /** | ||
51 | * stores the function pointers to receive functions for each state. | ||
52 | * | ||
53 | * The first index denotes if a first price auction or a M+1st price auction is | ||
54 | * used. If it is 0, it is a first price auction, if it is 1, it is a M+1st | ||
55 | * price auction. | ||
56 | * | ||
57 | * The second index denotes if the outcome should be public or private. A value | ||
58 | * of 0 means a private outcome, while a value of 1 means public outcome. | ||
59 | */ | ||
60 | static msg_recv handler_in[auction_last][outcome_last][msg_last] = | ||
61 | { | ||
62 | [auction_firstPrice] = | ||
63 | { | ||
64 | [outcome_private] = | ||
65 | { | ||
66 | [msg_init] = &smc_recv_keyshare, | ||
67 | [msg_bid] = &smc_recv_encrypted_bid, | ||
68 | [msg_outcome] = &fp_priv_recv_outcome, | ||
69 | [msg_decrypt] = &fp_priv_recv_decryption, | ||
70 | }, | ||
71 | [outcome_public] = | ||
72 | { | ||
73 | [msg_init] = &smc_recv_keyshare, | ||
74 | [msg_bid] = &smc_recv_encrypted_bid, | ||
75 | [msg_outcome] = &fp_pub_recv_outcome, | ||
76 | [msg_decrypt] = &fp_pub_recv_decryption, | ||
77 | } | ||
78 | }, | ||
79 | [auction_mPlusFirstPrice] = | ||
80 | { | ||
81 | [outcome_private] = | ||
82 | { | ||
83 | [msg_init] = &smc_recv_keyshare, | ||
84 | [msg_bid] = &smc_recv_encrypted_bid, | ||
85 | }, | ||
86 | [outcome_public] = | ||
87 | { | ||
88 | [msg_init] = &smc_recv_keyshare, | ||
89 | [msg_bid] = &smc_recv_encrypted_bid, | ||
90 | } | ||
91 | } | ||
92 | }; | ||
93 | |||
94 | |||
95 | void | 29 | void |
96 | BRANDT_init (struct GNUNET_CRYPTO_EccDlogContext *dlogctx) | 30 | BRANDT_init (struct GNUNET_CRYPTO_EccDlogContext *dlogctx) |
97 | { | 31 | { |