Skip to content

Commit d3ef472

Browse files
committed
frost trusted dealer: improve doc based upon PR feedback
1 parent e94367c commit d3ef472

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

include/secp256k1_frost.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ typedef struct {
102102
/** Parse a signer's public nonce.
103103
*
104104
* Returns: 1 when the nonce could be parsed, 0 otherwise.
105-
* Args: ctx: a secp256k1 context object
105+
* Args: ctx: pointer to a context object
106106
* Out: nonce: pointer to a nonce object
107107
* In: in66: pointer to the 66-byte nonce to be parsed
108108
*/
@@ -115,7 +115,7 @@ SECP256K1_API int secp256k1_frost_pubnonce_parse(
115115
/** Serialize a signer's public nonce
116116
*
117117
* Returns: 1 when the nonce could be serialized, 0 otherwise
118-
* Args: ctx: a secp256k1 context object
118+
* Args: ctx: pointer to a context object
119119
* Out: out66: pointer to a 66-byte array to store the serialized nonce
120120
* In: nonce: pointer to the nonce
121121
*/
@@ -128,7 +128,7 @@ SECP256K1_API int secp256k1_frost_pubnonce_serialize(
128128
/** Serialize a FROST partial signature
129129
*
130130
* Returns: 1 when the signature could be serialized, 0 otherwise
131-
* Args: ctx: a secp256k1 context object
131+
* Args: ctx: pointer to a context object
132132
* Out: out32: pointer to a 32-byte array to store the serialized signature
133133
* In: sig: pointer to the signature
134134
*/
@@ -141,7 +141,7 @@ SECP256K1_API int secp256k1_frost_partial_sig_serialize(
141141
/** Parse a FROST partial signature.
142142
*
143143
* Returns: 1 when the signature could be parsed, 0 otherwise.
144-
* Args: ctx: a secp256k1 context object
144+
* Args: ctx: pointer to a context object
145145
* Out: sig: pointer to a signature object
146146
* In: in32: pointer to the 32-byte signature to be parsed
147147
*
@@ -158,7 +158,7 @@ SECP256K1_API int secp256k1_frost_partial_sig_parse(
158158
/** Serialize a FROST share
159159
*
160160
* Returns: 1 when the share could be serialized, 0 otherwise
161-
* Args: ctx: a secp256k1 context object
161+
* Args: ctx: pointer to a context object
162162
* Out: out32: pointer to a 32-byte array to store the serialized share
163163
* In: share: pointer to the share
164164
*/
@@ -171,7 +171,7 @@ SECP256K1_API int secp256k1_frost_share_serialize(
171171
/** Parse a FROST share.
172172
*
173173
* Returns: 1 when the share could be parsed, 0 otherwise.
174-
* Args: ctx: a secp256k1 context object
174+
* Args: ctx: pointer to a context object
175175
* Out: share: pointer to a share object
176176
* In: in32: pointer to the 32-byte share to be parsed
177177
*/
@@ -181,27 +181,27 @@ SECP256K1_API int secp256k1_frost_share_parse(
181181
const unsigned char *in32
182182
) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3);
183183

184-
/** Creates key generation shares
184+
/** Creates key shares
185185
*
186186
* To generate a key, a trusted dealer generates a share for each other
187187
* participant.
188188
*
189-
* Each participant _must_ have a secure channel with the trusted dealer with
190-
* which they can transmit shares to each other.
189+
* The trusted dealer must transmit shares over secure channels to
190+
* participants.
191191
*
192-
* A new seed32 _must_ be used for each key generation session. The trusted
193-
* dealer must NOT REUSE their respective seed32 again for subsequent key
194-
* generation sessions. If a trusted dealer fails to complete this session or
195-
* start a new session to generate a new key, they must NOT REUSE their
196-
* respective seed32 again, but instead generate a new one. It is recommended
197-
* to always choose seed32 uniformly at random to avoid their reuse.
192+
* Each call to this function must have a UNIQUE and uniformly RANDOM seed32
193+
* that must that must NOT BE REUSED in subsequent calls to this function and
194+
* must be KEPT SECRET (even from other participants).
198195
*
199196
* Returns: 0 if the arguments are invalid, 1 otherwise
200197
* Args: ctx: pointer to a context object
201-
* Out: shares: pointer to the key generation shares
198+
* Out: shares: pointer to the key shares
202199
* pubshares: pointer to the public verification shares
203200
* pk: pointer to the x-only public key
204-
* In: seed32: a 32-byte seed as explained above
201+
* In: seed32: a 32-byte random seed as explained above. Must be
202+
* unique to this call to
203+
* secp256k1_frost_shares_trusted_gen and must be
204+
* uniformly random.
205205
* threshold: the minimum number of signers required to produce a
206206
* signature
207207
* n_participants: the total number of participants

src/modules/frost/keygen_impl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int secp256k1_frost_shares_trusted_gen(const secp256k1_context *ctx, secp256k1_f
124124
secp256k1_sha256_write(&sha, polygen, 16);
125125
secp256k1_sha256_finalize(&sha, polygen);
126126

127-
/* Derive share */
127+
/* Derive shares */
128128
/* See draft-irtf-cfrg-frost-08#appendix-C.1 */
129129
for (i = 0; i < n_participants; i++) {
130130
secp256k1_scalar share_i, idx;

0 commit comments

Comments
 (0)