Skip to content

Commit

Permalink
python: Rename session_seed -> simpl_seed for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Oct 2, 2024
1 parent 1c54492 commit aee1329
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions python/chilldkg_ref/chilldkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ def recover(

# Decrypt share
enc_context = encpedpop.serialize_enc_context(t, hostpubkeys)
session_seed = encpedpop.derive_session_seed(
simpl_seed = encpedpop.derive_simpl_seed(
hostseckey, pubnonces[idx], enc_context
)
secshare = encpedpop.decrypt_sum(
Expand All @@ -663,7 +663,7 @@ def recover(
)

# Derive my_share
vss = VSS.generate(session_seed, t)
vss = VSS.generate(simpl_seed, t)
my_share = vss.secshare_for(idx)
secshare += my_share

Expand Down
10 changes: 5 additions & 5 deletions python/chilldkg_ref/encpedpop.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def serialize_enc_context(t: int, enckeys: List[bytes]) -> bytes:
return t.to_bytes(4, byteorder="big") + b"".join(enckeys)


def derive_session_seed(seed: bytes, pubnonce: bytes, enc_context: bytes) -> bytes:
def derive_simpl_seed(seed: bytes, pubnonce: bytes, enc_context: bytes) -> bytes:
return prf(seed, "encpedpop seed", pubnonce + enc_context)


Expand All @@ -147,12 +147,12 @@ def participant_step1(
# to deserialize it again, which involves computing a square root to obtain
# the y coordinate.
pubnonce = pubkey_gen_plain(secnonce)
# Add enc_context again to the derivation of the session seed, just in case
# someone derives secnonce differently.
session_seed = derive_session_seed(seed, pubnonce, enc_context)
# Add enc_context again to the derivation of the SimplPedPop seed, just in
# case someone derives secnonce differently.
simpl_seed = derive_simpl_seed(seed, pubnonce, enc_context)

simpl_state, simpl_pmsg, shares = simplpedpop.participant_step1(
session_seed, t, n, idx
simpl_seed, t, n, idx
)
assert len(shares) == n

Expand Down

0 comments on commit aee1329

Please sign in to comment.