Skip to content

Commit

Permalink
Review generate_shares function to use names as in the IETF proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
matteonardelli committed Nov 27, 2023
1 parent a22b83a commit 9b078c7
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 98 deletions.
42 changes: 21 additions & 21 deletions include/secp256k1_frost.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,29 +179,29 @@ SECP256K1_API void secp256k1_frost_keypair_destroy(secp256k1_frost_keypair *keyp
* secp256k1_frost_keygen_dkg_begin() is performed by each participant to initialize a Pedersen
*
* This function assumes there is an additional layer which performs the
* distribution of shares to their intended participants.
* distribution of secret_key_shares to their intended participants.
*
* Note that while secp256k1_frost_keygen_dkg_begin() returns Shares, these shares
* Note that while secp256k1_frost_keygen_dkg_begin() returns Shares, these secret_key_shares
* should be sent *after* participants have exchanged commitments via
* secp256k1_frost_keygen_dkg_commitment_validate(). So, the caller of
* secp256k1_frost_keygen_dkg_begin() should store shares until after
* secp256k1_frost_keygen_dkg_begin() should store secret_key_shares until after
* secp256k1_frost_keygen_dkg_commitment_validate() is complete, and then
* exchange shares via secp256k1_frost_keygen_dkg_finalize().
* exchange secret_key_shares via secp256k1_frost_keygen_dkg_finalize().
*
* Returns 1 on success, 0 on failure.
* Args: ctx: pointer to a context object, initialized for signing.
* Out: dkg_commitment: pointer to a secp256k1_frost_vss_commitments to store the DKG first phase result.
* shares: pointer to an array of num_shares shares
* In: num_participants: number of participants and shares that will be produced.
* threshold: validity threshold for signatures.
* generator_index: index of the participant running the DKG.
* context: pointer to a char array containing DKG context tag.
* context_length: length of the char array with the DKG context.
* Out: vss_commitments: pointer to a secp256k1_frost_vss_commitments to store the DKG first phase result.
* secret_key_shares: pointer to an array of num_shares secret_key_shares
* In: num_participants: number of participants and secret_key_shares that will be produced.
* threshold: validity threshold for signatures.
* generator_index: index of the participant running the DKG.
* context: pointer to a char array containing DKG context tag.
* context_length: length of the char array with the DKG context.
*/
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_keygen_dkg_begin(
const secp256k1_context *ctx,
secp256k1_frost_vss_commitments *dkg_commitment,
secp256k1_frost_keygen_secret_share *shares,
secp256k1_frost_vss_commitments *vss_commitments,
secp256k1_frost_keygen_secret_share *secret_key_shares,
uint32_t num_participants,
uint32_t threshold,
uint32_t generator_index,
Expand Down Expand Up @@ -257,20 +257,20 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_keygen_dkg_finali
/*
* secp256k1_frost_keygen_with_dealer() allows to create keygen for each participant.
* This function is intended to be executed by a trusted dealer that generates and
* distributes the secret shares.
* distributes the secret secret_key_shares.
*
* Returns 1 on success, 0 on failure.
* Args: ctx: pointer to a context object, initialized for signing.
* Out: share_commitment: pointer to a secp256k1_frost_vss_commitments to store the dealer commitments.
* shares: pointer to an array of num_shares shares
* keypair: pointer to a frost_keypair to store the generated keypairs.
* In: num_participants: number of participants and shares that will be produced.
* threshold: validity threshold for signatures.
* Out: vss_commitments: pointer to a secp256k1_frost_vss_commitments to store the dealer commitments.
* secret_key_shares: pointer to an array of num_shares secret_key_shares
* keypair: pointer to a frost_keypair to store the generated keypairs.
* In: num_participants: number of participants and secret_key_shares that will be produced.
* threshold: validity threshold for signatures.
*/
SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_frost_keygen_with_dealer(
const secp256k1_context *ctx,
secp256k1_frost_vss_commitments *share_commitment,
secp256k1_frost_keygen_secret_share *shares,
secp256k1_frost_vss_commitments *vss_commitments,
secp256k1_frost_keygen_secret_share *secret_key_shares,
secp256k1_frost_keypair *keypairs,
uint32_t num_participants,
uint32_t threshold
Expand Down
Loading

0 comments on commit 9b078c7

Please sign in to comment.