@@ -13,6 +13,7 @@ use proof_essentials::{
13
13
} ,
14
14
} ;
15
15
use serde:: { Deserialize , Serialize } ;
16
+ use wasm_bindgen:: prelude:: * ;
16
17
17
18
// Choose elliptic curve setting
18
19
// And instantiate concrete type for our card protocol
@@ -23,6 +24,7 @@ type CardProtocol<'a> = discrete_log_cards::DLCards<'a, Curve>;
23
24
type Enc = ElGamal < Curve > ;
24
25
type Comm = PedersenCommitment < Curve > ;
25
26
27
+ #[ wasm_bindgen]
26
28
#[ derive( Deserialize , Serialize ) ]
27
29
pub struct CardParameters (
28
30
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -53,6 +55,7 @@ pub type PlayerPublicKey = discrete_log_cards::PublicKey<Curve>;
53
55
pub type PlayerSecretKey = discrete_log_cards:: PlayerSecretKey < Curve > ;
54
56
pub type AggregatePublicKey = discrete_log_cards:: PublicKey < Curve > ;
55
57
58
+ #[ wasm_bindgen]
56
59
#[ derive( Clone , Copy , Eq , Hash , PartialEq , Debug , Serialize , Deserialize ) ]
57
60
pub struct Card (
58
61
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -69,6 +72,7 @@ impl From<Card> for discrete_log_cards::Card<Curve> {
69
72
}
70
73
}
71
74
75
+ #[ wasm_bindgen]
72
76
#[ derive( Clone , Copy , Eq , Hash , PartialEq , Debug , Serialize , Deserialize ) ]
73
77
pub struct MaskedCard (
74
78
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -90,6 +94,7 @@ impl<'a> From<&'a MaskedCard> for &'a discrete_log_cards::MaskedCard<Curve> {
90
94
}
91
95
}
92
96
97
+ #[ wasm_bindgen]
93
98
#[ derive( Clone , Copy , Eq , Hash , PartialEq , Debug , Serialize , Deserialize ) ]
94
99
pub struct RevealToken (
95
100
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -106,6 +111,7 @@ impl From<RevealToken> for discrete_log_cards::RevealToken<Curve> {
106
111
}
107
112
}
108
113
114
+ #[ wasm_bindgen]
109
115
#[ derive( Copy , Clone , Deserialize , Serialize ) ]
110
116
pub struct ProofKeyOwnership (
111
117
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -122,6 +128,7 @@ impl From<ProofKeyOwnership> for schnorr_identification::proof::Proof<Curve> {
122
128
}
123
129
}
124
130
131
+ #[ wasm_bindgen]
125
132
#[ derive( Clone , Copy , Eq , Hash , PartialEq , Debug , Deserialize , Serialize ) ]
126
133
pub struct ProofReveal (
127
134
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -138,6 +145,7 @@ impl From<ProofReveal> for chaum_pedersen_dl_equality::proof::Proof<Curve> {
138
145
}
139
146
}
140
147
148
+ #[ wasm_bindgen]
141
149
#[ derive( Deserialize , Serialize ) ]
142
150
pub struct ProofShuffle (
143
151
#[ serde( serialize_with = "ark_se" , deserialize_with = "ark_de" ) ]
@@ -159,6 +167,7 @@ impl<'a> From<&'a ProofShuffle> for &'a shuffle::proof::Proof<Scalar, Enc, Comm>
159
167
}
160
168
}
161
169
170
+ #[ wasm_bindgen]
162
171
//pub struct ProofMasking(chaum_pedersen_dl_equality::proof::Proof<Curve>);
163
172
#[ derive( Clone , Copy , Eq , Hash , PartialEq , Debug , Deserialize , Serialize ) ]
164
173
pub struct ProofRemasking (
@@ -176,6 +185,7 @@ impl From<ProofRemasking> for chaum_pedersen_dl_equality::proof::Proof<Curve> {
176
185
}
177
186
}
178
187
188
+ //#[wasm_bindgen]
179
189
#[ derive( Serialize , Deserialize ) ]
180
190
pub struct RevealedToken {
181
191
pub token : RevealToken ,
0 commit comments