Skip to content

Commit

Permalink
docstrings: Reflect changes to exceptions in participant_step docs
Browse files Browse the repository at this point in the history
  • Loading branch information
real-or-random committed Dec 9, 2024
1 parent 67f5118 commit 121b946
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
24 changes: 10 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,8 @@ Perform a participant's first step of a ChillDKG session.
`hostpubkeys`.
- `SecretKeyError` - If the length of `hostseckey` is not 32 bytes.
- `FaultyParticipantOrCoordinatorError` - If `hostpubkeys[i]` is not a valid
public key for some `i`, which is indicated in the exception.
public key for some `i`, which is indicated in the exception. See
the documentation of the exception for further details.
- `DuplicateHostpubkeyError` - If `hostpubkeys` contains duplicates.
- `ThresholdError` - If `1 <= t <= len(hostpubkeys)` does not hold.
- `OverflowError` - If `t >= 2^32` (so `t` cannot be serialized in 4 bytes).
Expand Down Expand Up @@ -791,19 +792,14 @@ Perform a participant's second step of a ChillDKG session.
*Raises*:

- `SecretKeyError` - If the length of `hostseckey` is not 32 bytes.
FIXME
- `FaultyParticipantOrCoordinatorError` - If `cmsg1` is invalid. This can
happen if another participant has sent an invalid message to the
coordinator, or if the coordinator has sent an invalid `cmsg1`.

Further information is provided as part of the exception, including
a hint about which party might be to blame for the problem. The hint
should not be trusted and should be used only for debugging. In
particular, the hint may point at the wrong party, e.g., if the
coordinator is malicious or network connections are unreliable, and
as a consequence, the caller should not conclude that the party
hinted at is malicious.
- `UnknownFaultyParticipantOrCoordinatorError` - TODO
- `FaultyParticipantOrCoordinatorError` - If another known participant or the
coordinator is faulty. See the documentation of the exception for
further details.
- `UnknownFaultyParticipantOrCoordinatorError` - If another unknown
participant or the coordinator is faulty, but running the optional
blame step of the protocol is necessary to determine a suspected
participant. See the documentation of the exception for further
details.

#### participant\_finalize

Expand Down
24 changes: 10 additions & 14 deletions python/chilldkg_ref/chilldkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,8 @@ def participant_step1(
`hostpubkeys`.
SecretKeyError: If the length of `hostseckey` is not 32 bytes.
FaultyParticipantOrCoordinatorError: If `hostpubkeys[i]` is not a valid
public key for some `i`, which is indicated in the exception.
public key for some `i`, which is indicated in the exception. See
the documentation of the exception for further details.
DuplicateHostpubkeyError: If `hostpubkeys` contains duplicates.
ThresholdError: If `1 <= t <= len(hostpubkeys)` does not hold.
OverflowError: If `t >= 2^32` (so `t` cannot be serialized in 4 bytes).
Expand Down Expand Up @@ -462,19 +463,14 @@ def participant_step2(
Raises:
SecretKeyError: If the length of `hostseckey` is not 32 bytes.
FIXME
FaultyParticipantOrCoordinatorError: If `cmsg1` is invalid. This can
happen if another participant has sent an invalid message to the
coordinator, or if the coordinator has sent an invalid `cmsg1`.
Further information is provided as part of the exception, including
a hint about which party might be to blame for the problem. The hint
should not be trusted and should be used only for debugging. In
particular, the hint may point at the wrong party, e.g., if the
coordinator is malicious or network connections are unreliable, and
as a consequence, the caller should not conclude that the party
hinted at is malicious.
UnknownFaultyParticipantOrCoordinatorError: TODO
FaultyParticipantOrCoordinatorError: If another known participant or the
coordinator is faulty. See the documentation of the exception for
further details.
UnknownFaultyParticipantOrCoordinatorError: If another unknown
participant or the coordinator is faulty, but running the optional
blame step of the protocol is necessary to determine a suspected
participant. See the documentation of the exception for further
details.
"""
params, idx, enc_state = state1
enc_cmsg, enc_secshares = cmsg1
Expand Down

0 comments on commit 121b946

Please sign in to comment.