File tree 1 file changed +44
-0
lines changed
1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -129,6 +129,50 @@ BOOST_AUTO_TEST_CASE(generate_verify)
129
129
for (const auto set_data : cover_set_data)
130
130
cover_sets[set_data.first ] = set_data.second .cover_set ;
131
131
BOOST_CHECK (SpendTransaction::verify (transaction, cover_sets));
132
+
133
+ // Produe a claim for this spend transaction
134
+ std::vector<unsigned char > claim_identifier = random_char_vector ();
135
+ std::vector<unsigned char > claim_message = random_char_vector ();
136
+ ChaumProof claim_proof;
137
+ SpendTransaction::proveClaim (
138
+ full_view_key,
139
+ spend_key,
140
+ transaction,
141
+ spend_coin_data,
142
+ claim_identifier,
143
+ claim_message,
144
+ claim_proof
145
+ );
146
+
147
+ // Verify the claim against the correct data
148
+ BOOST_CHECK (
149
+ SpendTransaction::verifyClaim (
150
+ transaction,
151
+ claim_identifier,
152
+ claim_message,
153
+ claim_proof
154
+ )
155
+ );
156
+
157
+ // (Fail to) verify the claim against an evil identifier
158
+ BOOST_CHECK (
159
+ !SpendTransaction::verifyClaim (
160
+ transaction,
161
+ random_char_vector (),
162
+ claim_message,
163
+ claim_proof
164
+ )
165
+ );
166
+
167
+ // (Fail to) verify the claim against an evil message
168
+ BOOST_CHECK (
169
+ !SpendTransaction::verifyClaim (
170
+ transaction,
171
+ claim_identifier,
172
+ random_char_vector (),
173
+ claim_proof
174
+ )
175
+ );
132
176
}
133
177
134
178
BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments