@@ -68,7 +68,7 @@ class SE05XClass
68
68
* @return 0 on Failure 1 on Success
69
69
*/
70
70
int generatePrivateKey (int keyID, byte keyBuf[], size_t keyBufMaxLen, size_t * keyLen);
71
-
71
+
72
72
/* * generatePublicKey
73
73
*
74
74
* Reads ECCurve_NIST_P256 public key from KeyID. Public key will be available
@@ -117,7 +117,7 @@ class SE05XClass
117
117
* @param[in] inLen Input data length
118
118
*
119
119
* @return 0 on Failure 1 on Success
120
- */
120
+ */
121
121
int updateSHA256 (const byte in[], size_t inLen);
122
122
123
123
/* * endSHA256
@@ -128,9 +128,9 @@ class SE05XClass
128
128
* @param[in,out] outLen Size of output data buffer, SHA256 length
129
129
*
130
130
* @return 0 on Failure 1 on Success
131
- */
131
+ */
132
132
int endSHA256 (byte out[], size_t * outLen);
133
-
133
+
134
134
/* * SHA256
135
135
*
136
136
* One-shot SHA256
@@ -142,15 +142,15 @@ class SE05XClass
142
142
* @param[out] outLen SHA256 length
143
143
*
144
144
* @return 0 on Failure 1 on Success
145
- */
145
+ */
146
146
int SHA256 (const byte in[], size_t inLen, byte out[], size_t outMaxLen, size_t * outLen);
147
147
148
148
/* * Sign
149
149
*
150
150
* Computes ECDSA signature using key stored in KeyID SE050 object.
151
151
* Output buffer is filled with the signature in DER format:
152
- *
153
- * | 0x30 | payloadsize 1 byte | 0x02 | R length 1 byte | padding 0x00 (if length 0x21) | R values 32 bytes
152
+ *
153
+ * | 0x30 | payloadsize 1 byte | 0x02 | R length 1 byte | padding 0x00 (if length 0x21) | R values 32 bytes
154
154
* | 0x02 | S length 1 byte | padding 0x00 (if length 0x21) | S values 32 bytes
155
155
*
156
156
* SHA256 -> private Key -> Signature
@@ -163,7 +163,7 @@ class SE05XClass
163
163
* @param[out] sigLen signature length
164
164
*
165
165
* @return 0 on Failure 1 on Success
166
- */
166
+ */
167
167
int Sign (int keyID, const byte hash[], size_t hashLen, byte sig[], size_t maxSigLen, size_t * sigLen);
168
168
169
169
/* * Verify
@@ -173,28 +173,28 @@ class SE05XClass
173
173
* Input SHA256
174
174
* ? Match ?
175
175
* Signature -> public Key -> Original SHA256
176
- *
176
+ *
177
177
* @param[in] keyID SE050 object ID containing the key
178
178
* @param[in] hash Input SHA256 used to compute the signature
179
179
* @param[in] hashLen SHA256 length
180
180
* @param[in] sig Input buffer containint the signature
181
181
* @param[in] sigLen signature length
182
182
*
183
183
* @return 0 on Failure (Not match) 1 on Success (Match)
184
- */
184
+ */
185
185
int Verify (int keyID, const byte hash[], size_t hashLen, const byte sig[],size_t sigLen);
186
186
187
187
/* * readBinaryObject
188
188
*
189
189
* Reads binary data from SE050 object.
190
- *
190
+ *
191
191
* @param[in] ObjectId SE050 object ID containing data
192
192
* @param[out] data Output data buffer
193
193
* @param[in] dataMaxLen Output data buffer size
194
194
* @param[out] sig Binary object size
195
195
*
196
196
* @return 0 on Failure 1 on Success
197
- */
197
+ */
198
198
int readBinaryObject (int ObjectId, byte data[], size_t dataMaxLen, size_t * length);
199
199
200
200
/* * AES_ECB_encrypt
@@ -268,43 +268,43 @@ class SE05XClass
268
268
/* * writeBinaryObject
269
269
*
270
270
* Writes binary data into SE050 object.
271
- *
271
+ *
272
272
* @param[in] ObjectId SE050 object ID
273
273
* @param[in] data Input data buffer
274
274
* @param[in] length Input data buffer size
275
275
*
276
276
* @return 0 on Failure 1 on Success
277
- */
277
+ */
278
278
int writeBinaryObject (int ObjectId, const byte data[], size_t length);
279
279
280
280
/* * existsBinaryObject
281
281
*
282
282
* Checks if Object exist
283
- *
283
+ *
284
284
* @param[in] ObjectId SE050 object ID
285
285
*
286
286
* @return 0 on Failure (Not exist) 1 on Success (Exists)
287
- */
287
+ */
288
288
int existsBinaryObject (int objectId);
289
289
290
290
/* * deleteBinaryObject
291
291
*
292
292
* Deletes SE050 object
293
- *
293
+ *
294
294
* @param[in] ObjectId SE050 object ID
295
295
*
296
296
* @return 0 on Failure 1 on Success
297
- */
297
+ */
298
298
int deleteBinaryObject (int objectId);
299
299
300
300
/* * deleteBinaryObject
301
301
*
302
302
* Deletes all SE050 user objects
303
- *
303
+ *
304
304
* @param[in] ObjectId SE050 object ID
305
305
*
306
306
* @return 0 on Failure 1 on Success
307
- */
307
+ */
308
308
int deleteAllObjects ();
309
309
310
310
/* ECCX08 legacy API*/
@@ -344,20 +344,20 @@ class SE05XClass
344
344
* Input SHA256
345
345
* ? Match ?
346
346
* Signature -> public Key -> Original SHA256
347
- *
347
+ *
348
348
* @param[in] message Input SHA256 used to compute the signature 32 bytes
349
349
* @param[in] sig Input buffer containint the signature R S values 64bytes
350
350
* @param[in] pubkey Public key X Y values 64bytes
351
351
*
352
352
* @return 0 on Failure (Not match) 1 on Success (Match)
353
- */
353
+ */
354
354
int ecdsaVerify (const byte message[], const byte signature[], const byte pubkey[]);
355
355
356
356
/* * ecSign
357
357
*
358
358
* Computes ECDSA signature using key stored in KeyID SE050 object.
359
359
* Output buffer is filled with the signature R S values:
360
- *
360
+ *
361
361
* | R values 32 bytes | S values 32 bytes |
362
362
*
363
363
* SHA256 -> private Key -> Signature
@@ -367,31 +367,31 @@ class SE05XClass
367
367
* @param[out] signature Output buffer containint the signature 64 bytes
368
368
*
369
369
* @return 0 on Failure 1 on Success
370
- */
370
+ */
371
371
int ecSign (int slot, const byte message[], byte signature[]);
372
372
373
373
/* * readSlot
374
374
*
375
375
* Reads binary data from SE050 object.
376
- *
376
+ *
377
377
* @param[in] ObjecslottId SE050 object ID containing data
378
378
* @param[out] data Output data buffer
379
379
* @param[in] length Number of bytes to read
380
380
*
381
381
* @return 0 on Failure 1 on Success
382
- */
382
+ */
383
383
int readSlot (int slot, byte data[], int length);
384
384
385
385
/* * writeSlot
386
386
*
387
387
* Writes binary data into SE050 object.
388
- *
388
+ *
389
389
* @param[in] ObjectId SE050 object ID
390
390
* @param[in] data Input data buffer
391
391
* @param[in] length Number of bytes to write
392
392
*
393
393
* @return 0 on Failure 1 on Success
394
- */
394
+ */
395
395
int writeSlot (int slot, const byte data[], int length);
396
396
397
397
inline int locked () { return 1 ; }
0 commit comments