Skip to content

Commit f935459

Browse files
committed
[Example] Add ECDSA key recovery benchmark actions
1 parent 4cdabc0 commit f935459

File tree

4 files changed

+218
-67
lines changed

4 files changed

+218
-67
lines changed

Diff for: examples/helloack/bin/helloack.abi

+96-16
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,82 @@
1313
],
1414
"structs": [
1515
{
16-
"name": "bt_ecc_brainpoolP320r1_sha384",
16+
"name": "bt_ecdsa_brainpoolP256r1_sha256",
1717
"base": "",
1818
"fields": []
1919
},
2020
{
21-
"name": "bt_ecc_brainpoolP256r1_sha256",
21+
"name": "bt_ecdsa_brainpoolP320r1_sha384",
2222
"base": "",
2323
"fields": []
2424
},
2525
{
26-
"name": "bt_ecc_brainpoolP384r1_sha384",
26+
"name": "bt_ecdsa_brainpoolP384r1_sha384",
2727
"base": "",
2828
"fields": []
2929
},
3030
{
31-
"name": "bt_ecc_brainpoolP521r1_sha512",
31+
"name": "bt_ecdsa_brainpoolP521r1_sha512",
3232
"base": "",
3333
"fields": []
3434
},
3535
{
36-
"name": "bt_ecc_secp256k1_sha256",
36+
"name": "bt_ecdsa_recover_brainpoolP256r1_sha256",
3737
"base": "",
3838
"fields": []
3939
},
4040
{
41-
"name": "bt_ecc_secp256r1_sha256",
41+
"name": "bt_ecdsa_recover_brainpoolP320r1_sha384",
4242
"base": "",
4343
"fields": []
4444
},
4545
{
46-
"name": "bt_ecc_secp384r1_sha384",
46+
"name": "bt_ecdsa_recover_brainpoolP384r1_sha384",
4747
"base": "",
4848
"fields": []
4949
},
5050
{
51-
"name": "bt_ecc_secp521r1_sha512",
51+
"name": "bt_ecdsa_recover_brainpoolP521r1_sha512",
52+
"base": "",
53+
"fields": []
54+
},
55+
{
56+
"name": "bt_ecdsa_recover_secp256k1_sha256",
57+
"base": "",
58+
"fields": []
59+
},
60+
{
61+
"name": "bt_ecdsa_recover_secp256r1_sha256",
62+
"base": "",
63+
"fields": []
64+
},
65+
{
66+
"name": "bt_ecdsa_recover_secp384r1_sha384",
67+
"base": "",
68+
"fields": []
69+
},
70+
{
71+
"name": "bt_ecdsa_recover_secp521r1_sha512",
72+
"base": "",
73+
"fields": []
74+
},
75+
{
76+
"name": "bt_ecdsa_secp256k1_sha256",
77+
"base": "",
78+
"fields": []
79+
},
80+
{
81+
"name": "bt_ecdsa_secp256r1_sha256",
82+
"base": "",
83+
"fields": []
84+
},
85+
{
86+
"name": "bt_ecdsa_secp384r1_sha384",
87+
"base": "",
88+
"fields": []
89+
},
90+
{
91+
"name": "bt_ecdsa_secp521r1_sha512",
5292
"base": "",
5393
"fields": []
5494
},
@@ -449,42 +489,82 @@
449489
"actions": [
450490
{
451491
"name": "bteccbr1",
452-
"type": "bt_ecc_brainpoolP256r1_sha256",
492+
"type": "bt_ecdsa_brainpoolP256r1_sha256",
453493
"ricardian_contract": ""
454494
},
455495
{
456496
"name": "bteccbr13",
457-
"type": "bt_ecc_brainpoolP384r1_sha384",
497+
"type": "bt_ecdsa_brainpoolP384r1_sha384",
458498
"ricardian_contract": ""
459499
},
460500
{
461501
"name": "bteccbr132",
462-
"type": "bt_ecc_brainpoolP320r1_sha384",
502+
"type": "bt_ecdsa_brainpoolP320r1_sha384",
503+
"ricardian_contract": ""
504+
},
505+
{
506+
"name": "bteccbr132r",
507+
"type": "bt_ecdsa_recover_brainpoolP320r1_sha384",
508+
"ricardian_contract": ""
509+
},
510+
{
511+
"name": "bteccbr13r",
512+
"type": "bt_ecdsa_recover_brainpoolP384r1_sha384",
463513
"ricardian_contract": ""
464514
},
465515
{
466516
"name": "bteccbr15",
467-
"type": "bt_ecc_brainpoolP521r1_sha512",
517+
"type": "bt_ecdsa_brainpoolP521r1_sha512",
518+
"ricardian_contract": ""
519+
},
520+
{
521+
"name": "bteccbr15r",
522+
"type": "bt_ecdsa_recover_brainpoolP521r1_sha512",
523+
"ricardian_contract": ""
524+
},
525+
{
526+
"name": "bteccbr1r",
527+
"type": "bt_ecdsa_recover_brainpoolP256r1_sha256",
468528
"ricardian_contract": ""
469529
},
470530
{
471531
"name": "btecck1",
472-
"type": "bt_ecc_secp256k1_sha256",
532+
"type": "bt_ecdsa_secp256k1_sha256",
533+
"ricardian_contract": ""
534+
},
535+
{
536+
"name": "btecck1r",
537+
"type": "bt_ecdsa_recover_secp256k1_sha256",
473538
"ricardian_contract": ""
474539
},
475540
{
476541
"name": "bteccr1",
477-
"type": "bt_ecc_secp256r1_sha256",
542+
"type": "bt_ecdsa_secp256r1_sha256",
478543
"ricardian_contract": ""
479544
},
480545
{
481546
"name": "bteccr13",
482-
"type": "bt_ecc_secp384r1_sha384",
547+
"type": "bt_ecdsa_secp384r1_sha384",
548+
"ricardian_contract": ""
549+
},
550+
{
551+
"name": "bteccr13r",
552+
"type": "bt_ecdsa_recover_secp384r1_sha384",
483553
"ricardian_contract": ""
484554
},
485555
{
486556
"name": "bteccr15",
487-
"type": "bt_ecc_secp521r1_sha512",
557+
"type": "bt_ecdsa_secp521r1_sha512",
558+
"ricardian_contract": ""
559+
},
560+
{
561+
"name": "bteccr15r",
562+
"type": "bt_ecdsa_recover_secp521r1_sha512",
563+
"ricardian_contract": ""
564+
},
565+
{
566+
"name": "bteccr1r",
567+
"type": "bt_ecdsa_recover_secp256r1_sha256",
488568
"ricardian_contract": ""
489569
},
490570
{

Diff for: examples/helloack/bin/helloack.wasm

106 KB
Binary file not shown.

Diff for: examples/helloack/include/helloack.hpp

+57-9
Original file line numberDiff line numberDiff line change
@@ -240,47 +240,95 @@ struct [[eosio::contract]] helloack : public eosio::contract {
240240
* Benchmark action for testing verification of 1 brainpoolP256r1 ECDSA signature.
241241
*/
242242
[[eosio::action("bteccbr1"), eosio::read_only]]
243-
void bt_ecc_brainpoolP256r1_sha256();
243+
void bt_ecdsa_brainpoolP256r1_sha256();
244+
245+
/**
246+
* Benchmark action for testing recovery of 1 key from brainpoolP256r1 ECDSA signature.
247+
*/
248+
[[eosio::action("bteccbr1r"), eosio::read_only]]
249+
void bt_ecdsa_recover_brainpoolP256r1_sha256();
244250

245251
/**
246252
* Benchmark action for testing verification of 1 brainpoolP320r1 ECDSA signature.
247253
*/
248254
[[eosio::action("bteccbr132"), eosio::read_only]]
249-
void bt_ecc_brainpoolP320r1_sha384();
255+
void bt_ecdsa_brainpoolP320r1_sha384();
256+
257+
/**
258+
* Benchmark action for testing recovery of 1 key from brainpoolP320r1 ECDSA signature.
259+
*/
260+
[[eosio::action("bteccbr132r"), eosio::read_only]]
261+
void bt_ecdsa_recover_brainpoolP320r1_sha384();
250262

251263
/**
252264
* Benchmark action for testing verification of 1 brainpoolP384r1 ECDSA signature.
253265
*/
254266
[[eosio::action("bteccbr13"), eosio::read_only]]
255-
void bt_ecc_brainpoolP384r1_sha384();
267+
void bt_ecdsa_brainpoolP384r1_sha384();
268+
269+
/**
270+
* Benchmark action for testing recovery of 1 key from brainpoolP384r1 ECDSA signature.
271+
*/
272+
[[eosio::action("bteccbr13r"), eosio::read_only]]
273+
void bt_ecdsa_recover_brainpoolP384r1_sha384();
256274

257275
/**
258276
* Benchmark action for testing verification of 1 brainpoolP512r1 ECDSA signature.
259277
*/
260278
[[eosio::action("bteccbr15"), eosio::read_only]]
261-
void bt_ecc_brainpoolP521r1_sha512();
279+
void bt_ecdsa_brainpoolP512r1_sha512();
280+
281+
/**
282+
* Benchmark action for testing recovery of 1 key from brainpoolP512r1 ECDSA signature.
283+
*/
284+
[[eosio::action("bteccbr15r"), eosio::read_only]]
285+
void bt_ecdsa_recover_brainpoolP512r1_sha512();
262286

263287
/**
264288
* Benchmark action for testing verification of 1 secp256k1 ECDSA signature.
265289
*/
266290
[[eosio::action("btecck1"), eosio::read_only]]
267-
void bt_ecc_secp256k1_sha256();
291+
void bt_ecdsa_secp256k1_sha256();
292+
293+
/**
294+
* Benchmark action for testing recovery of 1 key from secp256k1 ECDSA signature.
295+
*/
296+
[[eosio::action("btecck1r"), eosio::read_only]]
297+
void bt_ecdsa_recover_secp256k1_sha256();
268298

269299
/**
270300
* Benchmark action for testing verification of 1 secp256r1 ECDSA signature.
271301
*/
272302
[[eosio::action("bteccr1"), eosio::read_only]]
273-
void bt_ecc_secp256r1_sha256();
303+
void bt_ecdsa_secp256r1_sha256();
304+
305+
/**
306+
* Benchmark action for testing recovery of 1 key from secp256r1 ECDSA signature.
307+
*/
308+
[[eosio::action("bteccr1r"), eosio::read_only]]
309+
void bt_ecdsa_recover_secp256r1_sha256();
274310

275311
/**
276312
* Benchmark action for testing verification of 1 secp384r1 ECDSA signature.
277313
*/
278314
[[eosio::action("bteccr13"), eosio::read_only]]
279-
void bt_ecc_secp384r1_sha384();
315+
void bt_ecdsa_secp384r1_sha384();
280316

281317
/**
282-
* Benchmark action for testing verification of 1 secp384r1 ECDSA signature.
318+
* Benchmark action for testing recovery of 1 key from secp384r1 ECDSA signature.
319+
*/
320+
[[eosio::action("bteccr13r"), eosio::read_only]]
321+
void bt_ecdsa_recover_secp384r1_sha384();
322+
323+
/**
324+
* Benchmark action for testing verification of 1 secp521r1 ECDSA signature.
283325
*/
284326
[[eosio::action("bteccr15"), eosio::read_only]]
285-
void bt_ecc_secp521r1_sha512();
327+
void bt_ecdsa_secp521r1_sha512();
328+
329+
/**
330+
* Benchmark action for testing recovery of 1 key from secp521r1 ECDSA signature.
331+
*/
332+
[[eosio::action("bteccr15r"), eosio::read_only]]
333+
void bt_ecdsa_recover_secp521r1_sha512();
286334
};

0 commit comments

Comments
 (0)