4
4
#include "secp256k1.h"
5
5
6
6
/** This module implements the sign-to-contract scheme for ECDSA signatures, as
7
- * well as the "ECDSA Anti-Klepto Protocol" that is based on sign-to-contract
7
+ * well as the "ECDSA Anti-Exfil Protocol" that is based on sign-to-contract
8
8
* and is specified further down. The sign-to-contract scheme allows creating a
9
9
* signature that also commits to some data. This works by offsetting the public
10
10
* nonce point of the signature R by hash(R, data)*G where G is the secp256k1
@@ -97,9 +97,9 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_s2c_verify_commit
97
97
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 );
98
98
99
99
100
- /** ECDSA Anti-Klepto Protocol
100
+ /** ECDSA Anti-Exfil Protocol
101
101
*
102
- * The ecdsa_anti_klepto_ * functions can be used to prevent a signing device from
102
+ * The ecdsa_anti_exfil_ * functions can be used to prevent a signing device from
103
103
* exfiltrating the secret signing keys through biased signature nonces. The general
104
104
* idea is that a host provides additional randomness to the signing device client
105
105
* and the client commits to the randomness in the nonce using sign-to-contract.
@@ -113,9 +113,9 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_s2c_verify_commit
113
113
* keys, or the signing device to bias the nonce despite the host's contributions,
114
114
* the host and client must engage in a commit-reveal protocol as follows:
115
115
* 1. The host draws randomness `rho` and computes a sha256 commitment to it using
116
- * `secp256k1_ecdsa_anti_klepto_host_commit `. It sends this to the signing device.
116
+ * `secp256k1_ecdsa_anti_exfil_host_commit `. It sends this to the signing device.
117
117
* 2. The signing device computes a public nonce `R` using the host's commitment
118
- * as auxiliary randomness, using `secp256k1_ecdsa_anti_klepto_signer_commit `.
118
+ * as auxiliary randomness, using `secp256k1_ecdsa_anti_exfil_signer_commit `.
119
119
* The signing device sends the resulting `R` to the host as a s2c_opening.
120
120
*
121
121
* If, at any point from this step onward, the hardware device fails, it is
@@ -135,10 +135,10 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_s2c_verify_commit
135
135
* EVER, they should change hardware vendors and perhaps sweep their coins.
136
136
*
137
137
* 3. The host replies with `rho` generated in step 1.
138
- * 4. The device signs with `secp256k1_anti_klepto_sign `, using `rho` as `host_data32`,
138
+ * 4. The device signs with `secp256k1_anti_exfil_sign `, using `rho` as `host_data32`,
139
139
* and sends the signature to the host.
140
140
* 5. The host verifies that the signature's public nonce matches the opening from
141
- * step 2 and its original randomness `rho`, using `secp256k1_anti_klepto_host_verify `.
141
+ * step 2 and its original randomness `rho`, using `secp256k1_anti_exfil_host_verify `.
142
142
*
143
143
* Rationale:
144
144
* - The reason for having a host commitment is to allow the signing device to
@@ -154,7 +154,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_s2c_verify_commit
154
154
* maintain any state about the progress of the protocol.
155
155
*/
156
156
157
- /** Create the initial host commitment to `rho`. Part of the ECDSA Anti-Klepto Protocol.
157
+ /** Create the initial host commitment to `rho`. Part of the ECDSA Anti-Exfil Protocol.
158
158
*
159
159
* Returns 1 on success, 0 on failure.
160
160
* Args: ctx: pointer to a context object (cannot be NULL)
@@ -164,13 +164,13 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdsa_s2c_verify_commit
164
164
* be revealed to the client until after the host has received the client
165
165
* commitment.
166
166
*/
167
- SECP256K1_API int secp256k1_ecdsa_anti_klepto_host_commit (
167
+ SECP256K1_API int secp256k1_ecdsa_anti_exfil_host_commit (
168
168
const secp256k1_context * ctx ,
169
169
unsigned char * rand_commitment32 ,
170
170
const unsigned char * rand32
171
171
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 );
172
172
173
- /** Compute signer's original nonce. Part of the ECDSA Anti-Klepto Protocol.
173
+ /** Compute signer's original nonce. Part of the ECDSA Anti-Exfil Protocol.
174
174
*
175
175
* Returns 1 on success, 0 on failure.
176
176
* Args: ctx: pointer to a context object, initialized for signing (cannot be NULL)
@@ -180,7 +180,7 @@ SECP256K1_API int secp256k1_ecdsa_anti_klepto_host_commit(
180
180
* seckey32: the 32-byte secret key used for signing (cannot be NULL)
181
181
* rand_commitment32: the 32-byte randomness commitment from the host (cannot be NULL)
182
182
*/
183
- SECP256K1_API int secp256k1_ecdsa_anti_klepto_signer_commit (
183
+ SECP256K1_API int secp256k1_ecdsa_anti_exfil_signer_commit (
184
184
const secp256k1_context * ctx ,
185
185
secp256k1_ecdsa_s2c_opening * s2c_opening ,
186
186
const unsigned char * msg32 ,
@@ -189,7 +189,7 @@ SECP256K1_API int secp256k1_ecdsa_anti_klepto_signer_commit(
189
189
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
190
190
191
191
/** Same as secp256k1_ecdsa_sign, but commits to host randomness in the nonce. Part of the
192
- * ECDSA Anti-Klepto Protocol.
192
+ * ECDSA Anti-Exfil Protocol.
193
193
*
194
194
* Returns: 1: signature created
195
195
* 0: the nonce generation function failed, or the private key was invalid.
@@ -199,15 +199,15 @@ SECP256K1_API int secp256k1_ecdsa_anti_klepto_signer_commit(
199
199
* seckey: pointer to a 32-byte secret key (cannot be NULL)
200
200
* host_data32: pointer to 32-byte host-provided randomness (cannot be NULL)
201
201
*/
202
- SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_anti_klepto_sign (
202
+ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_anti_exfil_sign (
203
203
const secp256k1_context * ctx ,
204
204
secp256k1_ecdsa_signature * sig ,
205
205
const unsigned char * msg32 ,
206
206
const unsigned char * seckey ,
207
207
const unsigned char * host_data32
208
208
) SECP256K1_ARG_NONNULL (1 ) SECP256K1_ARG_NONNULL (2 ) SECP256K1_ARG_NONNULL (3 ) SECP256K1_ARG_NONNULL (4 ) SECP256K1_ARG_NONNULL (5 );
209
209
210
- /** Verify a signature was correctly constructed using the ECDSA Anti-Klepto Protocol.
210
+ /** Verify a signature was correctly constructed using the ECDSA Anti-Exfil Protocol.
211
211
*
212
212
* Returns: 1: the signature is valid and contains a commitment to host_data32
213
213
* 0: incorrect opening
@@ -218,7 +218,7 @@ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_anti_klepto_sign(
218
218
* host_data32: the 32-byte data provided by the host (cannot be NULL)
219
219
* opening: the s2c opening provided by the signer (cannot be NULL)
220
220
*/
221
- SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_anti_klepto_host_verify (
221
+ SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_anti_exfil_host_verify (
222
222
const secp256k1_context * ctx ,
223
223
const secp256k1_ecdsa_signature * sig ,
224
224
const unsigned char * msg32 ,
0 commit comments