Skip to content

Commit f1969c2

Browse files
reference: Get rid of pre_prefinalize terminology
1 parent 60265a3 commit f1969c2

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

reference/chilldkg.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def participant_step2(
187187
(params, idx, enc_state) = state1
188188
enc_cmsg, enc_shares_sums = cmsg
189189

190-
dkg_output, eq_input = encpedpop.participant_pre_finalize(
190+
dkg_output, eq_input = encpedpop.participant_step2(
191191
enc_state, enc_cmsg, enc_shares_sums[idx]
192192
)
193193
# Include the enc_shares in eq_input to ensure that participants agree on all
@@ -260,9 +260,9 @@ def coordinator_step(
260260

261261

262262
def coordinator_finalize(
263-
state: CoordinatorState, pmsgs2: List[ParticipantMsg2]
263+
state2: CoordinatorState, pmsgs2: List[ParticipantMsg2]
264264
) -> Tuple[CoordinatorMsg2, DKGOutput, RecoveryData]:
265-
(params, eq_input, dkg_output) = state
265+
(params, eq_input, dkg_output) = state2
266266
cert = certifying_eq_coordinator_step([pmsg2.sig for pmsg2 in pmsgs2])
267267
if not certifying_eq_verify(params.hostpubkeys, eq_input, cert):
268268
raise SessionNotFinalizedError

reference/encpedpop.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def participant_step(
108108
return state, pmsg
109109

110110

111-
def participant_pre_finalize(
111+
def participant_step2(
112112
state: ParticipantState,
113113
cmsg: CoordinatorMsg,
114114
enc_shares_sum: Scalar,
@@ -119,7 +119,7 @@ def participant_pre_finalize(
119119
enc_context = t.to_bytes(4, byteorder="big") + b"".join(enckeys)
120120
shares_sum = decrypt_sum(enc_shares_sum, deckey, enckeys, idx, enc_context)
121121
shares_sum += self_share
122-
dkg_output, eq_input = simplpedpop.participant_pre_finalize(
122+
dkg_output, eq_input = simplpedpop.participant_step2(
123123
simpl_state, simpl_cmsg, shares_sum
124124
)
125125
eq_input += b"".join(enckeys)

reference/simplpedpop.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def participant_step(
138138
return state, msg, shares
139139

140140

141-
def participant_pre_finalize(
141+
def participant_step2(
142142
state: ParticipantState,
143143
cmsg: CoordinatorMsg,
144144
shares_sum: Scalar,
@@ -193,7 +193,6 @@ def participant_pre_finalize(
193193
# Sum the commitments to the i-th coefficients from the given vss_commitments
194194
# for i > 0. This procedure is introduced by Pedersen in section 5.1 of
195195
# 'Non-Interactive and Information-Theoretic Secure Verifiable Secret Sharing'.
196-
# TODO Should this be called coordinator_pre_finalize? (same in encpedpop)
197196
def coordinator_step(
198197
pmsgs: List[ParticipantMsg], t: int, n: int
199198
) -> Tuple[CoordinatorMsg, DKGOutput, bytes]:

reference/tests.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def simulate_simplpedpop(seeds, t) -> List[Tuple[simplpedpop.DKGOutput, bytes]]:
4040
for i in range(n):
4141
shares_sum = Scalar.sum(*([pret[2][i] for pret in prets]))
4242
pre_finalize_rets += [
43-
simplpedpop.participant_pre_finalize(prets[i][0], cmsg, shares_sum)
43+
simplpedpop.participant_step2(prets[i][0], cmsg, shares_sum)
4444
]
4545
return pre_finalize_rets
4646

@@ -70,7 +70,7 @@ def simulate_encpedpop(seeds, t) -> List[Tuple[simplpedpop.DKGOutput, bytes]]:
7070
pre_finalize_rets = [(cout, ceq)]
7171
for i in range(n):
7272
pre_finalize_rets += [
73-
encpedpop.participant_pre_finalize(pstates[i], cmsg, enc_shares_sums[i])
73+
encpedpop.participant_step2(pstates[i], cmsg, enc_shares_sums[i])
7474
]
7575
return pre_finalize_rets
7676

0 commit comments

Comments
 (0)