Skip to content

Add EC private key generation#2670

Merged
jviotti merged 2 commits into
mainfrom
crypto-generate-ec-key
Jul 23, 2026
Merged

Add EC private key generation#2670
jviotti merged 2 commits into
mainfrom
crypto-generate-ec-key

Conversation

@jviotti

@jviotti jviotti commented Jul 23, 2026

Copy link
Copy Markdown
Member

Signed-off-by: Juan Cruz Viotti jv@jviotti.com

Review in cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@augmentcode

augmentcode Bot commented Jul 23, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds first-class support for generating new random NIST EC private keys.

Changes:

  • Introduces curve_bit_length() to provide the correct per-curve bit size for platform key generators (notably P-521 vs 66-byte storage).
  • Adds generate_ec_private_key(EllipticCurve) to the public crypto signing API.
  • Implements EC key generation for Apple Security.framework via SecKeyCreateRandomKey.
  • Implements EC key generation for OpenSSL via EVP_EC_gen.
  • Implements EC key generation for Windows CNG via BCryptGenerateKeyPair/BCryptFinalizeKeyPair.
  • Adds a portable “other” backend implementation using rejection sampling mod the curve order and the existing RNG helper.
  • Stores generated keys in the existing PrivateKey abstraction (field size + backend handle / scalar + public point).
  • Adds ECDH-ES round-trip coverage using generated keys.
  • Adds ECDSA sign/verify round-trip coverage for P-256/P-384/P-521 generated keys.
  • Adds a basic randomness sanity check ensuring two generated P-256 keys differ.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

// retry rate low even for P-521, whose order fills only 521 of its 528 bits
std::string scalar(width, '\x00');
const SecureStringScope scalar_scope{scalar};
Bignum scalar_number;

@augmentcode augmentcode Bot Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalar_number contains the private scalar during rejection sampling, but it isn’t wiped with secure_zero/SecureBignumScope, so secret material may linger in stack memory after return (including the early return std::nullopt path). Consider ensuring the Bignum holding secret material is securely cleared on all exit paths.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

return std::nullopt;
}

return PrivateKey{

@augmentcode augmentcode Bot Jul 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If new PrivateKey::Internal{...} throws here, algorithm/key ownership hasn’t transferred yet and the handles will leak. Other locations where this applies: src/core/crypto/crypto_sign_apple.cc:387, src/core/crypto/crypto_sign_openssl.cc:354.

Severity: low

Other Locations
  • src/core/crypto/crypto_sign_apple.cc:387
  • src/core/crypto/crypto_sign_openssl.cc:354

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 8 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/core/crypto/crypto_sign_apple.cc">

<violation number="1" location="src/core/crypto/crypto_sign_apple.cc:388">
P2: If `new PrivateKey::Internal{...}` throws (e.g., `std::bad_alloc`), the `algorithm` and `key` handles have not yet been transferred into the `PrivateKey` destructor's ownership, so both platform handles will leak. Consider using a `unique_ptr` with a custom deleter or a local RAII guard to ensure cleanup on all exit paths. The same pattern also applies in the Apple and OpenSSL backends.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/crypto/crypto_sign_other.cc
}

return PrivateKey{
new PrivateKey::Internal{.kind = PrivateKey::Type::EllipticCurve,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: If new PrivateKey::Internal{...} throws (e.g., std::bad_alloc), the algorithm and key handles have not yet been transferred into the PrivateKey destructor's ownership, so both platform handles will leak. Consider using a unique_ptr with a custom deleter or a local RAII guard to ensure cleanup on all exit paths. The same pattern also applies in the Apple and OpenSSL backends.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/core/crypto/crypto_sign_apple.cc, line 388:

<comment>If `new PrivateKey::Internal{...}` throws (e.g., `std::bad_alloc`), the `algorithm` and `key` handles have not yet been transferred into the `PrivateKey` destructor's ownership, so both platform handles will leak. Consider using a `unique_ptr` with a custom deleter or a local RAII guard to ensure cleanup on all exit paths. The same pattern also applies in the Apple and OpenSSL backends.</comment>

<file context>
@@ -357,6 +357,41 @@ auto make_ec_private_key(const EllipticCurve curve,
+  }
+
+  return PrivateKey{
+      new PrivateKey::Internal{.kind = PrivateKey::Type::EllipticCurve,
+                               .key = key,
+                               .field_bytes = curve_field_bytes(curve),
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (macos/llvm)

Details
Benchmark suite Current: cf9d71a Previous: 3838db4 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.8039428152516046 ns/iter 1.7635002819795231 ns/iter 1.02
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8227767628848068 ns/iter 1.9884689481426343 ns/iter 0.92
Regex_Period_Asterisk 1.808535700978899 ns/iter 1.9067337024077797 ns/iter 0.95
Regex_Group_Period_Asterisk_Group 1.9228172715924359 ns/iter 1.666077368856279 ns/iter 1.15
Regex_Period_Plus 2.096473266631611 ns/iter 2.051599869405178 ns/iter 1.02
Regex_Period 2.1164567656526883 ns/iter 2.237181812713799 ns/iter 0.95
Regex_Caret_Period_Plus_Dollar 2.167247971160082 ns/iter 2.0656631751563928 ns/iter 1.05
Regex_Caret_Group_Period_Plus_Group_Dollar 2.2002943014304766 ns/iter 2.7264339029981324 ns/iter 0.81
Regex_Caret_Period_Asterisk_Dollar 1.8009098178309928 ns/iter 2.1438107585620823 ns/iter 0.84
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.7884439375244998 ns/iter 2.07389404119491 ns/iter 0.86
Regex_Caret_X_Hyphen 6.852302462060695 ns/iter 8.14095815727045 ns/iter 0.84
Regex_Period_Md_Dollar 18.005100538899438 ns/iter 18.515384195468812 ns/iter 0.97
Regex_Caret_Slash_Period_Asterisk 4.606244811864803 ns/iter 6.280508886719817 ns/iter 0.73
Regex_Caret_Period_Range_Dollar 2.089171425503296 ns/iter 2.070811148440924 ns/iter 1.01
Regex_Nested_Backtrack 27.886530592755303 ns/iter 28.08744875840233 ns/iter 0.99
JSON_Array_Of_Objects_Unique 378.6813161291295 ns/iter 359.5024146202697 ns/iter 1.05
JSON_Parse_1 7113.057246121729 ns/iter 6419.629627750125 ns/iter 1.11
JSON_Parse_Real 6940.355639983538 ns/iter 7251.296244131544 ns/iter 0.96
JSON_Parse_Decimal 8513.275952903876 ns/iter 7231.643534854157 ns/iter 1.18
JSON_Parse_Schema_ISO_Language 4839992.250000187 ns/iter 3816877.4674553005 ns/iter 1.27
JSON_Parse_Integer 5112.929590000022 ns/iter 5439.066582609585 ns/iter 0.94
JSON_Parse_String_NonSSO_Plain 7304.247441508644 ns/iter 7968.05018005414 ns/iter 0.92
JSON_Parse_String_SSO_Plain 2963.0165347854654 ns/iter 3614.9201849679525 ns/iter 0.82
JSON_Parse_String_Escape_Heavy 22145.902384594938 ns/iter 24649.25397932988 ns/iter 0.90
JSON_Parse_Object_Short_Keys 8580.299952842024 ns/iter 9451.996048440817 ns/iter 0.91
JSON_Parse_Object_Scalar_Properties 4556.460854264332 ns/iter 6133.904672090019 ns/iter 0.74
JSON_Parse_Object_Array_Properties 7607.045091373993 ns/iter 9107.64328572663 ns/iter 0.84
JSON_Parse_Object_Object_Properties 8007.460184353218 ns/iter 9729.860814717102 ns/iter 0.82
JSON_Parse_Nested_Containers 62303.85626246274 ns/iter 66018.0259727889 ns/iter 0.94
JSON_From_String_Copy 24.1156948356712 ns/iter 25.020067637215668 ns/iter 0.96
JSON_From_String_Temporary 20.560651004534037 ns/iter 22.271376923390637 ns/iter 0.92
JSON_Number_To_Double 34.21733488554727 ns/iter 37.61661523058793 ns/iter 0.91
JSON_Object_At_Last_Key/8 4.227305010126886 ns/iter 4.346966748018581 ns/iter 0.97
JSON_Object_At_Last_Key/32 12.787288130518295 ns/iter 13.77846371755394 ns/iter 0.93
JSON_Object_At_Last_Key/128 60.80283065661541 ns/iter 90.85870231711047 ns/iter 0.67
JSON_Object_At_Last_Key/512 192.73584255808106 ns/iter 229.56672710371495 ns/iter 0.84
JSON_Fast_Hash_Helm_Chart_Lock 60.277365232794786 ns/iter 100.18611689489396 ns/iter 0.60
JSON_Equality_Helm_Chart_Lock 166.92741310358954 ns/iter 160.95524719716357 ns/iter 1.04
JSON_Divisible_By_Decimal 192.83425623885822 ns/iter 178.09034624441117 ns/iter 1.08
JSON_String_Equal/10 10.657636523101958 ns/iter 7.10499796749477 ns/iter 1.50
JSON_String_Equal/100 7.1708879548241455 ns/iter 6.670863529149712 ns/iter 1.07
JSON_String_Equal_Small_By_Perfect_Hash/10 0.35071432504804473 ns/iter 0.36539534703012316 ns/iter 0.96
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.1968924516135404 ns/iter 3.7406689367874097 ns/iter 0.85
JSON_String_Fast_Hash/10 2.3788431953111693 ns/iter 2.580856476227474 ns/iter 0.92
JSON_String_Fast_Hash/100 2.0322083695906743 ns/iter 2.294725859956114 ns/iter 0.89
JSON_String_Key_Hash/10 1.7098279353115455 ns/iter 1.9424736401059122 ns/iter 0.88
JSON_String_Key_Hash/100 2.211270757640833 ns/iter 2.1888676267905534 ns/iter 1.01
JSON_Object_Defines_Miss_Same_Length 2.7593953425017026 ns/iter 2.9509887373183727 ns/iter 0.94
JSON_Object_Defines_Miss_Too_Small 2.80223344644392 ns/iter 2.8274003624331363 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 2.7432168207989696 ns/iter 2.975529417681657 ns/iter 0.92
Pointer_Object_Traverse 24.984813481512653 ns/iter 34.162899087770754 ns/iter 0.73
Pointer_Object_Try_Traverse 22.986785807662244 ns/iter 24.480977789065186 ns/iter 0.94
Pointer_Push_Back_Pointer_To_Weak_Pointer 168.90286755781526 ns/iter 209.4928718508845 ns/iter 0.81
Pointer_Walker_Schema_ISO_Language 2754152.351351255 ns/iter 2671327.4117647484 ns/iter 1.03
Pointer_Maybe_Tracked_Deeply_Nested/0 1255669.2336956935 ns/iter 1394544.3989071187 ns/iter 0.90
Pointer_Maybe_Tracked_Deeply_Nested/1 1083485.3455657032 ns/iter 1321194.5978020474 ns/iter 0.82
Pointer_Position_Tracker_Get_Deeply_Nested 435.80107456936173 ns/iter 368.4798093058021 ns/iter 1.18
JSONPath_Descendant_Filter_Nested 1418.711881327147 ns/iter 1260.6333678611277 ns/iter 1.13
URITemplateRouter_Create 23914.467747450286 ns/iter 31731.450816309658 ns/iter 0.75
URITemplateRouter_Match 177.73214686837852 ns/iter 164.3020548818526 ns/iter 1.08
URITemplateRouter_Match_BasePath 202.09136830408696 ns/iter 203.80582183171063 ns/iter 0.99
URITemplateRouterView_Restore 10685.737337598764 ns/iter 11150.20467828446 ns/iter 0.96
URITemplateRouterView_Match 136.9105407855616 ns/iter 147.68290358826644 ns/iter 0.93
URITemplateRouterView_Match_BasePath 157.53439025516585 ns/iter 174.47887102027008 ns/iter 0.90
URITemplateRouterView_Arguments 572.465841342212 ns/iter 604.8184938979063 ns/iter 0.95
JSONL_Parse_Large 10904519.230769858 ns/iter 11957334.807017393 ns/iter 0.91
JSONL_Parse_Large_GZIP 12073834.033333242 ns/iter 13315999.263157433 ns/iter 0.91
JSONLD_Catalog_Annotation_List_Populate 911206.4295038488 ns/iter 1019712.5927674472 ns/iter 0.89
JSONLD_Catalog_Materialize 4684553.691275435 ns/iter 6515098.459259308 ns/iter 0.72
HTML_Build_Table_100000 37905425.421052694 ns/iter 46914108.99999937 ns/iter 0.81
HTML_Render_Table_100000 1649106.9739130205 ns/iter 1912166.8632075256 ns/iter 0.86
GZIP_Compress_ISO_Language_Set_3_Locations 28565244.791669402 ns/iter 32090499.99999739 ns/iter 0.89
GZIP_Decompress_ISO_Language_Set_3_Locations 3716601.4150945456 ns/iter 3628026.6393443197 ns/iter 1.02
GZIP_Compress_ISO_Language_Set_3_Schema 1622889.1176470984 ns/iter 1707949.1580311155 ns/iter 0.95
GZIP_Decompress_ISO_Language_Set_3_Schema 282069.19145569316 ns/iter 343718.17765569786 ns/iter 0.82
JOSE_VerifySignature_RS256 22380.111902696717 ns/iter 30418.902648779513 ns/iter 0.74
JOSE_VerifySignature_ES512 1212478.0656000439 ns/iter 1504608.6046066144 ns/iter 0.81

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/gcc)

Details
Benchmark suite Current: cf9d71a Previous: 3838db4 Ratio
JOSE_VerifySignature_RS256 24618.20148335391 ns/iter 22033.267471987518 ns/iter 1.12
JOSE_VerifySignature_ES512 641110.6681985753 ns/iter 578823.780165294 ns/iter 1.11
GZIP_Compress_ISO_Language_Set_3_Locations 39406860.55556044 ns/iter 36176844.421052724 ns/iter 1.09
GZIP_Decompress_ISO_Language_Set_3_Locations 4064683.202312474 ns/iter 4161037.0000002137 ns/iter 0.98
GZIP_Compress_ISO_Language_Set_3_Schema 2294021.52631614 ns/iter 2014936.9942362455 ns/iter 1.14
GZIP_Decompress_ISO_Language_Set_3_Schema 277103.6321070351 ns/iter 380478.4135869864 ns/iter 0.73
HTML_Build_Table_100000 70987960.79999374 ns/iter 64216090.09090514 ns/iter 1.11
HTML_Render_Table_100000 2087910.0825688222 ns/iter 1911733.7002724188 ns/iter 1.09
JSONLD_Catalog_Annotation_List_Populate 1310861.8953272474 ns/iter 1296780.8401486208 ns/iter 1.01
JSONLD_Catalog_Materialize 7014389.70873797 ns/iter 6762952.057692053 ns/iter 1.04
JSONL_Parse_Large 12720223.181819081 ns/iter 13652812.215687113 ns/iter 0.93
JSONL_Parse_Large_GZIP 14153152.940000381 ns/iter 15007982.085104773 ns/iter 0.94
URITemplateRouter_Create 29594.63409615914 ns/iter 30707.01944298504 ns/iter 0.96
URITemplateRouter_Match 158.2064222518055 ns/iter 159.86716126807488 ns/iter 0.99
URITemplateRouter_Match_BasePath 191.35713497115384 ns/iter 193.50391785086146 ns/iter 0.99
URITemplateRouterView_Restore 9870.843861788657 ns/iter 8304.947344322773 ns/iter 1.19
URITemplateRouterView_Match 124.41136082644668 ns/iter 125.03235776182613 ns/iter 1.00
URITemplateRouterView_Match_BasePath 142.64440277491468 ns/iter 144.53108596618367 ns/iter 0.99
URITemplateRouterView_Arguments 462.10274833708775 ns/iter 469.84261348418397 ns/iter 0.98
JSONPath_Descendant_Filter_Nested 1778.4535545698961 ns/iter 1702.0517311284734 ns/iter 1.04
Pointer_Object_Traverse 32.25883833346806 ns/iter 33.03376346818329 ns/iter 0.98
Pointer_Object_Try_Traverse 26.108518079176804 ns/iter 25.797857667423138 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 156.79470989688159 ns/iter 157.87334912637957 ns/iter 0.99
Pointer_Walker_Schema_ISO_Language 2883675.135999965 ns/iter 2748660.451361732 ns/iter 1.05
Pointer_Maybe_Tracked_Deeply_Nested/0 1884731.6837837824 ns/iter 1854002.3891893502 ns/iter 1.02
Pointer_Maybe_Tracked_Deeply_Nested/1 1644402.3255268487 ns/iter 1734132.428218023 ns/iter 0.95
Pointer_Position_Tracker_Get_Deeply_Nested 489.58760314695087 ns/iter 547.2775268420222 ns/iter 0.89
JSON_Array_Of_Objects_Unique 407.1616546972001 ns/iter 427.39230199073296 ns/iter 0.95
JSON_Parse_1 9757.904027564722 ns/iter 9918.870612331402 ns/iter 0.98
JSON_Parse_Real 7966.913758121519 ns/iter 7750.054577504713 ns/iter 1.03
JSON_Parse_Decimal 11262.418896550205 ns/iter 13065.354275642461 ns/iter 0.86
JSON_Parse_Schema_ISO_Language 6712758.259615507 ns/iter 6631366.819047322 ns/iter 1.01
JSON_Parse_Integer 5780.781331372174 ns/iter 5659.900878750656 ns/iter 1.02
JSON_Parse_String_NonSSO_Plain 11909.340173099066 ns/iter 11947.399709872307 ns/iter 1.00
JSON_Parse_String_SSO_Plain 4753.130892044095 ns/iter 4954.9912613819615 ns/iter 0.96
JSON_Parse_String_Escape_Heavy 24192.95929650058 ns/iter 25602.315034927175 ns/iter 0.94
JSON_Parse_Object_Short_Keys 14200.042730514415 ns/iter 13726.232904175688 ns/iter 1.03
JSON_Parse_Object_Scalar_Properties 7213.212998137261 ns/iter 7052.370736485345 ns/iter 1.02
JSON_Parse_Object_Array_Properties 12676.853540199247 ns/iter 12315.375107312602 ns/iter 1.03
JSON_Parse_Object_Object_Properties 11862.038624946354 ns/iter 12286.153299656255 ns/iter 0.97
JSON_Parse_Nested_Containers 101204.90344529526 ns/iter 99940.30775813397 ns/iter 1.01
JSON_From_String_Copy 19.694571363237095 ns/iter 18.063898506041753 ns/iter 1.09
JSON_From_String_Temporary 16.355222822215833 ns/iter 15.339278830331576 ns/iter 1.07
JSON_Number_To_Double 19.69337788170731 ns/iter 20.893062508328164 ns/iter 0.94
JSON_Object_At_Last_Key/8 4.1962383787749475 ns/iter 3.8124273398704935 ns/iter 1.10
JSON_Object_At_Last_Key/32 13.476126901837246 ns/iter 11.927312225756346 ns/iter 1.13
JSON_Object_At_Last_Key/128 47.4242855728318 ns/iter 48.56975872344 ns/iter 0.98
JSON_Object_At_Last_Key/512 285.2950722420377 ns/iter 360.07213090268067 ns/iter 0.79
JSON_Fast_Hash_Helm_Chart_Lock 70.76734301960587 ns/iter 61.42569318922566 ns/iter 1.15
JSON_Equality_Helm_Chart_Lock 177.3703923595781 ns/iter 171.72696284872856 ns/iter 1.03
JSON_Divisible_By_Decimal 247.9885346746388 ns/iter 249.67636309271458 ns/iter 0.99
JSON_String_Equal/10 5.364842907241831 ns/iter 5.374291669683701 ns/iter 1.00
JSON_String_Equal/100 6.0698989654664 ns/iter 6.010707120297324 ns/iter 1.01
JSON_String_Equal_Small_By_Perfect_Hash/10 0.7140006868844488 ns/iter 0.623290766358358 ns/iter 1.15
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 21.97252066847599 ns/iter 25.185914973200436 ns/iter 0.87
JSON_String_Fast_Hash/10 2.463680606904437 ns/iter 2.2942038309193986 ns/iter 1.07
JSON_String_Fast_Hash/100 2.463628432705208 ns/iter 2.2947236875648915 ns/iter 1.07
JSON_String_Key_Hash/10 1.0843762843157796 ns/iter 1.246120426438399 ns/iter 0.87
JSON_String_Key_Hash/100 14.76965497623439 ns/iter 12.452062277148768 ns/iter 1.19
JSON_Object_Defines_Miss_Same_Length 3.165812373196501 ns/iter 3.114107279906409 ns/iter 1.02
JSON_Object_Defines_Miss_Too_Small 3.5164774928723816 ns/iter 3.1146766891039803 ns/iter 1.13
JSON_Object_Defines_Miss_Too_Large 3.165900819540355 ns/iter 3.1142376375790315 ns/iter 1.02
Regex_Lower_S_Or_Upper_S_Asterisk 1.0550157575381527 ns/iter 0.9345455445828098 ns/iter 1.13
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.7035003597291303 ns/iter 0.622595962395573 ns/iter 1.13
Regex_Period_Asterisk 1.054927659855796 ns/iter 0.9339439557909178 ns/iter 1.13
Regex_Group_Period_Asterisk_Group 0.7032907386114682 ns/iter 0.6242546041458306 ns/iter 1.13
Regex_Period_Plus 1.054739428743235 ns/iter 0.9348997084270071 ns/iter 1.13
Regex_Period 0.710266446652007 ns/iter 0.6224916082343573 ns/iter 1.14
Regex_Caret_Period_Plus_Dollar 1.0564648570055055 ns/iter 0.9342086691976247 ns/iter 1.13
Regex_Caret_Group_Period_Plus_Group_Dollar 0.706530823421247 ns/iter 0.6225976325107354 ns/iter 1.13
Regex_Caret_Period_Asterisk_Dollar 1.0564056410252092 ns/iter 0.9346425335901146 ns/iter 1.13
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.7040665127914303 ns/iter 0.6231532844377097 ns/iter 1.13
Regex_Caret_X_Hyphen 4.222464111058007 ns/iter 4.377285480139794 ns/iter 0.96
Regex_Period_Md_Dollar 33.116679334008 ns/iter 34.331076252676 ns/iter 0.96
Regex_Caret_Slash_Period_Asterisk 4.575847438708873 ns/iter 4.667177182226776 ns/iter 0.98
Regex_Caret_Period_Range_Dollar 1.4072820897989273 ns/iter 1.2453827726598787 ns/iter 1.13
Regex_Nested_Backtrack 40.948707920752284 ns/iter 37.81046299865913 ns/iter 1.08

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (linux/llvm)

Details
Benchmark suite Current: cf9d71a Previous: 3838db4 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.542239804473764 ns/iter 2.1856599418390634 ns/iter 1.16
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.186872288545928 ns/iter 1.9112250346536181 ns/iter 1.14
Regex_Period_Asterisk 2.1793243215109945 ns/iter 1.9098711265720483 ns/iter 1.14
Regex_Group_Period_Asterisk_Group 2.491118839690676 ns/iter 2.183864314376664 ns/iter 1.14
Regex_Period_Plus 3.1117986545326275 ns/iter 2.88735286349994 ns/iter 1.08
Regex_Period 2.8008270881964927 ns/iter 1.9101585078361987 ns/iter 1.47
Regex_Caret_Period_Plus_Dollar 2.80128435202691 ns/iter 1.9094304286941732 ns/iter 1.47
Regex_Caret_Group_Period_Plus_Group_Dollar 3.123704764565994 ns/iter 2.1828428768312866 ns/iter 1.43
Regex_Caret_Period_Asterisk_Dollar 3.7330429809363834 ns/iter 3.2715881848627526 ns/iter 1.14
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.421384797547399 ns/iter 3.01183107876839 ns/iter 1.14
Regex_Caret_X_Hyphen 6.538414282238861 ns/iter 5.45686666454671 ns/iter 1.20
Regex_Period_Md_Dollar 27.150502344443627 ns/iter 21.77424993728385 ns/iter 1.25
Regex_Caret_Slash_Period_Asterisk 7.1668898579408395 ns/iter 4.363121207774321 ns/iter 1.64
Regex_Caret_Period_Range_Dollar 4.357770575847616 ns/iter 3.274420558290064 ns/iter 1.33
Regex_Nested_Backtrack 38.36132644288549 ns/iter 29.705672705749052 ns/iter 1.29
JSON_Array_Of_Objects_Unique 398.26165792499677 ns/iter 324.58421567176487 ns/iter 1.23
JSON_Parse_1 4929.816839821873 ns/iter 3784.98244549448 ns/iter 1.30
JSON_Parse_Real 5343.841388066098 ns/iter 4041.851664589116 ns/iter 1.32
JSON_Parse_Decimal 7659.674792078853 ns/iter 5918.64588773942 ns/iter 1.29
JSON_Parse_Schema_ISO_Language 3555344.2777777584 ns/iter 2931917.254166668 ns/iter 1.21
JSON_Parse_Integer 3662.1374433140686 ns/iter 3063.2058237232973 ns/iter 1.20
JSON_Parse_String_NonSSO_Plain 5013.685741337497 ns/iter 4014.7405843876336 ns/iter 1.25
JSON_Parse_String_SSO_Plain 2787.568309628947 ns/iter 2304.99053161306 ns/iter 1.21
JSON_Parse_String_Escape_Heavy 14397.613991022965 ns/iter 11808.465083728965 ns/iter 1.22
JSON_Parse_Object_Short_Keys 10835.453533667294 ns/iter 6581.52838370437 ns/iter 1.65
JSON_Parse_Object_Scalar_Properties 4218.311091455751 ns/iter 3325.324910690746 ns/iter 1.27
JSON_Parse_Object_Array_Properties 5886.883296371407 ns/iter 4505.216703052951 ns/iter 1.31
JSON_Parse_Object_Object_Properties 5753.74885202154 ns/iter 4467.474800722707 ns/iter 1.29
JSON_Parse_Nested_Containers 46662.9470639695 ns/iter 35702.19412036846 ns/iter 1.31
JSON_From_String_Copy 21.19063064594998 ns/iter 17.597524247087126 ns/iter 1.20
JSON_From_String_Temporary 19.03218750893527 ns/iter 15.288954517546939 ns/iter 1.24
JSON_Number_To_Double 24.301975874378922 ns/iter 18.08175464546098 ns/iter 1.34
JSON_Object_At_Last_Key/8 3.815884633212513 ns/iter 3.1223975961640185 ns/iter 1.22
JSON_Object_At_Last_Key/32 12.772049576328316 ns/iter 10.114913089466357 ns/iter 1.26
JSON_Object_At_Last_Key/128 56.12183199370937 ns/iter 43.94477268193994 ns/iter 1.28
JSON_Object_At_Last_Key/512 392.367368063168 ns/iter 286.0875585275147 ns/iter 1.37
JSON_Fast_Hash_Helm_Chart_Lock 57.89437971011135 ns/iter 54.25817584687236 ns/iter 1.07
JSON_Equality_Helm_Chart_Lock 149.87732824645326 ns/iter 121.81232918806695 ns/iter 1.23
JSON_Divisible_By_Decimal 255.9764470093237 ns/iter 194.04159116509726 ns/iter 1.32
JSON_String_Equal/10 6.540489663122738 ns/iter 4.0933046779376845 ns/iter 1.60
JSON_String_Equal/100 6.236538962551148 ns/iter 4.909843400826125 ns/iter 1.27
JSON_String_Equal_Small_By_Perfect_Hash/10 0.935058156216438 ns/iter 0.8181908239620737 ns/iter 1.14
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.926685595532692 ns/iter 9.599148630517773 ns/iter 1.56
JSON_String_Fast_Hash/10 2.489370923430204 ns/iter 1.9092001656103892 ns/iter 1.30
JSON_String_Fast_Hash/100 2.4911583623278686 ns/iter 1.9100941150420654 ns/iter 1.30
JSON_String_Key_Hash/10 2.700942313148426 ns/iter 1.9091957318847848 ns/iter 1.41
JSON_String_Key_Hash/100 9.023872180283467 ns/iter 5.998635277895385 ns/iter 1.50
JSON_Object_Defines_Miss_Same_Length 3.424040575326198 ns/iter 3.273736160028282 ns/iter 1.05
JSON_Object_Defines_Miss_Too_Small 2.904294598959088 ns/iter 2.4830011644676024 ns/iter 1.17
JSON_Object_Defines_Miss_Too_Large 2.6738623415161142 ns/iter 2.2709847406051096 ns/iter 1.18
Pointer_Object_Traverse 29.208625280649464 ns/iter 23.768340330504916 ns/iter 1.23
Pointer_Object_Try_Traverse 31.11226621532378 ns/iter 25.51106714681968 ns/iter 1.22
Pointer_Push_Back_Pointer_To_Weak_Pointer 209.98823950930654 ns/iter 134.2770603151478 ns/iter 1.56
Pointer_Walker_Schema_ISO_Language 2661064.471482718 ns/iter 2160693.6586103323 ns/iter 1.23
Pointer_Maybe_Tracked_Deeply_Nested/0 1252489.6007129485 ns/iter 1009942.3411764305 ns/iter 1.24
Pointer_Maybe_Tracked_Deeply_Nested/1 1602331.5707655807 ns/iter 1303089.1236161722 ns/iter 1.23
Pointer_Position_Tracker_Get_Deeply_Nested 667.580072909996 ns/iter 568.0710489501439 ns/iter 1.18
JSONPath_Descendant_Filter_Nested 1602.2404972991603 ns/iter 1238.5728231801763 ns/iter 1.29
URITemplateRouter_Create 34111.61740939429 ns/iter 23183.866675396122 ns/iter 1.47
URITemplateRouter_Match 179.16678743361746 ns/iter 131.41456184568565 ns/iter 1.36
URITemplateRouter_Match_BasePath 206.11458569218746 ns/iter 156.9473143590883 ns/iter 1.31
URITemplateRouterView_Restore 8371.175814161004 ns/iter 7742.849515594444 ns/iter 1.08
URITemplateRouterView_Match 144.26855718966024 ns/iter 108.11755500796895 ns/iter 1.33
URITemplateRouterView_Match_BasePath 163.64395918668455 ns/iter 121.81857801275189 ns/iter 1.34
URITemplateRouterView_Arguments 423.72587602958066 ns/iter 350.40048236097476 ns/iter 1.21
JSONL_Parse_Large 9883891.154929738 ns/iter 7334936.093750835 ns/iter 1.35
JSONL_Parse_Large_GZIP 11375845.467741344 ns/iter 8600493.451219458 ns/iter 1.32
JSONLD_Catalog_Annotation_List_Populate 1242212.5323740952 ns/iter 997145.1370056854 ns/iter 1.25
JSONLD_Catalog_Materialize 4353021.155279551 ns/iter 3342997.272727589 ns/iter 1.30
HTML_Build_Table_100000 69287014.300005 ns/iter 58405063.50000396 ns/iter 1.19
HTML_Render_Table_100000 5989233.878787645 ns/iter 4530799.666667175 ns/iter 1.32
GZIP_Compress_ISO_Language_Set_3_Locations 32864206.38095305 ns/iter 27515002.120003372 ns/iter 1.19
GZIP_Decompress_ISO_Language_Set_3_Locations 4385623.0440252265 ns/iter 2986658.7923731143 ns/iter 1.47
GZIP_Compress_ISO_Language_Set_3_Schema 1863732.0026667414 ns/iter 1626500.3805106936 ns/iter 1.15
GZIP_Decompress_ISO_Language_Set_3_Schema 356036.6302136153 ns/iter 196151.8845395515 ns/iter 1.82
JOSE_VerifySignature_RS256 56836.64142068709 ns/iter 49746.53445091485 ns/iter 1.14
JOSE_VerifySignature_ES512 2394757.7312926613 ns/iter 2191894.356250046 ns/iter 1.09

This comment was automatically generated by workflow using github-action-benchmark.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark (windows/msvc)

Details
Benchmark suite Current: cf9d71a Previous: 3838db4 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.730851000000712 ns/iter 2.4170025642664457 ns/iter 2.37
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.153704464285219 ns/iter 2.447689282982639 ns/iter 2.11
Regex_Period_Asterisk 5.033884163022484 ns/iter 2.342603233992823 ns/iter 2.15
Regex_Group_Period_Asterisk_Group 5.031062000000475 ns/iter 2.3476563589867583 ns/iter 2.14
Regex_Period_Plus 5.031854264515564 ns/iter 2.627668523852755 ns/iter 1.91
Regex_Period 5.355008999999882 ns/iter 2.6273403571427223 ns/iter 2.04
Regex_Caret_Period_Plus_Dollar 5.042082999998456 ns/iter 2.5708807789545363 ns/iter 1.96
Regex_Caret_Group_Period_Plus_Group_Dollar 5.55685899999844 ns/iter 2.6774981002877523 ns/iter 2.08
Regex_Caret_Period_Asterisk_Dollar 5.3507874999983835 ns/iter 2.4647896428571614 ns/iter 2.17
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.017422321427847 ns/iter 2.4038803571426928 ns/iter 2.09
Regex_Caret_X_Hyphen 8.532345982142127 ns/iter 6.530368303570963 ns/iter 1.31
Regex_Period_Md_Dollar 45.39301249999994 ns/iter 27.075656129123825 ns/iter 1.68
Regex_Caret_Slash_Period_Asterisk 7.862546875000273 ns/iter 6.369544642857201 ns/iter 1.23
Regex_Caret_Period_Range_Dollar 5.9741669999993965 ns/iter 3.0398036343218044 ns/iter 1.97
Regex_Nested_Backtrack 55.39163392857712 ns/iter 36.40905622940433 ns/iter 1.52
JSON_Array_Of_Objects_Unique 604.675624999881 ns/iter 463.4242129220825 ns/iter 1.30
JSON_Parse_1 8884.018973215494 ns/iter 7125.222098214629 ns/iter 1.25
JSON_Parse_Real 16208.712053570805 ns/iter 11297.4578124998 ns/iter 1.43
JSON_Parse_Decimal 11781.253571427897 ns/iter 8781.106780772428 ns/iter 1.34
JSON_Parse_Schema_ISO_Language 8304228.00000027 ns/iter 9354769.333332721 ns/iter 0.89
JSON_Parse_Integer 6218.767857142942 ns/iter 4456.189375000008 ns/iter 1.40
JSON_Parse_String_NonSSO_Plain 7844.372767856608 ns/iter 7893.917857142948 ns/iter 0.99
JSON_Parse_String_SSO_Plain 3767.7977360749182 ns/iter 3340.863813849819 ns/iter 1.13
JSON_Parse_String_Escape_Heavy 21525.6073714938 ns/iter 22044.567582950473 ns/iter 0.98
JSON_Parse_Object_Short_Keys 13259.687010327483 ns/iter 9788.092463872683 ns/iter 1.35
JSON_Parse_Object_Scalar_Properties 6821.351562500411 ns/iter 5008.375000000699 ns/iter 1.36
JSON_Parse_Object_Array_Properties 11196.906250003025 ns/iter 8717.94768773332 ns/iter 1.28
JSON_Parse_Object_Object_Properties 11541.77343750007 ns/iter 8830.692273695213 ns/iter 1.31
JSON_Parse_Nested_Containers 79997.42187497613 ns/iter 62213.21428572172 ns/iter 1.29
JSON_From_String_Copy 63.63875892856998 ns/iter 58.314044642863955 ns/iter 1.09
JSON_From_String_Temporary 57.65541071428159 ns/iter 56.110312500002074 ns/iter 1.03
JSON_Number_To_Double 120.73026562500644 ns/iter 82.4347767857146 ns/iter 1.46
JSON_Object_At_Last_Key/8 7.259078124999263 ns/iter 6.9239642857153525 ns/iter 1.05
JSON_Object_At_Last_Key/32 23.265843490339066 ns/iter 18.66827591966197 ns/iter 1.25
JSON_Object_At_Last_Key/128 89.22467012388478 ns/iter 79.92730357143175 ns/iter 1.12
JSON_Object_At_Last_Key/512 422.61750345454794 ns/iter 264.9700185254487 ns/iter 1.59
JSON_Fast_Hash_Helm_Chart_Lock 101.98409375000493 ns/iter 68.94958035713573 ns/iter 1.48
JSON_Equality_Helm_Chart_Lock 239.66126789496954 ns/iter 206.71351309314548 ns/iter 1.16
JSON_Divisible_By_Decimal 302.5835714285766 ns/iter 250.71057469747646 ns/iter 1.21
JSON_String_Equal/10 10.352687900211368 ns/iter 9.231127190934705 ns/iter 1.12
JSON_String_Equal/100 11.614478124997163 ns/iter 12.153075000000513 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 2.5144260714293005 ns/iter 1.299311964285721 ns/iter 1.94
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 15.024264441853 ns/iter 9.71388745663391 ns/iter 1.55
JSON_String_Fast_Hash/10 6.58193749999977 ns/iter 3.001086469194623 ns/iter 2.19
JSON_String_Fast_Hash/100 6.5810156249998135 ns/iter 3.14081874999975 ns/iter 2.10
JSON_String_Key_Hash/10 5.335135000000264 ns/iter 2.8350383903258796 ns/iter 1.88
JSON_String_Key_Hash/100 11.867399999999861 ns/iter 8.536974330356019 ns/iter 1.39
JSON_Object_Defines_Miss_Same_Length 3.7680463557194193 ns/iter 4.1257899999990855 ns/iter 0.91
JSON_Object_Defines_Miss_Too_Small 4.085013801938414 ns/iter 3.842357135995507 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Large 3.775442136114874 ns/iter 3.75237109375069 ns/iter 1.01
Pointer_Object_Traverse 70.63307142857411 ns/iter 44.46874999999295 ns/iter 1.59
Pointer_Object_Try_Traverse 71.64801785715927 ns/iter 41.71808468995619 ns/iter 1.72
Pointer_Push_Back_Pointer_To_Weak_Pointer 162.24651785715798 ns/iter 141.8093575085102 ns/iter 1.14
Pointer_Walker_Schema_ISO_Language 12683342.000000266 ns/iter 12930231.999998797 ns/iter 0.98
Pointer_Maybe_Tracked_Deeply_Nested/0 2482086.74698785 ns/iter 2423305.622489651 ns/iter 1.02
Pointer_Maybe_Tracked_Deeply_Nested/1 3876965.9217880024 ns/iter 4311673.750000011 ns/iter 0.90
Pointer_Position_Tracker_Get_Deeply_Nested 531.4073667911554 ns/iter 526.0856718052323 ns/iter 1.01
JSONPath_Descendant_Filter_Nested 2423.2485714281083 ns/iter 1612.0504464289809 ns/iter 1.50
URITemplateRouter_Create 40715.03685219384 ns/iter 38181.22767857344 ns/iter 1.07
URITemplateRouter_Match 233.68751856172167 ns/iter 229.86154800656425 ns/iter 1.02
URITemplateRouter_Match_BasePath 264.90225156686796 ns/iter 261.57115676656736 ns/iter 1.01
URITemplateRouterView_Restore 32234.816964284666 ns/iter 15696.366071433129 ns/iter 2.05
URITemplateRouterView_Match 179.70888211686636 ns/iter 158.05294585176162 ns/iter 1.14
URITemplateRouterView_Match_BasePath 205.12057789644808 ns/iter 182.32991806520636 ns/iter 1.12
URITemplateRouterView_Arguments 530.420999999933 ns/iter 416.2755930234809 ns/iter 1.27
JSONL_Parse_Large 32804009.52380227 ns/iter 25429571.428568512 ns/iter 1.29
JSONL_Parse_Large_GZIP 33417857.14285704 ns/iter 25414738.46154601 ns/iter 1.31
JSONLD_Catalog_Annotation_List_Populate 2873682.6271188734 ns/iter 2726228.8135600905 ns/iter 1.05
JSONLD_Catalog_Materialize 10786421.87500023 ns/iter 6913916.66666732 ns/iter 1.56
HTML_Build_Table_100000 91004571.42855182 ns/iter 105658633.33332951 ns/iter 0.86
HTML_Render_Table_100000 7806755.555556163 ns/iter 14238759.999999374 ns/iter 0.55
GZIP_Compress_ISO_Language_Set_3_Locations 36625178.947360836 ns/iter 29403683.999998976 ns/iter 1.25
GZIP_Decompress_ISO_Language_Set_3_Locations 9814538.666666219 ns/iter 13786015.999999108 ns/iter 0.71
GZIP_Compress_ISO_Language_Set_3_Schema 2112627.5362315727 ns/iter 1871010.1876672343 ns/iter 1.13
GZIP_Decompress_ISO_Language_Set_3_Schema 624555.89285731 ns/iter 665246.316964233 ns/iter 0.94
JOSE_VerifySignature_RS256 21500.33437499843 ns/iter 17834.733345833683 ns/iter 1.21
JOSE_VerifySignature_ES512 1550379.9107143835 ns/iter 945651.2717534889 ns/iter 1.64

This comment was automatically generated by workflow using github-action-benchmark.

@jviotti
jviotti merged commit 3dc79d5 into main Jul 23, 2026
12 checks passed
@jviotti
jviotti deleted the crypto-generate-ec-key branch July 23, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant