Skip to content

Commit

Permalink
reference: Rename _step to _step1 if there's step2
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed May 23, 2024
1 parent 402e315 commit 57cc542
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion reference/chilldkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def participant_step1(
(hostpubkeys, t) = params

participant_idx = hostpubkeys.index(hostpubkey)
enc_state, enc_pmsg = encpedpop.participant_step(
enc_state, enc_pmsg = encpedpop.participant_step1(
seed, t, hostseckey, hostpubkeys, participant_idx
)
state1 = ParticipantState1(params, participant_idx, enc_state)
Expand Down
4 changes: 2 additions & 2 deletions reference/encpedpop.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def session_seed(seed: bytes, enckeys: List[bytes], t: int) -> Tuple[bytes, byte
return seed_, enc_context


def participant_step(
def participant_step1(
seed: bytes, t: int, deckey: bytes, enckeys: List[bytes], participant_idx: int
) -> Tuple[ParticipantState, ParticipantMsg]:
assert t < 2 ** (4 * 8)
Expand All @@ -83,7 +83,7 @@ def participant_step(
# encrypted under wrong enckeys.
seed_, enc_context = session_seed(seed, enckeys, t)

simpl_state, simpl_pmsg, shares = simplpedpop.participant_step(
simpl_state, simpl_pmsg, shares = simplpedpop.participant_step1(
seed_, t, n, participant_idx
)
assert len(shares) == n
Expand Down
2 changes: 1 addition & 1 deletion reference/simplpedpop.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class ParticipantState(NamedTuple):
# ChillDKG will take care of invoking the equality check protocol.


def participant_step(
def participant_step1(
seed: bytes, t: int, n: int, participant_idx: int
) -> Tuple[ParticipantState, ParticipantMsg, List[Scalar]]:
"""
Expand Down
4 changes: 2 additions & 2 deletions reference/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def simulate_simplpedpop(seeds, t) -> List[Tuple[simplpedpop.DKGOutput, bytes]]:
n = len(seeds)
prets = []
for i in range(n):
prets += [simplpedpop.participant_step(seeds[i], t, n, i)]
prets += [simplpedpop.participant_step1(seeds[i], t, n, i)]
pmsgs = [ret[1] for ret in prets]

cmsg, cout, ceq = simplpedpop.coordinator_step(pmsgs, t, n)
Expand Down Expand Up @@ -61,7 +61,7 @@ def simulate_encpedpop(seeds, t) -> List[Tuple[simplpedpop.DKGOutput, bytes]]:
enckeys = [pret[1] for pret in enc_prets0]
for i in range(n):
deckey = enc_prets0[i][0]
enc_prets1 += [encpedpop.participant_step(seeds[i], t, deckey, enckeys, i)]
enc_prets1 += [encpedpop.participant_step1(seeds[i], t, deckey, enckeys, i)]

pmsgs = [pmsg for (_, pmsg) in enc_prets1]
pstates = [pstate for (pstate, _) in enc_prets1]
Expand Down

0 comments on commit 57cc542

Please sign in to comment.