Skip to content

Commit

Permalink
test: add proof of knowdlege and shares verification in BaseFrostTest
Browse files Browse the repository at this point in the history
  • Loading branch information
annalisacimatti committed Oct 25, 2023
1 parent b6e7975 commit f7a3558
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/functional/test_framework/test_framework_itcoin_frost.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,25 @@ def set_test_params(self, set_signet_challenge_as_extra_arg=True, tweak_public_k
for i in range(self.signet_num_signers):
p = FROST.Participant(index=i+1, threshold=self.signet_num_signatures, participants=self.signet_num_signers)
p.init_keygen()
p.generate_shares()
self.participants.append(p)

# proof of knowledge
for p in self.participants:
for i in self.participants:
if i != p:
assert_equal(p.verify_proof_of_knowledge(i.proof_of_knowledge, i.coefficient_commitments[0], i.index), True)

# shares generation
for p in self.participants:
p.generate_shares()

# shares verification
for i in self.participants:
for l in self.participants:
if i != l:
assert_equal(i.verify_share(l.shares[i.index -1], l.coefficient_commitments), True)

# computation of partial secrets
for p in self.participants:
p.aggregate_shares([participant.shares[p.index-1] for participant in self.participants if participant.index != p.index])

Expand Down

0 comments on commit f7a3558

Please sign in to comment.