Skip to content

Add ECDH key agreement and Concat KDF primitives#2668

Merged
jviotti merged 4 commits into
mainfrom
ecdh
Jul 23, 2026
Merged

Add ECDH key agreement and Concat KDF primitives#2668
jviotti merged 4 commits into
mainfrom
ecdh

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: Adds ECDH key agreement and Concat KDF primitives to the core crypto library.

Changes:

  • Introduces new public APIs: ecdh_derive (raw ECDH shared secret) and kdf_concat (RFC 7518 Concat KDF over SHA-256).
  • Adds portable Concat KDF implementation in crypto_ecdh.cc, building RFC 7518 “OtherInfo” and iterating SHA-256 blocks via a counter.
  • Implements ecdh_derive for all backends: OpenSSL, Apple Security framework, Windows CNG (via re-import under ECDH provider), and the reference backend.
  • Extends the umbrella crypto header (crypto.h) to export the new ECDH/KDF APIs.
  • Adds append_big_endian_uint32 to the text module and reuses it to simplify counter encoding in OAEP and signature MGF code paths.
  • Updates CMake targets to compile/link the new sources per platform.
  • Adds unit tests for Concat KDF (including RFC 7518 appendix vector) and ECDH derivation behavior, plus tests for the new text helper.

Technical Notes: The ECDH primitive returns the agreed point’s x-coordinate bytes, and Concat KDF derives arbitrary-length key material by hashing counter || Z || OtherInfo until the requested length is produced.

🤖 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.

Comment thread src/core/crypto/crypto_ecdh.cc
if (EVP_PKEY_derive(context,
reinterpret_cast<unsigned char *>(secret.data()),
&length) == 1) {
secret.resize(length);

@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.

src/core/crypto/crypto_ecdh_openssl.cc:56: ecdh_derive is documented to return a fixed-length x-coordinate, but the OpenSSL/Apple/Windows implementations return whatever length the platform API provides; consider ensuring the returned secret length matches the expected field_bytes to keep the cross-backend contract consistent.

Severity: medium

Other Locations
  • src/core/crypto/crypto_ecdh_apple.cc:60
  • src/core/crypto/crypto_ecdh_windows.cc:179

Fix This in Augment

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

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

@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 and verified against the latest diff

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_ecdh_apple.cc">

<violation number="1" location="src/core/crypto/crypto_ecdh_apple.cc:14">
P3: Apple key-internal layout is now duplicated across three backends, so a later field change can silently desynchronize key readers. A shared Apple-private internal header would keep this ABI-sensitive definition single-sourced.</violation>
</file>

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

Re-trigger cubic

Comment thread src/core/crypto/crypto_ecdh.cc

// The layout matches the definitions in the sibling Apple key backends, since
// each translation unit that reads a key redeclares its file-private members
struct PublicKey::Internal {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Apple key-internal layout is now duplicated across three backends, so a later field change can silently desynchronize key readers. A shared Apple-private internal header would keep this ABI-sensitive definition single-sourced.

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

<comment>Apple key-internal layout is now duplicated across three backends, so a later field change can silently desynchronize key readers. A shared Apple-private internal header would keep this ABI-sensitive definition single-sourced.</comment>

<file context>
@@ -0,0 +1,66 @@
+
+// The layout matches the definitions in the sibling Apple key backends, since
+// each translation unit that reads a key redeclares its file-private members
+struct PublicKey::Internal {
+  PublicKey::Type kind;
+  SecKeyRef key;
</file context>

@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.

All reported issues were addressed across 9 files (changes from recent commits).

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

Re-trigger cubic

Comment thread src/core/crypto/crypto_helpers.h Outdated
jviotti added 2 commits July 23, 2026 17:05
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
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 (linux/gcc)

Details
Benchmark suite Current: b8cac26 Previous: 9c5fd3a Ratio
JOSE_VerifySignature_RS256 18943.94407796536 ns/iter 24867.275367426657 ns/iter 0.76
JOSE_VerifySignature_ES512 420390.8123872871 ns/iter 642862.4224058908 ns/iter 0.65
GZIP_Compress_ISO_Language_Set_3_Locations 23450632.266667526 ns/iter 39764862.222221434 ns/iter 0.59
GZIP_Decompress_ISO_Language_Set_3_Locations 3126328.3750000424 ns/iter 4019405.794285506 ns/iter 0.78
GZIP_Compress_ISO_Language_Set_3_Schema 1613082.9930555518 ns/iter 2303159.223683936 ns/iter 0.70
GZIP_Decompress_ISO_Language_Set_3_Schema 300876.3768865982 ns/iter 312144.6402609338 ns/iter 0.96
HTML_Build_Table_100000 42444173.81249832 ns/iter 72450943.79999273 ns/iter 0.59
HTML_Render_Table_100000 2637075.9735849584 ns/iter 1989993.0934842047 ns/iter 1.33
JSONLD_Catalog_Annotation_List_Populate 1023940.5284673126 ns/iter 1353047.89674952 ns/iter 0.76
JSONLD_Catalog_Materialize 5286901.113636029 ns/iter 6851553.627449912 ns/iter 0.77
JSONL_Parse_Large 10266107.397058023 ns/iter 12700883.363636835 ns/iter 0.81
JSONL_Parse_Large_GZIP 11402115.112902736 ns/iter 14284054.346940046 ns/iter 0.80
URITemplateRouter_Create 23056.9583058255 ns/iter 29825.54553176726 ns/iter 0.77
URITemplateRouter_Match 137.75646124077647 ns/iter 158.3325347662009 ns/iter 0.87
URITemplateRouter_Match_BasePath 157.1765017414286 ns/iter 192.53390987208704 ns/iter 0.82
URITemplateRouterView_Restore 2928.6185710637474 ns/iter 9784.968085399274 ns/iter 0.30
URITemplateRouterView_Match 98.5167295402569 ns/iter 124.62122251879906 ns/iter 0.79
URITemplateRouterView_Match_BasePath 112.77743422911776 ns/iter 142.812541319079 ns/iter 0.79
URITemplateRouterView_Arguments 385.14578435667147 ns/iter 461.73117561029204 ns/iter 0.83
JSONPath_Descendant_Filter_Nested 1194.4319672312947 ns/iter 1835.7843209383184 ns/iter 0.65
Pointer_Object_Traverse 23.55277958389401 ns/iter 32.35457378151655 ns/iter 0.73
Pointer_Object_Try_Traverse 22.74571409489074 ns/iter 26.059612849571515 ns/iter 0.87
Pointer_Push_Back_Pointer_To_Weak_Pointer 124.22268948996219 ns/iter 168.93993923689504 ns/iter 0.74
Pointer_Walker_Schema_ISO_Language 2128480.632836048 ns/iter 2882260.03571405 ns/iter 0.74
Pointer_Maybe_Tracked_Deeply_Nested/0 1662305.590027882 ns/iter 1892391.8189188584 ns/iter 0.88
Pointer_Maybe_Tracked_Deeply_Nested/1 1518416.120582093 ns/iter 1640262.7868850222 ns/iter 0.93
Pointer_Position_Tracker_Get_Deeply_Nested 395.6478541984617 ns/iter 595.5357075239212 ns/iter 0.66
JSON_Array_Of_Objects_Unique 330.8835229041001 ns/iter 403.2008406391322 ns/iter 0.82
JSON_Parse_1 7614.114374151096 ns/iter 9888.643919806613 ns/iter 0.77
JSON_Parse_Real 5885.251103169461 ns/iter 7718.522826703761 ns/iter 0.76
JSON_Parse_Decimal 8602.957165043752 ns/iter 11093.072708247246 ns/iter 0.78
JSON_Parse_Schema_ISO_Language 5260202.939849595 ns/iter 6647493.142856677 ns/iter 0.79
JSON_Parse_Integer 4249.931605841637 ns/iter 5673.945026156319 ns/iter 0.75
JSON_Parse_String_NonSSO_Plain 9081.724897388754 ns/iter 12003.488790777386 ns/iter 0.76
JSON_Parse_String_SSO_Plain 3867.9314261959184 ns/iter 4734.699386046081 ns/iter 0.82
JSON_Parse_String_Escape_Heavy 20154.143538859837 ns/iter 24252.558835759293 ns/iter 0.83
JSON_Parse_Object_Short_Keys 10275.380857881495 ns/iter 14219.152600897854 ns/iter 0.72
JSON_Parse_Object_Scalar_Properties 5453.66551374694 ns/iter 7108.821155999166 ns/iter 0.77
JSON_Parse_Object_Array_Properties 9186.4055475219 ns/iter 12440.591924993934 ns/iter 0.74
JSON_Parse_Object_Object_Properties 9261.175041045824 ns/iter 11997.156076591591 ns/iter 0.77
JSON_Parse_Nested_Containers 82117.35102938085 ns/iter 98412.66704115746 ns/iter 0.83
JSON_From_String_Copy 15.754773199586122 ns/iter 19.26135549759458 ns/iter 0.82
JSON_From_String_Temporary 12.928735970453522 ns/iter 16.01439887631255 ns/iter 0.81
JSON_Number_To_Double 19.356193703661024 ns/iter 19.7016357478828 ns/iter 0.98
JSON_Object_At_Last_Key/8 4.0133102564606595 ns/iter 4.197492544765987 ns/iter 0.96
JSON_Object_At_Last_Key/32 11.37792021778168 ns/iter 13.370367501479784 ns/iter 0.85
JSON_Object_At_Last_Key/128 43.632432663195665 ns/iter 47.22434843976716 ns/iter 0.92
JSON_Object_At_Last_Key/512 181.9101156688013 ns/iter 288.1752119542387 ns/iter 0.63
JSON_Fast_Hash_Helm_Chart_Lock 55.87025804252581 ns/iter 71.54466694209201 ns/iter 0.78
JSON_Equality_Helm_Chart_Lock 129.28363623500573 ns/iter 177.12909733474598 ns/iter 0.73
JSON_Divisible_By_Decimal 206.83342757208493 ns/iter 244.03428550436738 ns/iter 0.85
JSON_String_Equal/10 4.634775469996444 ns/iter 5.366690622220031 ns/iter 0.86
JSON_String_Equal/100 5.707323659336421 ns/iter 6.067405762917184 ns/iter 0.94
JSON_String_Equal_Small_By_Perfect_Hash/10 0.8051335093056295 ns/iter 0.7145790213529799 ns/iter 1.13
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.887809204194662 ns/iter 21.94028523716301 ns/iter 0.68
JSON_String_Fast_Hash/10 2.877904766413749 ns/iter 2.4679072304861496 ns/iter 1.17
JSON_String_Fast_Hash/100 2.8687833708555415 ns/iter 2.463249269644424 ns/iter 1.16
JSON_String_Key_Hash/10 1.1196153820864958 ns/iter 1.085154335026577 ns/iter 1.03
JSON_String_Key_Hash/100 11.252500892698253 ns/iter 14.757280379186833 ns/iter 0.76
JSON_Object_Defines_Miss_Same_Length 2.5671927182976697 ns/iter 3.1645397796331074 ns/iter 0.81
JSON_Object_Defines_Miss_Too_Small 2.8498330645710004 ns/iter 3.518325461428668 ns/iter 0.81
JSON_Object_Defines_Miss_Too_Large 2.5235352874537416 ns/iter 3.163288510700116 ns/iter 0.80
Regex_Lower_S_Or_Upper_S_Asterisk 1.1150582298369947 ns/iter 1.057536593043176 ns/iter 1.05
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.8441530509847978 ns/iter 0.7035183556116686 ns/iter 1.20
Regex_Period_Asterisk 1.1175104861947462 ns/iter 1.0555331103424788 ns/iter 1.06
Regex_Group_Period_Asterisk_Group 0.8444981140838572 ns/iter 0.7035250878755515 ns/iter 1.20
Regex_Period_Plus 1.1185233553228966 ns/iter 1.0553410959795544 ns/iter 1.06
Regex_Period 0.8477890800690373 ns/iter 0.7031402681769824 ns/iter 1.21
Regex_Caret_Period_Plus_Dollar 1.121194915005596 ns/iter 1.0561138247930666 ns/iter 1.06
Regex_Caret_Group_Period_Plus_Group_Dollar 0.8439042072164844 ns/iter 0.704104762266169 ns/iter 1.20
Regex_Caret_Period_Asterisk_Dollar 1.122749252119145 ns/iter 1.0557119798669579 ns/iter 1.06
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.847679414121641 ns/iter 0.7034922901093916 ns/iter 1.20
Regex_Caret_X_Hyphen 3.3766481858862725 ns/iter 4.222576797508386 ns/iter 0.80
Regex_Period_Md_Dollar 16.15811749433088 ns/iter 33.20224488777931 ns/iter 0.49
Regex_Caret_Slash_Period_Asterisk 3.3535196744380666 ns/iter 4.5708875650421374 ns/iter 0.73
Regex_Caret_Period_Range_Dollar 1.3995149581130866 ns/iter 1.4068137423731701 ns/iter 0.99
Regex_Nested_Backtrack 33.553254254578114 ns/iter 45.72967211620973 ns/iter 0.73

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: b8cac26 Previous: 9c5fd3a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.34255267857223 ns/iter 5.364517000000433 ns/iter 1.00
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.015637500000431 ns/iter 5.024768000000677 ns/iter 1.00
Regex_Period_Asterisk 5.091553483279597 ns/iter 5.028362612729861 ns/iter 1.01
Regex_Group_Period_Asterisk_Group 5.034593999998833 ns/iter 5.2336874999992595 ns/iter 0.96
Regex_Period_Plus 5.1177366071430335 ns/iter 5.027698999999757 ns/iter 1.02
Regex_Period 5.340282142855456 ns/iter 5.331232142858815 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 5.0263223214293316 ns/iter 5.028566964284663 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 5.326698999999735 ns/iter 5.373779999999898 ns/iter 0.99
Regex_Caret_Period_Asterisk_Dollar 5.44714200000044 ns/iter 5.334521428571699 ns/iter 1.02
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.059034999999312 ns/iter 5.019224999998642 ns/iter 1.01
Regex_Caret_X_Hyphen 8.47854017857078 ns/iter 8.521059336959711 ns/iter 1.00
Regex_Period_Md_Dollar 45.10003575804931 ns/iter 45.19276249999393 ns/iter 1.00
Regex_Caret_Slash_Period_Asterisk 7.996014508927983 ns/iter 7.980191964287135 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 5.956367999999657 ns/iter 5.959831000000122 ns/iter 1.00
Regex_Nested_Backtrack 55.58663392857203 ns/iter 55.427080357150416 ns/iter 1.00
JSON_Array_Of_Objects_Unique 592.0188392857589 ns/iter 593.7288392857454 ns/iter 1.00
JSON_Parse_1 9297.259833659538 ns/iter 8850.249775670149 ns/iter 1.05
JSON_Parse_Real 16101.456036538171 ns/iter 16130.890625000964 ns/iter 1.00
JSON_Parse_Decimal 11717.821874999145 ns/iter 11726.53124999812 ns/iter 1.00
JSON_Parse_Schema_ISO_Language 7517792.222221133 ns/iter 7321132.222222736 ns/iter 1.03
JSON_Parse_Integer 6143.025892857931 ns/iter 6149.723214286544 ns/iter 1.00
JSON_Parse_String_NonSSO_Plain 7796.732142857365 ns/iter 7987.066964285003 ns/iter 0.98
JSON_Parse_String_SSO_Plain 3686.238532110376 ns/iter 3742.937423325999 ns/iter 0.98
JSON_Parse_String_Escape_Heavy 21519.554872028653 ns/iter 21704.012499995428 ns/iter 0.99
JSON_Parse_Object_Short_Keys 13250.251114953227 ns/iter 13242.70360400106 ns/iter 1.00
JSON_Parse_Object_Scalar_Properties 6924.821428572362 ns/iter 6810.367857141841 ns/iter 1.02
JSON_Parse_Object_Array_Properties 11731.682142855758 ns/iter 11313.103124997782 ns/iter 1.04
JSON_Parse_Object_Object_Properties 11976.899999999498 ns/iter 11441.010937499384 ns/iter 1.05
JSON_Parse_Nested_Containers 79671.62946430151 ns/iter 78541.03794642242 ns/iter 1.01
JSON_From_String_Copy 64.1110044643004 ns/iter 63.64219866072623 ns/iter 1.01
JSON_From_String_Temporary 60.02158035715053 ns/iter 58.58304464285067 ns/iter 1.02
JSON_Number_To_Double 121.29860937498904 ns/iter 122.07471428569404 ns/iter 0.99
JSON_Object_At_Last_Key/8 7.261459821429181 ns/iter 7.229478794642372 ns/iter 1.00
JSON_Object_At_Last_Key/32 23.36208456068958 ns/iter 23.21207451771865 ns/iter 1.01
JSON_Object_At_Last_Key/128 91.16439771588337 ns/iter 89.38084821427898 ns/iter 1.02
JSON_Object_At_Last_Key/512 427.5186092105752 ns/iter 424.95788782818676 ns/iter 1.01
JSON_Fast_Hash_Helm_Chart_Lock 102.04778115858215 ns/iter 102.16839285716516 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 232.4351250000234 ns/iter 234.01487343583184 ns/iter 0.99
JSON_Divisible_By_Decimal 304.2136873118808 ns/iter 307.34638310864204 ns/iter 0.99
JSON_String_Equal/10 10.40601406250019 ns/iter 10.344881250002658 ns/iter 1.01
JSON_String_Equal/100 11.646348214286816 ns/iter 11.610662500000757 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 2.5144100423976377 ns/iter 2.506912499999966 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.486982524611113 ns/iter 15.00870312499712 ns/iter 0.97
JSON_String_Fast_Hash/10 6.611051785715257 ns/iter 6.579320535714876 ns/iter 1.00
JSON_String_Fast_Hash/100 6.774426785712859 ns/iter 6.576434821427922 ns/iter 1.03
JSON_String_Key_Hash/10 5.398315178571319 ns/iter 5.347629999998844 ns/iter 1.01
JSON_String_Key_Hash/100 11.874700000000919 ns/iter 11.888432142857905 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.908740185551836 ns/iter 3.767515707557392 ns/iter 1.04
JSON_Object_Defines_Miss_Too_Small 4.080536346572375 ns/iter 4.080547373357619 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Large 3.7678639218434324 ns/iter 3.7612874932837856 ns/iter 1.00
Pointer_Object_Traverse 71.04752678569884 ns/iter 70.64611607142572 ns/iter 1.01
Pointer_Object_Try_Traverse 72.19647321429687 ns/iter 71.5946763392848 ns/iter 1.01
Pointer_Push_Back_Pointer_To_Weak_Pointer 184.51215040290785 ns/iter 170.65985517809597 ns/iter 1.08
Pointer_Walker_Schema_ISO_Language 11973216.071429046 ns/iter 10466525.00000178 ns/iter 1.14
Pointer_Maybe_Tracked_Deeply_Nested/0 2484198.3935746164 ns/iter 2379259.285714852 ns/iter 1.04
Pointer_Maybe_Tracked_Deeply_Nested/1 3779409.7435905244 ns/iter 3775644.3850271283 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 591.1318080357322 ns/iter 543.6275706814467 ns/iter 1.09
JSONPath_Descendant_Filter_Nested 2446.8515102107986 ns/iter 2402.80546561874 ns/iter 1.02
URITemplateRouter_Create 40942.847194010545 ns/iter 41880.71499042339 ns/iter 0.98
URITemplateRouter_Match 233.33736235074926 ns/iter 239.9490468806861 ns/iter 0.97
URITemplateRouter_Match_BasePath 265.6542306095505 ns/iter 266.2571993864563 ns/iter 1.00
URITemplateRouterView_Restore 32971.771433932845 ns/iter 33496.7835395729 ns/iter 0.98
URITemplateRouterView_Match 181.44175727159126 ns/iter 180.7459228177976 ns/iter 1.00
URITemplateRouterView_Match_BasePath 205.60070733928146 ns/iter 206.57609375000163 ns/iter 1.00
URITemplateRouterView_Arguments 532.9966964286622 ns/iter 534.6247999998468 ns/iter 1.00
JSONL_Parse_Large 32874857.142858323 ns/iter 33166139.999991626 ns/iter 0.99
JSONL_Parse_Large_GZIP 34344652.38095592 ns/iter 33731944.99999954 ns/iter 1.02
JSONLD_Catalog_Annotation_List_Populate 2721457.8313252577 ns/iter 2787129.718875891 ns/iter 0.98
JSONLD_Catalog_Materialize 9321395.312497316 ns/iter 7927607.999999964 ns/iter 1.18
HTML_Build_Table_100000 90701644.4444303 ns/iter 89067614.2857306 ns/iter 1.02
HTML_Render_Table_100000 7834242.222222404 ns/iter 7833082.2222217955 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Locations 36269436.84211208 ns/iter 36591926.31579045 ns/iter 0.99
GZIP_Decompress_ISO_Language_Set_3_Locations 10086501.562501127 ns/iter 9635387.999999996 ns/iter 1.05
GZIP_Compress_ISO_Language_Set_3_Schema 2115545.8445039904 ns/iter 2113512.8125003176 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 622930.4687500761 ns/iter 609297.1428572014 ns/iter 1.02
JOSE_VerifySignature_RS256 21267.818750004608 ns/iter 22639.215625005705 ns/iter 0.94
JOSE_VerifySignature_ES512 1542494.5783134247 ns/iter 1536227.911646691 ns/iter 1.00

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 (macos/llvm)

Details
Benchmark suite Current: b8cac26 Previous: 9c5fd3a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.6485024670666764 ns/iter 2.1824399561899823 ns/iter 0.76
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.9154788080874312 ns/iter 1.993132998437468 ns/iter 0.96
Regex_Period_Asterisk 1.8259245051856403 ns/iter 2.0522224934976037 ns/iter 0.89
Regex_Group_Period_Asterisk_Group 1.832715724297832 ns/iter 2.2388314223704073 ns/iter 0.82
Regex_Period_Plus 2.2482397734775903 ns/iter 2.668463662486303 ns/iter 0.84
Regex_Period 2.1017611128547777 ns/iter 2.579291948690537 ns/iter 0.81
Regex_Caret_Period_Plus_Dollar 2.2065561893854904 ns/iter 2.4589031888528687 ns/iter 0.90
Regex_Caret_Group_Period_Plus_Group_Dollar 2.3900344514983494 ns/iter 2.4235120097564495 ns/iter 0.99
Regex_Caret_Period_Asterisk_Dollar 1.9653131115059848 ns/iter 2.168361157610721 ns/iter 0.91
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.8975467698394939 ns/iter 2.212114349997565 ns/iter 0.86
Regex_Caret_X_Hyphen 6.529240204022733 ns/iter 7.380552524344995 ns/iter 0.88
Regex_Period_Md_Dollar 19.057090541249995 ns/iter 27.415354912131722 ns/iter 0.70
Regex_Caret_Slash_Period_Asterisk 4.595956418709808 ns/iter 7.89000810534352 ns/iter 0.58
Regex_Caret_Period_Range_Dollar 2.027528024182891 ns/iter 3.274020358034846 ns/iter 0.62
Regex_Nested_Backtrack 26.709762071532605 ns/iter 38.63130409764298 ns/iter 0.69
JSON_Array_Of_Objects_Unique 376.7367865681057 ns/iter 449.3903235457808 ns/iter 0.84
JSON_Parse_1 6683.05692792301 ns/iter 8372.690449988668 ns/iter 0.80
JSON_Parse_Real 6575.889434699534 ns/iter 8189.020954452444 ns/iter 0.80
JSON_Parse_Decimal 7412.345450641237 ns/iter 9744.588514071009 ns/iter 0.76
JSON_Parse_Schema_ISO_Language 3940148.811225021 ns/iter 5258551.20339063 ns/iter 0.75
JSON_Parse_Integer 4462.164366932018 ns/iter 5492.215606403308 ns/iter 0.81
JSON_Parse_String_NonSSO_Plain 8208.909806351896 ns/iter 8889.590764189492 ns/iter 0.92
JSON_Parse_String_SSO_Plain 2833.2041274440508 ns/iter 3572.5341606980182 ns/iter 0.79
JSON_Parse_String_Escape_Heavy 25292.040007571508 ns/iter 27005.20192128752 ns/iter 0.94
JSON_Parse_Object_Short_Keys 7910.820853507193 ns/iter 9133.472767972284 ns/iter 0.87
JSON_Parse_Object_Scalar_Properties 4303.044026718472 ns/iter 5858.522381158798 ns/iter 0.73
JSON_Parse_Object_Array_Properties 9607.961595529983 ns/iter 8954.958818501978 ns/iter 1.07
JSON_Parse_Object_Object_Properties 9440.795980600204 ns/iter 9753.124545354096 ns/iter 0.97
JSON_Parse_Nested_Containers 66133.3221800205 ns/iter 73735.94348185623 ns/iter 0.90
JSON_From_String_Copy 29.393361495011845 ns/iter 28.828522973634307 ns/iter 1.02
JSON_From_String_Temporary 25.19442926366546 ns/iter 21.944698554153085 ns/iter 1.15
JSON_Number_To_Double 43.80185550720889 ns/iter 45.014692348971316 ns/iter 0.97
JSON_Object_At_Last_Key/8 4.997639397278196 ns/iter 5.466638205306049 ns/iter 0.91
JSON_Object_At_Last_Key/32 12.74619552108948 ns/iter 15.574680824503572 ns/iter 0.82
JSON_Object_At_Last_Key/128 56.344072482468235 ns/iter 66.42697624241525 ns/iter 0.85
JSON_Object_At_Last_Key/512 176.959730925708 ns/iter 229.47480431890514 ns/iter 0.77
JSON_Fast_Hash_Helm_Chart_Lock 57.664588956196006 ns/iter 78.93526404897473 ns/iter 0.73
JSON_Equality_Helm_Chart_Lock 152.83300622633428 ns/iter 194.41160403868776 ns/iter 0.79
JSON_Divisible_By_Decimal 165.005083285199 ns/iter 228.5689508444577 ns/iter 0.72
JSON_String_Equal/10 6.8348204229216725 ns/iter 11.847873593969966 ns/iter 0.58
JSON_String_Equal/100 6.653684643913359 ns/iter 9.17927750097516 ns/iter 0.72
JSON_String_Equal_Small_By_Perfect_Hash/10 0.352886546936217 ns/iter 0.4475375226452744 ns/iter 0.79
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.44543539452799 ns/iter 3.6959409468435744 ns/iter 0.93
JSON_String_Fast_Hash/10 2.5468344842652644 ns/iter 3.0862875675967936 ns/iter 0.83
JSON_String_Fast_Hash/100 2.033381190621273 ns/iter 3.0085796949533847 ns/iter 0.68
JSON_String_Key_Hash/10 1.68571337449497 ns/iter 2.239281956699228 ns/iter 0.75
JSON_String_Key_Hash/100 2.113998268144359 ns/iter 3.035127315942972 ns/iter 0.70
JSON_Object_Defines_Miss_Same_Length 2.6662830020000627 ns/iter 3.7541212198190546 ns/iter 0.71
JSON_Object_Defines_Miss_Too_Small 2.847445830456827 ns/iter 3.4993576241402327 ns/iter 0.81
JSON_Object_Defines_Miss_Too_Large 2.7454284526937376 ns/iter 3.3395297773533046 ns/iter 0.82
Pointer_Object_Traverse 23.4699703466859 ns/iter 29.950250545682966 ns/iter 0.78
Pointer_Object_Try_Traverse 22.899627114217022 ns/iter 26.975983242076484 ns/iter 0.85
Pointer_Push_Back_Pointer_To_Weak_Pointer 177.131396043568 ns/iter 201.35034195900076 ns/iter 0.88
Pointer_Walker_Schema_ISO_Language 2626902.826568431 ns/iter 4182148.0507612857 ns/iter 0.63
Pointer_Maybe_Tracked_Deeply_Nested/0 1442239.6755793209 ns/iter 1785257.1428572144 ns/iter 0.81
Pointer_Maybe_Tracked_Deeply_Nested/1 1119538.70808678 ns/iter 1805540.1785714903 ns/iter 0.62
Pointer_Position_Tracker_Get_Deeply_Nested 353.25561201962046 ns/iter 501.47626130451437 ns/iter 0.70
JSONPath_Descendant_Filter_Nested 1318.9984055335917 ns/iter 1912.1268613980308 ns/iter 0.69
URITemplateRouter_Create 23810.715642989882 ns/iter 33892.55655829371 ns/iter 0.70
URITemplateRouter_Match 169.61452963327147 ns/iter 247.7741853421458 ns/iter 0.68
URITemplateRouter_Match_BasePath 190.7545703225167 ns/iter 284.83263381649374 ns/iter 0.67
URITemplateRouterView_Restore 10370.167760363202 ns/iter 16822.89567659003 ns/iter 0.62
URITemplateRouterView_Match 140.47699943144445 ns/iter 148.0286283119322 ns/iter 0.95
URITemplateRouterView_Match_BasePath 159.9869402280003 ns/iter 184.09415068274734 ns/iter 0.87
URITemplateRouterView_Arguments 533.1968111011173 ns/iter 668.5126499947595 ns/iter 0.80
JSONL_Parse_Large 10865063.46153748 ns/iter 15642690.048779758 ns/iter 0.69
JSONL_Parse_Large_GZIP 12301880.859375559 ns/iter 14978380.388887065 ns/iter 0.82
JSONLD_Catalog_Annotation_List_Populate 948772.0982655962 ns/iter 1245843.3028035802 ns/iter 0.76
JSONLD_Catalog_Materialize 5226576.8297871575 ns/iter 6534077.020202142 ns/iter 0.80
HTML_Build_Table_100000 41104781.823525414 ns/iter 50311962.49999539 ns/iter 0.82
HTML_Render_Table_100000 1786699.8962964083 ns/iter 2057767.350194529 ns/iter 0.87
GZIP_Compress_ISO_Language_Set_3_Locations 26722954.874998093 ns/iter 34509824.57894426 ns/iter 0.77
GZIP_Decompress_ISO_Language_Set_3_Locations 3319358.6165048894 ns/iter 4268252.218935232 ns/iter 0.78
GZIP_Compress_ISO_Language_Set_3_Schema 1587632.6470585326 ns/iter 1633990.9600999686 ns/iter 0.97
GZIP_Decompress_ISO_Language_Set_3_Schema 294851.99652778957 ns/iter 321121.1591015331 ns/iter 0.92
JOSE_VerifySignature_RS256 22113.370476161857 ns/iter 26629.751003611098 ns/iter 0.83
JOSE_VerifySignature_ES512 1154480.1307814324 ns/iter 1180444.6022727257 ns/iter 0.98

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: b8cac26 Previous: 9c5fd3a Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.8185302795449156 ns/iter 2.529217438380444 ns/iter 1.11
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.469218263993428 ns/iter 2.1976290623486823 ns/iter 1.12
Regex_Period_Asterisk 2.4621160469552636 ns/iter 2.191666567945331 ns/iter 1.12
Regex_Group_Period_Asterisk_Group 2.4701761048721504 ns/iter 2.4908412752326945 ns/iter 0.99
Regex_Period_Plus 4.241382702985516 ns/iter 3.116610809781855 ns/iter 1.36
Regex_Period 3.8721468776397496 ns/iter 2.805079280750345 ns/iter 1.38
Regex_Caret_Period_Plus_Dollar 3.8705867714970523 ns/iter 2.801603239997473 ns/iter 1.38
Regex_Caret_Group_Period_Plus_Group_Dollar 3.8676013260222395 ns/iter 3.113051564029061 ns/iter 1.24
Regex_Caret_Period_Asterisk_Dollar 3.172817860843798 ns/iter 3.7410347147768572 ns/iter 0.85
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.820416556498546 ns/iter 2.199344917936893 ns/iter 1.28
Regex_Caret_X_Hyphen 6.691664446234426 ns/iter 5.612091978549437 ns/iter 1.19
Regex_Period_Md_Dollar 26.295971025016602 ns/iter 28.512675155364622 ns/iter 0.92
Regex_Caret_Slash_Period_Asterisk 7.737016515783159 ns/iter 6.23141446264418 ns/iter 1.24
Regex_Caret_Period_Range_Dollar 2.829996063958225 ns/iter 4.3574669652383164 ns/iter 0.65
Regex_Nested_Backtrack 38.13389009076022 ns/iter 38.886190058233645 ns/iter 0.98
JSON_Array_Of_Objects_Unique 415.4913573584413 ns/iter 398.22231293999454 ns/iter 1.04
JSON_Parse_1 4786.902482536237 ns/iter 4840.5290025444865 ns/iter 0.99
JSON_Parse_Real 5327.057290716583 ns/iter 5334.4101034238065 ns/iter 1.00
JSON_Parse_Decimal 7577.539285796857 ns/iter 7530.671751794146 ns/iter 1.01
JSON_Parse_Schema_ISO_Language 3622597.731958935 ns/iter 3507580.1950000594 ns/iter 1.03
JSON_Parse_Integer 3928.9484206990014 ns/iter 3754.6578200669896 ns/iter 1.05
JSON_Parse_String_NonSSO_Plain 5109.534700007005 ns/iter 5064.692397070116 ns/iter 1.01
JSON_Parse_String_SSO_Plain 2795.0624910225897 ns/iter 2769.639018215341 ns/iter 1.01
JSON_Parse_String_Escape_Heavy 15214.031585788212 ns/iter 14344.265528172322 ns/iter 1.06
JSON_Parse_Object_Short_Keys 8131.585206394753 ns/iter 10515.70196090375 ns/iter 0.77
JSON_Parse_Object_Scalar_Properties 4177.125345577504 ns/iter 4146.9143622133415 ns/iter 1.01
JSON_Parse_Object_Array_Properties 5980.175152211773 ns/iter 5803.263069838392 ns/iter 1.03
JSON_Parse_Object_Object_Properties 6037.3126296854525 ns/iter 5720.024789137002 ns/iter 1.06
JSON_Parse_Nested_Containers 46484.1125739746 ns/iter 46357.56151356783 ns/iter 1.00
JSON_From_String_Copy 22.288508342012477 ns/iter 21.18245699223161 ns/iter 1.05
JSON_From_String_Temporary 19.737754857411396 ns/iter 19.100787193127747 ns/iter 1.03
JSON_Number_To_Double 22.91417867540927 ns/iter 24.011232335038997 ns/iter 0.95
JSON_Object_At_Last_Key/8 4.005252200034239 ns/iter 3.8399025860870957 ns/iter 1.04
JSON_Object_At_Last_Key/32 13.715375243822018 ns/iter 12.767407985374703 ns/iter 1.07
JSON_Object_At_Last_Key/128 46.84582611514369 ns/iter 54.97973450792857 ns/iter 0.85
JSON_Object_At_Last_Key/512 365.5314275440642 ns/iter 392.5246608527171 ns/iter 0.93
JSON_Fast_Hash_Helm_Chart_Lock 69.96856073207127 ns/iter 63.1076798681344 ns/iter 1.11
JSON_Equality_Helm_Chart_Lock 169.81099483399439 ns/iter 151.1197838570922 ns/iter 1.12
JSON_Divisible_By_Decimal 249.29905060115266 ns/iter 250.45419989055446 ns/iter 1.00
JSON_String_Equal/10 5.98230965151317 ns/iter 5.609434720041909 ns/iter 1.07
JSON_String_Equal/100 5.981502044370098 ns/iter 6.23641906070972 ns/iter 0.96
JSON_String_Equal_Small_By_Perfect_Hash/10 1.0549083728098931 ns/iter 0.936761346381218 ns/iter 1.13
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.390397296167183 ns/iter 10.601876057978354 ns/iter 1.17
JSON_String_Fast_Hash/10 2.4612659723221353 ns/iter 2.49141989090132 ns/iter 0.99
JSON_String_Fast_Hash/100 2.4909744952819257 ns/iter 2.4910493637094975 ns/iter 1.00
JSON_String_Key_Hash/10 2.4618653070824097 ns/iter 2.1818125225058647 ns/iter 1.13
JSON_String_Key_Hash/100 7.7324431451849325 ns/iter 6.54028128288609 ns/iter 1.18
JSON_Object_Defines_Miss_Same_Length 4.2386881490435 ns/iter 3.4409441658489994 ns/iter 1.23
JSON_Object_Defines_Miss_Too_Small 3.1939383308596003 ns/iter 3.2135387942502174 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 2.925470964158478 ns/iter 2.541934206428116 ns/iter 1.15
Pointer_Object_Traverse 30.82735484593362 ns/iter 29.36887457223673 ns/iter 1.05
Pointer_Object_Try_Traverse 33.20452886843344 ns/iter 31.153649657541724 ns/iter 1.07
Pointer_Push_Back_Pointer_To_Weak_Pointer 170.44576675797285 ns/iter 153.35107402428918 ns/iter 1.11
Pointer_Walker_Schema_ISO_Language 2737910.0232556364 ns/iter 2619658.629213576 ns/iter 1.05
Pointer_Maybe_Tracked_Deeply_Nested/0 1263274.7632058964 ns/iter 1287663.123844645 ns/iter 0.98
Pointer_Maybe_Tracked_Deeply_Nested/1 1643218.590047215 ns/iter 1637560.8682354891 ns/iter 1.00
Pointer_Position_Tracker_Get_Deeply_Nested 674.2281897914315 ns/iter 674.2846033917174 ns/iter 1.00
JSONPath_Descendant_Filter_Nested 1575.0438308770433 ns/iter 1599.580475680848 ns/iter 0.98
URITemplateRouter_Create 31495.233328854963 ns/iter 33591.59337658399 ns/iter 0.94
URITemplateRouter_Match 186.37166900784536 ns/iter 180.21482828622877 ns/iter 1.03
URITemplateRouter_Match_BasePath 219.47142582671611 ns/iter 205.25143012931446 ns/iter 1.07
URITemplateRouterView_Restore 9981.700429039907 ns/iter 8363.406424303168 ns/iter 1.19
URITemplateRouterView_Match 145.1727001684922 ns/iter 144.42797152198085 ns/iter 1.01
URITemplateRouterView_Match_BasePath 165.71483234205067 ns/iter 164.7183820362487 ns/iter 1.01
URITemplateRouterView_Arguments 457.0764919702576 ns/iter 438.40344374246433 ns/iter 1.04
JSONL_Parse_Large 9305015.866666507 ns/iter 9876332.352113947 ns/iter 0.94
JSONL_Parse_Large_GZIP 11219805.396826308 ns/iter 11426545.180327473 ns/iter 0.98
JSONLD_Catalog_Annotation_List_Populate 1296513.2003745318 ns/iter 1242962.1494661951 ns/iter 1.04
JSONLD_Catalog_Materialize 4389081.710691524 ns/iter 4281731.237805305 ns/iter 1.03
HTML_Build_Table_100000 73656910.33333457 ns/iter 68038278.20000379 ns/iter 1.08
HTML_Render_Table_100000 5239591.999999832 ns/iter 5524610.984127414 ns/iter 0.95
GZIP_Compress_ISO_Language_Set_3_Locations 35621462.04999976 ns/iter 33242144.047616895 ns/iter 1.07
GZIP_Decompress_ISO_Language_Set_3_Locations 4287099.957055117 ns/iter 4225478.753011819 ns/iter 1.01
GZIP_Compress_ISO_Language_Set_3_Schema 2119542.8761330014 ns/iter 1882418.552560683 ns/iter 1.13
GZIP_Decompress_ISO_Language_Set_3_Schema 276443.12702806917 ns/iter 359446.06307694834 ns/iter 0.77
JOSE_VerifySignature_RS256 63962.46928904571 ns/iter 60375.011378330746 ns/iter 1.06
JOSE_VerifySignature_ES512 2711997.8030887386 ns/iter 2424507.6068966445 ns/iter 1.12

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

@jviotti
jviotti merged commit f6c9532 into main Jul 23, 2026
12 checks passed
@jviotti
jviotti deleted the ecdh branch July 23, 2026 20:57
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