Skip to content

Add RFC 5869 HKDF to the crypto module - #2744

Merged
jviotti merged 1 commit into
mainfrom
hkdf
Aug 18, 2026
Merged

Add RFC 5869 HKDF to the crypto module#2744
jviotti merged 1 commit into
mainfrom
hkdf

Conversation

@jviotti

@jviotti jviotti commented Aug 18, 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 Aug 18, 2026

Copy link
Copy Markdown

This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it.

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

3 issues found across 20 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_hkdf_loop.h">

<violation number="1" location="src/core/crypto/crypto_hkdf_loop.h:31">
P2: Each HMAC result is copied into `output` but never wiped, leaving the PRK or an expanded key block in a temporary stack array after every round. Make the digest mutable and wipe it after copying, preferably with an RAII buffer guard.</violation>

<violation number="2" location="src/core/crypto/crypto_hkdf_loop.h:109">
P2: When expansion throws, `hkdf_derive_loop` unwinds before reaching `secure_zero`, leaving the extracted PRK on the stack. Guard `pseudorandom_key` with an RAII wiping scope so every exit path clears it.</violation>
</file>

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

<violation number="1" location="src/core/crypto/crypto_hkdf.cc:30">
P2: The `extract` template discards the return value of `hkdf_extract`, so a backend failure is silently converted into a successful call that returns the zero-initialized `output` array as if it were a valid pseudorandom key. On the OpenSSL backend `hkdf_extract` is `EVP_KDF_derive(...) == 1`, which returns false on provider/parameter failure; the resulting all-zero PRK would then silently feed the expand step rather than surfacing an error. Check the return value and return nullopt on failure, or propagate an error.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

-> std::size_t {
switch (hash) {
case KDFHash::SHA256: {
const auto digest{hmac_sha256_digest(key, message)};

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: Each HMAC result is copied into output but never wiped, leaving the PRK or an expanded key block in a temporary stack array after every round. Make the digest mutable and wipe it after copying, preferably with an RAII buffer guard.

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

<comment>Each HMAC result is copied into `output` but never wiped, leaving the PRK or an expanded key block in a temporary stack array after every round. Make the digest mutable and wipe it after copying, preferably with an RAII buffer guard.</comment>

<file context>
@@ -0,0 +1,120 @@
+    -> std::size_t {
+  switch (hash) {
+    case KDFHash::SHA256: {
+      const auto digest{hmac_sha256_digest(key, message)};
+      std::copy_n(digest.begin(), digest.size(), output.begin());
+      return digest.size();
</file context>

return false;
}

const auto result{hkdf_expand_loop(

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: When expansion throws, hkdf_derive_loop unwinds before reaching secure_zero, leaving the extracted PRK on the stack. Guard pseudorandom_key with an RAII wiping scope so every exit path clears it.

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

<comment>When expansion throws, `hkdf_derive_loop` unwinds before reaching `secure_zero`, leaving the extracted PRK on the stack. Guard `pseudorandom_key` with an RAII wiping scope so every exit path clears it.</comment>

<file context>
@@ -0,0 +1,120 @@
+    return false;
+  }
+
+  const auto result{hkdf_expand_loop(
+      hash,
+      std::string_view{reinterpret_cast<const char *>(pseudorandom_key.data()),
</file context>

const std::string_view input_key_material)
-> std::array<std::uint8_t, Size> {
std::array<std::uint8_t, Size> output{};
sourcemeta::core::hkdf_extract(hash, salt, input_key_material, output.data());

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: The extract template discards the return value of hkdf_extract, so a backend failure is silently converted into a successful call that returns the zero-initialized output array as if it were a valid pseudorandom key. On the OpenSSL backend hkdf_extract is EVP_KDF_derive(...) == 1, which returns false on provider/parameter failure; the resulting all-zero PRK would then silently feed the expand step rather than surfacing an error. Check the return value and return nullopt on failure, or propagate an error.

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

<comment>The `extract` template discards the return value of `hkdf_extract`, so a backend failure is silently converted into a successful call that returns the zero-initialized `output` array as if it were a valid pseudorandom key. On the OpenSSL backend `hkdf_extract` is `EVP_KDF_derive(...) == 1`, which returns false on provider/parameter failure; the resulting all-zero PRK would then silently feed the expand step rather than surfacing an error. Check the return value and return nullopt on failure, or propagate an error.</comment>

<file context>
@@ -0,0 +1,139 @@
+             const std::string_view input_key_material)
+    -> std::array<std::uint8_t, Size> {
+  std::array<std::uint8_t, Size> output{};
+  sourcemeta::core::hkdf_extract(hash, salt, input_key_material, output.data());
+  return output;
+}
</file context>

@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: 51e9508 Previous: 267b6bd Ratio
JOSE_VerifySignature_RS256 19063.880689372236 ns/iter 24670.089869855965 ns/iter 0.77
JOSE_VerifySignature_ES512 499264.9695872622 ns/iter 641065.9300411553 ns/iter 0.78
GZIP_Compress_ISO_Language_Set_3_Locations 30012383.304349143 ns/iter 39371057.33333132 ns/iter 0.76
GZIP_Decompress_ISO_Language_Set_3_Locations 2679146.164750975 ns/iter 4031794.6494255187 ns/iter 0.66
GZIP_Compress_ISO_Language_Set_3_Schema 1755075.0251887 ns/iter 2293741.208469189 ns/iter 0.77
GZIP_Decompress_ISO_Language_Set_3_Schema 222888.51066620948 ns/iter 308200.55883690395 ns/iter 0.72
HTML_Build_Table_100000 54251116.66666756 ns/iter 67033010.40000725 ns/iter 0.81
HTML_Render_Table_100000 1762710.5653266094 ns/iter 1986000.173410424 ns/iter 0.89
JSONLD_Catalog_Annotation_List_Populate 551028.0268986913 ns/iter 694498.9572139772 ns/iter 0.79
JSONLD_Catalog_Materialize 2631844.685393258 ns/iter 3483862.729064322 ns/iter 0.76
JSONL_Parse_Large 7065624.90909095 ns/iter 9133445.025975253 ns/iter 0.77
JSONL_Parse_Large_GZIP 8249150.6705884915 ns/iter 10630344.18181856 ns/iter 0.78
URITemplateRouter_Create 14731.14882556125 ns/iter 20288.629744922117 ns/iter 0.73
URITemplateRouter_Match 115.36717439523895 ns/iter 161.90436266004264 ns/iter 0.71
URITemplateRouter_Match_BasePath 132.35489613678132 ns/iter 186.92838888503468 ns/iter 0.71
URITemplateRouterView_Restore 6746.898823036194 ns/iter 9969.771120582163 ns/iter 0.68
URITemplateRouterView_Match 112.07161468352244 ns/iter 126.95076737024482 ns/iter 0.88
URITemplateRouterView_Match_BasePath 106.51565011426747 ns/iter 146.15271319544445 ns/iter 0.73
URITemplateRouterView_Arguments 364.6896631522386 ns/iter 465.775201784629 ns/iter 0.78
JSONPath_Descendant_Filter_Nested 1365.8753075804561 ns/iter 1796.3179186546345 ns/iter 0.76
Pointer_Object_Traverse 18.815226839222387 ns/iter 24.317768762095078 ns/iter 0.77
Pointer_Object_Try_Traverse 20.56397680209578 ns/iter 25.796458580103398 ns/iter 0.80
Pointer_Push_Back_Pointer_To_Weak_Pointer 111.42086373962458 ns/iter 134.6541107846154 ns/iter 0.83
Pointer_Walker_Schema_ISO_Language 1035463.5517752183 ns/iter 1315325.4952015313 ns/iter 0.79
Pointer_Maybe_Tracked_Deeply_Nested/0 951406.2845528438 ns/iter 1235986.1890459305 ns/iter 0.77
Pointer_Maybe_Tracked_Deeply_Nested/1 1280230.0857665332 ns/iter 1641606.6572769566 ns/iter 0.78
Pointer_Position_Tracker_Get_Deeply_Nested 556.0565087629219 ns/iter 681.377730753195 ns/iter 0.82
JSON_Array_Of_Objects_Unique 314.4500811078724 ns/iter 404.81453734085073 ns/iter 0.78
JSON_Parse_1 3913.920543306851 ns/iter 5036.657562098058 ns/iter 0.78
JSON_Parse_Real 4373.543188520917 ns/iter 5658.667918918611 ns/iter 0.77
JSON_Parse_Decimal 6569.569871894449 ns/iter 8487.517746520498 ns/iter 0.77
JSON_Parse_Schema_ISO_Language 2829548.170731547 ns/iter 3535271.4292927356 ns/iter 0.80
JSON_Parse_Integer 2928.586587820849 ns/iter 3888.225733459016 ns/iter 0.75
JSON_Parse_String_NonSSO_Plain 2662.161718368581 ns/iter 3411.6320248905968 ns/iter 0.78
JSON_Parse_String_SSO_Plain 2565.2327225323197 ns/iter 2788.8302559102767 ns/iter 0.92
JSON_Parse_String_Escape_Heavy 12710.78987364661 ns/iter 16365.002832132392 ns/iter 0.78
JSON_Parse_Object_Short_Keys 6657.199517150823 ns/iter 8555.983783718351 ns/iter 0.78
JSON_Parse_Object_Scalar_Properties 3376.240837771439 ns/iter 4467.667914003958 ns/iter 0.76
JSON_Parse_Object_Array_Properties 5221.9660617392365 ns/iter 6467.205017013313 ns/iter 0.81
JSON_Parse_Object_Object_Properties 5041.981630543631 ns/iter 6616.072302484692 ns/iter 0.76
JSON_Parse_Nested_Containers 30504.12250675153 ns/iter 39485.01801344053 ns/iter 0.77
JSON_From_String_Copy 7.329535838194012 ns/iter 9.273782948171185 ns/iter 0.79
JSON_From_String_Temporary 5.991530773424706 ns/iter 7.864651902681166 ns/iter 0.76
JSON_Number_To_Double 15.566135437906313 ns/iter 20.0845533680484 ns/iter 0.78
JSON_Object_At_Last_Key/8 4.9093210662580224 ns/iter 6.35064942054759 ns/iter 0.77
JSON_Object_At_Last_Key/32 18.274370597078207 ns/iter 23.688851687113917 ns/iter 0.77
JSON_Object_At_Last_Key/128 72.60556482723952 ns/iter 91.48022029569533 ns/iter 0.79
JSON_Object_At_Last_Key/512 293.6175289406913 ns/iter 379.1064764233882 ns/iter 0.77
JSON_Fast_Hash_Helm_Chart_Lock 49.72520990327737 ns/iter 72.94663870755254 ns/iter 0.68
JSON_Equality_Helm_Chart_Lock 122.53328450217676 ns/iter 159.79383390978518 ns/iter 0.77
JSON_Divisible_By_Decimal 200.7192404944617 ns/iter 259.0361930759648 ns/iter 0.77
JSON_String_Equal/10 4.4701757800057855 ns/iter 5.757523581900468 ns/iter 0.78
JSON_String_Equal/100 5.288637493070601 ns/iter 6.4634828477567785 ns/iter 0.82
JSON_String_Equal_Small_By_Perfect_Hash/10 0.5536679404396714 ns/iter 0.712548951652252 ns/iter 0.78
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 17.010940565532067 ns/iter 21.97077894994848 ns/iter 0.77
JSON_String_Fast_Hash/10 1.9081984040444409 ns/iter 2.4615142842950584 ns/iter 0.78
JSON_String_Fast_Hash/100 1.9085976244520957 ns/iter 2.462039533878266 ns/iter 0.78
JSON_String_Key_Hash/10 0.8423313253178493 ns/iter 1.0999260838440743 ns/iter 0.77
JSON_String_Key_Hash/100 11.445225832618199 ns/iter 15.086017403858028 ns/iter 0.76
JSON_Object_Defines_Miss_Same_Length 2.4590601256810096 ns/iter 3.1690232926364863 ns/iter 0.78
JSON_Object_Defines_Miss_Too_Small 2.4551644869195868 ns/iter 3.167039192449841 ns/iter 0.78
JSON_Object_Defines_Miss_Too_Large 2.4553196690430106 ns/iter 3.1680074366153335 ns/iter 0.78
Regex_Lower_S_Or_Upper_S_Asterisk 0.5455820446108907 ns/iter 0.7034812779208629 ns/iter 0.78
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 0.545096098665896 ns/iter 0.7033509085811782 ns/iter 0.77
Regex_Period_Asterisk 0.5456869657693575 ns/iter 0.7038816699809622 ns/iter 0.78
Regex_Group_Period_Asterisk_Group 0.5460370782807217 ns/iter 0.7054913419887554 ns/iter 0.77
Regex_Period_Plus 0.5457971371361401 ns/iter 0.7033646431894559 ns/iter 0.78
Regex_Period 0.5455020471189485 ns/iter 0.7040734120132057 ns/iter 0.77
Regex_Caret_Period_Plus_Dollar 0.5454208839691236 ns/iter 0.7033676780944299 ns/iter 0.78
Regex_Caret_Group_Period_Plus_Group_Dollar 0.545625857320803 ns/iter 0.7041952296966072 ns/iter 0.77
Regex_Caret_Period_Asterisk_Dollar 0.5456061668126111 ns/iter 0.7055916979920597 ns/iter 0.77
Regex_Caret_Group_Period_Asterisk_Group_Dollar 0.5468255411733846 ns/iter 0.703521278309856 ns/iter 0.78
Regex_Caret_X_Hyphen 3.270954442608225 ns/iter 4.220994831150521 ns/iter 0.77
Regex_Period_Md_Dollar 35.30737884598979 ns/iter 33.25654622802899 ns/iter 1.06
Regex_Caret_Slash_Period_Asterisk 3.2711902476519215 ns/iter 4.569163129746407 ns/iter 0.72
Regex_Caret_Period_Range_Dollar 1.0905208750062978 ns/iter 1.4066015238186815 ns/iter 0.78
Regex_Nested_Backtrack 31.588947766914636 ns/iter 41.22230052252547 ns/iter 0.77

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: 51e9508 Previous: 032f2ab Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.460273936968998 ns/iter 2.214823932358907 ns/iter 1.11
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.460309064578459 ns/iter 2.191220356827527 ns/iter 1.12
Regex_Period_Asterisk 2.4604811082369356 ns/iter 2.2391665418244497 ns/iter 1.10
Regex_Group_Period_Asterisk_Group 2.4608389955733916 ns/iter 2.19379621961785 ns/iter 1.12
Regex_Period_Plus 3.866496016088129 ns/iter 2.517248365745162 ns/iter 1.54
Regex_Period 3.8715833165860762 ns/iter 2.5101391695197646 ns/iter 1.54
Regex_Caret_Period_Plus_Dollar 3.8676629491464447 ns/iter 2.48970529848813 ns/iter 1.55
Regex_Caret_Group_Period_Plus_Group_Dollar 3.8678151059973795 ns/iter 2.492940782745669 ns/iter 1.55
Regex_Caret_Period_Asterisk_Dollar 2.8166529282790256 ns/iter 2.4895485462451616 ns/iter 1.13
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.824975304245466 ns/iter 2.489123398979144 ns/iter 1.13
Regex_Caret_X_Hyphen 7.0324683129472705 ns/iter 6.5465844682326955 ns/iter 1.07
Regex_Period_Md_Dollar 26.38634883812944 ns/iter 28.635085132251138 ns/iter 0.92
Regex_Caret_Slash_Period_Asterisk 7.358164520679862 ns/iter 7.003932137178311 ns/iter 1.05
Regex_Caret_Period_Range_Dollar 4.218568404199287 ns/iter 4.363031612521166 ns/iter 0.97
Regex_Nested_Backtrack 38.53100644436337 ns/iter 38.436029485947344 ns/iter 1.00
JSON_Array_Of_Objects_Unique 440.164621986962 ns/iter 444.68991479536226 ns/iter 0.99
JSON_Parse_1 4531.922325309887 ns/iter 4650.463346021397 ns/iter 0.97
JSON_Parse_Real 5182.85966639739 ns/iter 5256.9890967020965 ns/iter 0.99
JSON_Parse_Decimal 7880.900012383818 ns/iter 7755.99856813899 ns/iter 1.02
JSON_Parse_Schema_ISO_Language 3416201.8980579395 ns/iter 3326397.1374406763 ns/iter 1.03
JSON_Parse_Integer 3963.1626987948484 ns/iter 3744.0689928076845 ns/iter 1.06
JSON_Parse_String_NonSSO_Plain 3112.7494489155915 ns/iter 3021.4276558631573 ns/iter 1.03
JSON_Parse_String_SSO_Plain 2820.089983316686 ns/iter 2663.669572306842 ns/iter 1.06
JSON_Parse_String_Escape_Heavy 12422.783650607087 ns/iter 12237.632175317956 ns/iter 1.02
JSON_Parse_Object_Short_Keys 7883.810922093795 ns/iter 8315.138172157665 ns/iter 0.95
JSON_Parse_Object_Scalar_Properties 4041.546466947717 ns/iter 4247.117764858956 ns/iter 0.95
JSON_Parse_Object_Array_Properties 5337.2397212803235 ns/iter 5369.09019691674 ns/iter 0.99
JSON_Parse_Object_Object_Properties 5378.824528837695 ns/iter 5396.3602850275975 ns/iter 1.00
JSON_Parse_Nested_Containers 35787.73234618747 ns/iter 36443.784478755224 ns/iter 0.98
JSON_From_String_Copy 14.598584629666966 ns/iter 12.004385851419007 ns/iter 1.22
JSON_From_String_Temporary 11.804632483185106 ns/iter 10.130681556255805 ns/iter 1.17
JSON_Number_To_Double 22.839253856374945 ns/iter 23.621487354356713 ns/iter 0.97
JSON_Object_At_Last_Key/8 6.33189706782311 ns/iter 5.8716937492246375 ns/iter 1.08
JSON_Object_At_Last_Key/32 23.5855496184344 ns/iter 21.512848648877306 ns/iter 1.10
JSON_Object_At_Last_Key/128 91.18659237122914 ns/iter 87.58522247232479 ns/iter 1.04
JSON_Object_At_Last_Key/512 380.8619731635074 ns/iter 398.069865438602 ns/iter 0.96
JSON_Fast_Hash_Helm_Chart_Lock 72.36512189819982 ns/iter 59.80194489077341 ns/iter 1.21
JSON_Equality_Helm_Chart_Lock 169.1414342614927 ns/iter 172.2968806178797 ns/iter 0.98
JSON_Divisible_By_Decimal 247.55333130745632 ns/iter 241.66799478614882 ns/iter 1.02
JSON_String_Equal/10 5.631714532871286 ns/iter 5.946969719057264 ns/iter 0.95
JSON_String_Equal/100 6.335276598690029 ns/iter 6.548506200403351 ns/iter 0.97
JSON_String_Equal_Small_By_Perfect_Hash/10 1.0553043493791228 ns/iter 0.9356757551048016 ns/iter 1.13
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 12.338822426520167 ns/iter 10.270567041636847 ns/iter 1.20
JSON_String_Fast_Hash/10 2.463768963338821 ns/iter 2.4902576353497663 ns/iter 0.99
JSON_String_Fast_Hash/100 2.5642731674069674 ns/iter 2.4895045786828267 ns/iter 1.03
JSON_String_Key_Hash/10 2.8151866092425246 ns/iter 2.493544832339108 ns/iter 1.13
JSON_String_Key_Hash/100 7.73378621253959 ns/iter 6.538136658745023 ns/iter 1.18
JSON_Object_Defines_Miss_Same_Length 2.994315581095701 ns/iter 2.7701534740617304 ns/iter 1.08
JSON_Object_Defines_Miss_Too_Small 2.9726298769270936 ns/iter 2.7060244836199794 ns/iter 1.10
JSON_Object_Defines_Miss_Too_Large 3.214007882238564 ns/iter 3.1278838936167555 ns/iter 1.03
Pointer_Object_Traverse 31.287115576377523 ns/iter 29.452679557692882 ns/iter 1.06
Pointer_Object_Try_Traverse 32.83664645310652 ns/iter 31.037500895483916 ns/iter 1.06
Pointer_Push_Back_Pointer_To_Weak_Pointer 158.45938566645535 ns/iter 148.04030795068738 ns/iter 1.07
Pointer_Walker_Schema_ISO_Language 1523142.5153507716 ns/iter 1535005.399553567 ns/iter 0.99
Pointer_Maybe_Tracked_Deeply_Nested/0 1286555.7490842396 ns/iter 1216632.1748251705 ns/iter 1.06
Pointer_Maybe_Tracked_Deeply_Nested/1 1627788.7383177276 ns/iter 1598315.5512529798 ns/iter 1.02
Pointer_Position_Tracker_Get_Deeply_Nested 701.3784846857548 ns/iter 630.9389538268625 ns/iter 1.11
JSONPath_Descendant_Filter_Nested 1541.7091236617362 ns/iter 1496.009924325887 ns/iter 1.03
URITemplateRouter_Create 21718.81247697277 ns/iter 23205.187569840833 ns/iter 0.94
URITemplateRouter_Match 191.6933753037149 ns/iter 181.62250315451107 ns/iter 1.06
URITemplateRouter_Match_BasePath 227.36184975791852 ns/iter 210.22761793273636 ns/iter 1.08
URITemplateRouterView_Restore 9838.894432634595 ns/iter 8416.096427181505 ns/iter 1.17
URITemplateRouterView_Match 170.86661086686286 ns/iter 158.92349464769075 ns/iter 1.08
URITemplateRouterView_Match_BasePath 201.62935138545987 ns/iter 184.63507375495197 ns/iter 1.09
URITemplateRouterView_Arguments 452.4263711538587 ns/iter 436.24063755301484 ns/iter 1.04
JSONL_Parse_Large 8790605.849999622 ns/iter 9276115.51315827 ns/iter 0.95
JSONL_Parse_Large_GZIP 10491204.14925323 ns/iter 10775286.107692549 ns/iter 0.97
JSONLD_Catalog_Annotation_List_Populate 583958.5000000047 ns/iter 608104.180869601 ns/iter 0.96
JSONLD_Catalog_Materialize 3616950.1907213945 ns/iter 3503175.7989953067 ns/iter 1.03
HTML_Build_Table_100000 67225255.5 ns/iter 58280297.454540566 ns/iter 1.15
HTML_Render_Table_100000 1929751.234636864 ns/iter 1927611.6795578715 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Locations 35256263.34999856 ns/iter 32502408.181817994 ns/iter 1.08
GZIP_Decompress_ISO_Language_Set_3_Locations 4265791.335365897 ns/iter 4090081.87209248 ns/iter 1.04
GZIP_Compress_ISO_Language_Set_3_Schema 2134068.5775073594 ns/iter 1862024.1914895982 ns/iter 1.15
GZIP_Decompress_ISO_Language_Set_3_Schema 277088.2361550673 ns/iter 358942.9108606297 ns/iter 0.77
JOSE_VerifySignature_RS256 63787.15936218778 ns/iter 60170.92448610594 ns/iter 1.06
JOSE_VerifySignature_ES512 2680936.6896552816 ns/iter 2439729.9131947313 ns/iter 1.10

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: 51e9508 Previous: 267b6bd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.665645439229257 ns/iter 2.544048977838329 ns/iter 0.65
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.7768314595113595 ns/iter 2.82630916820059 ns/iter 0.63
Regex_Period_Asterisk 1.8465279946864168 ns/iter 2.909154205630111 ns/iter 0.63
Regex_Group_Period_Asterisk_Group 1.9851687671837341 ns/iter 2.9020166336229556 ns/iter 0.68
Regex_Period_Plus 2.1509145926643387 ns/iter 3.0622801612520907 ns/iter 0.70
Regex_Period 2.4377592432293853 ns/iter 3.6647564469917038 ns/iter 0.67
Regex_Caret_Period_Plus_Dollar 2.9837920643197644 ns/iter 3.7318784017024234 ns/iter 0.80
Regex_Caret_Group_Period_Plus_Group_Dollar 2.6039316266442434 ns/iter 3.6018980845429427 ns/iter 0.72
Regex_Caret_Period_Asterisk_Dollar 3.1547681419189786 ns/iter 2.921729507768674 ns/iter 1.08
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.979723378527682 ns/iter 3.7207268409736405 ns/iter 0.53
Regex_Caret_X_Hyphen 6.310611129595041 ns/iter 9.615856521499362 ns/iter 0.66
Regex_Period_Md_Dollar 19.184177277506127 ns/iter 33.9329181613443 ns/iter 0.57
Regex_Caret_Slash_Period_Asterisk 4.652262957523932 ns/iter 7.588361126388092 ns/iter 0.61
Regex_Caret_Period_Range_Dollar 2.0673465760062437 ns/iter 3.4577593733511054 ns/iter 0.60
Regex_Nested_Backtrack 28.987128906924294 ns/iter 52.39105409999638 ns/iter 0.55
JSON_Array_Of_Objects_Unique 460.0621122316961 ns/iter 590.0014988453523 ns/iter 0.78
JSON_Parse_1 3319.730409072889 ns/iter 5270.829495977669 ns/iter 0.63
JSON_Parse_Real 5235.446857794765 ns/iter 8953.902599538951 ns/iter 0.58
JSON_Parse_Decimal 6195.250294858016 ns/iter 9943.864885455328 ns/iter 0.62
JSON_Parse_Schema_ISO_Language 2408559.101538161 ns/iter 3499304.43718592 ns/iter 0.69
JSON_Parse_Integer 3011.2768839336895 ns/iter 5319.127909999679 ns/iter 0.57
JSON_Parse_String_NonSSO_Plain 2934.318291670373 ns/iter 4648.769304329004 ns/iter 0.63
JSON_Parse_String_SSO_Plain 1760.70264830285 ns/iter 3324.228214963612 ns/iter 0.53
JSON_Parse_String_Escape_Heavy 16157.930656020771 ns/iter 26088.211769675017 ns/iter 0.62
JSON_Parse_Object_Short_Keys 5297.170851898087 ns/iter 9925.651224943682 ns/iter 0.53
JSON_Parse_Object_Scalar_Properties 2643.9943341045237 ns/iter 5126.691250000022 ns/iter 0.52
JSON_Parse_Object_Array_Properties 3416.750971913176 ns/iter 7270.546805381154 ns/iter 0.47
JSON_Parse_Object_Object_Properties 3371.575566422443 ns/iter 7061.880224307738 ns/iter 0.48
JSON_Parse_Nested_Containers 22496.537079110152 ns/iter 47414.604741600124 ns/iter 0.47
JSON_From_String_Copy 10.777401808954394 ns/iter 17.084420762922605 ns/iter 0.63
JSON_From_String_Temporary 6.356103410416533 ns/iter 10.52215713158466 ns/iter 0.60
JSON_Number_To_Double 33.33894069323362 ns/iter 44.06337168996957 ns/iter 0.76
JSON_Object_At_Last_Key/8 4.3932448177791406 ns/iter 5.491397499999949 ns/iter 0.80
JSON_Object_At_Last_Key/32 12.866421481994378 ns/iter 16.341017142385283 ns/iter 0.79
JSON_Object_At_Last_Key/128 57.83647416976576 ns/iter 89.00854132202427 ns/iter 0.65
JSON_Object_At_Last_Key/512 206.87547855280994 ns/iter 246.77119627703632 ns/iter 0.84
JSON_Fast_Hash_Helm_Chart_Lock 58.884284881346545 ns/iter 67.37990264375915 ns/iter 0.87
JSON_Equality_Helm_Chart_Lock 168.41004030075254 ns/iter 182.49592492076388 ns/iter 0.92
JSON_Divisible_By_Decimal 185.49766640350464 ns/iter 242.82645044725518 ns/iter 0.76
JSON_String_Equal/10 7.36543751382989 ns/iter 10.680752743881866 ns/iter 0.69
JSON_String_Equal/100 7.033389887411902 ns/iter 10.606739131504819 ns/iter 0.66
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3498616776609271 ns/iter 0.4099644830774177 ns/iter 0.85
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 4.366569003144 ns/iter 5.225691341885029 ns/iter 0.84
JSON_String_Fast_Hash/10 2.5581425062799155 ns/iter 3.2076825927433745 ns/iter 0.80
JSON_String_Fast_Hash/100 1.978582767936722 ns/iter 2.8849052489480527 ns/iter 0.69
JSON_String_Key_Hash/10 1.6882198271547886 ns/iter 1.974198722798381 ns/iter 0.86
JSON_String_Key_Hash/100 2.1120949870579415 ns/iter 2.37461035430759 ns/iter 0.89
JSON_Object_Defines_Miss_Same_Length 2.7325687339043196 ns/iter 3.014779088634347 ns/iter 0.91
JSON_Object_Defines_Miss_Too_Small 2.6065242233890147 ns/iter 3.2725426277171596 ns/iter 0.80
JSON_Object_Defines_Miss_Too_Large 2.734119410341951 ns/iter 3.4625734859997883 ns/iter 0.79
Pointer_Object_Traverse 21.920592590365406 ns/iter 23.952789573239716 ns/iter 0.92
Pointer_Object_Try_Traverse 22.966556921572792 ns/iter 27.99471370747489 ns/iter 0.82
Pointer_Push_Back_Pointer_To_Weak_Pointer 135.90795036294335 ns/iter 165.29090741117346 ns/iter 0.82
Pointer_Walker_Schema_ISO_Language 1302526.7931035154 ns/iter 1581315.2085202355 ns/iter 0.82
Pointer_Maybe_Tracked_Deeply_Nested/0 1248876.1849217915 ns/iter 945646.6771241016 ns/iter 1.32
Pointer_Maybe_Tracked_Deeply_Nested/1 1508820.2415540763 ns/iter 1279610.8870968975 ns/iter 1.18
Pointer_Position_Tracker_Get_Deeply_Nested 423.86746489710623 ns/iter 420.12458328585546 ns/iter 1.01
JSONPath_Descendant_Filter_Nested 1126.8769380728481 ns/iter 1314.1478749164316 ns/iter 0.86
URITemplateRouter_Create 19531.460091808993 ns/iter 20652.21579405873 ns/iter 0.95
URITemplateRouter_Match 171.67178642224934 ns/iter 250.53899574054955 ns/iter 0.69
URITemplateRouter_Match_BasePath 209.80548764624865 ns/iter 242.29801270745418 ns/iter 0.87
URITemplateRouterView_Restore 9844.541269465077 ns/iter 15284.289152561769 ns/iter 0.64
URITemplateRouterView_Match 138.43832364376823 ns/iter 151.13324111979924 ns/iter 0.92
URITemplateRouterView_Match_BasePath 148.9359729008233 ns/iter 162.2999884562255 ns/iter 0.92
URITemplateRouterView_Arguments 642.7533431674342 ns/iter 582.8804682534465 ns/iter 1.10
JSONL_Parse_Large 7582727.941176731 ns/iter 7411309.578946913 ns/iter 1.02
JSONL_Parse_Large_GZIP 8470491.776315134 ns/iter 8236356.944444701 ns/iter 1.03
JSONLD_Catalog_Annotation_List_Populate 483180.3762120275 ns/iter 585472.7120677043 ns/iter 0.83
JSONLD_Catalog_Materialize 2456491.507836914 ns/iter 2320319.982394446 ns/iter 1.06
HTML_Build_Table_100000 37512196.77777347 ns/iter 41086574.11111633 ns/iter 0.91
HTML_Render_Table_100000 1670583.414396901 ns/iter 1830629.8236842921 ns/iter 0.91
GZIP_Compress_ISO_Language_Set_3_Locations 38277821.42856709 ns/iter 28030206.680000447 ns/iter 1.37
GZIP_Decompress_ISO_Language_Set_3_Locations 4902002.952757193 ns/iter 5024030.555555075 ns/iter 0.98
GZIP_Compress_ISO_Language_Set_3_Schema 1712171.975069141 ns/iter 1704786.7378191757 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 343666.06728899665 ns/iter 299940.11478336423 ns/iter 1.15
JOSE_VerifySignature_RS256 30516.838075269407 ns/iter 25923.756266610697 ns/iter 1.18
JOSE_VerifySignature_ES512 1445922.1503760715 ns/iter 1103599.0368509525 ns/iter 1.31

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

@jviotti
jviotti merged commit ad29c3a into main Aug 18, 2026
13 checks passed
@jviotti
jviotti deleted the hkdf branch August 18, 2026 16:31

@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: 51e9508 Previous: 267b6bd Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.130490999999893 ns/iter 5.24980400000004 ns/iter 0.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.144962000001669 ns/iter 5.418869000000086 ns/iter 0.95
Regex_Period_Asterisk 5.012851999999839 ns/iter 5.283493000001727 ns/iter 0.95
Regex_Group_Period_Asterisk_Group 5.037076785713777 ns/iter 5.178433035715508 ns/iter 0.97
Regex_Period_Plus 5.114921428571506 ns/iter 4.794600680342892 ns/iter 1.07
Regex_Period 5.060676999999032 ns/iter 5.108976594599939 ns/iter 0.99
Regex_Caret_Period_Plus_Dollar 5.028499000000011 ns/iter 5.089347501135839 ns/iter 0.99
Regex_Caret_Group_Period_Plus_Group_Dollar 5.022361999999703 ns/iter 4.810506707167423 ns/iter 1.04
Regex_Caret_Period_Asterisk_Dollar 5.093791964284833 ns/iter 5.1630970000042 ns/iter 0.99
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.015584000000217 ns/iter 5.682875892858875 ns/iter 0.88
Regex_Caret_X_Hyphen 8.17450576707925 ns/iter 8.262893973213384 ns/iter 0.99
Regex_Period_Md_Dollar 45.302181291945836 ns/iter 60.06177678569559 ns/iter 0.75
Regex_Caret_Slash_Period_Asterisk 8.162537946430705 ns/iter 7.5782450554540715 ns/iter 1.08
Regex_Caret_Period_Range_Dollar 5.659449107144252 ns/iter 5.4071357142829255 ns/iter 1.05
Regex_Nested_Backtrack 56.67684821428257 ns/iter 77.15256696424636 ns/iter 0.73
JSON_Array_Of_Objects_Unique 617.8565178572626 ns/iter 650.3958928569936 ns/iter 0.95
JSON_Parse_1 8927.653447975408 ns/iter 9095.784598212984 ns/iter 0.98
JSON_Parse_Real 16083.561273851663 ns/iter 16443.287946421897 ns/iter 0.98
JSON_Parse_Decimal 11842.585714288945 ns/iter 11252.206249999119 ns/iter 1.05
JSON_Parse_Schema_ISO_Language 7716440.000000249 ns/iter 8052834.444444872 ns/iter 0.96
JSON_Parse_Integer 6375.946428570549 ns/iter 6136.252678572873 ns/iter 1.04
JSON_Parse_String_NonSSO_Plain 8568.930803569685 ns/iter 7822.00669642614 ns/iter 1.10
JSON_Parse_String_SSO_Plain 4124.016127671356 ns/iter 3676.845398490076 ns/iter 1.12
JSON_Parse_String_Escape_Heavy 21894.937500000822 ns/iter 21362.956250001727 ns/iter 1.02
JSON_Parse_Object_Short_Keys 13636.899835268636 ns/iter 13254.226785712879 ns/iter 1.03
JSON_Parse_Object_Scalar_Properties 6905.293750000803 ns/iter 7187.713999996959 ns/iter 0.96
JSON_Parse_Object_Array_Properties 11681.251562499994 ns/iter 12306.205357138619 ns/iter 0.95
JSON_Parse_Object_Object_Properties 11935.716581622692 ns/iter 12088.58392857337 ns/iter 0.99
JSON_Parse_Nested_Containers 83144.47544641723 ns/iter 86084.70982142283 ns/iter 0.97
JSON_From_String_Copy 64.46448214286907 ns/iter 70.46750892856478 ns/iter 0.91
JSON_From_String_Temporary 59.031616071426434 ns/iter 85.68780421032584 ns/iter 0.69
JSON_Number_To_Double 120.38791071428737 ns/iter 147.0869196428534 ns/iter 0.82
JSON_Object_At_Last_Key/8 7.673417857142389 ns/iter 7.748881696428051 ns/iter 0.99
JSON_Object_At_Last_Key/32 23.494938353846575 ns/iter 26.789440058977572 ns/iter 0.88
JSON_Object_At_Last_Key/128 89.9217656250073 ns/iter 98.74474112744976 ns/iter 0.91
JSON_Object_At_Last_Key/512 427.07681249993357 ns/iter 474.92892412624406 ns/iter 0.90
JSON_Fast_Hash_Helm_Chart_Lock 107.09368749999726 ns/iter 117.05703571424563 ns/iter 0.91
JSON_Equality_Helm_Chart_Lock 214.09349999998994 ns/iter 221.72896875005677 ns/iter 0.97
JSON_Divisible_By_Decimal 307.4801785713938 ns/iter 405.3093390487427 ns/iter 0.76
JSON_String_Equal/10 10.45529191760979 ns/iter 10.282417187497117 ns/iter 1.02
JSON_String_Equal/100 11.67494999999974 ns/iter 12.02812427666571 ns/iter 0.97
JSON_String_Equal_Small_By_Perfect_Hash/10 2.58110734144547 ns/iter 2.3180337499994152 ns/iter 1.11
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.304155962930063 ns/iter 16.712495535711827 ns/iter 0.86
JSON_String_Fast_Hash/10 6.736203124998293 ns/iter 6.774174999999819 ns/iter 0.99
JSON_String_Fast_Hash/100 6.927547991070679 ns/iter 7.310473214288445 ns/iter 0.95
JSON_String_Key_Hash/10 5.442576000000372 ns/iter 6.1167850000038015 ns/iter 0.89
JSON_String_Key_Hash/100 11.95348281249764 ns/iter 12.3577499448321 ns/iter 0.97
JSON_Object_Defines_Miss_Same_Length 4.734906706996783 ns/iter 4.688079787598334 ns/iter 1.01
JSON_Object_Defines_Miss_Too_Small 4.960435999998936 ns/iter 4.691265412257298 ns/iter 1.06
JSON_Object_Defines_Miss_Too_Large 4.721248103733255 ns/iter 5.233216000001448 ns/iter 0.90
Pointer_Object_Traverse 68.41787946427758 ns/iter 77.41045758926646 ns/iter 0.88
Pointer_Object_Try_Traverse 72.26140178571784 ns/iter 79.13913392859025 ns/iter 0.91
Pointer_Push_Back_Pointer_To_Weak_Pointer 198.2223661507611 ns/iter 191.7490081918884 ns/iter 1.03
Pointer_Walker_Schema_ISO_Language 11163559.374999465 ns/iter 14433819.642858582 ns/iter 0.77
Pointer_Maybe_Tracked_Deeply_Nested/0 2376096.2121216245 ns/iter 2816027.118642986 ns/iter 0.84
Pointer_Maybe_Tracked_Deeply_Nested/1 3699857.4358979873 ns/iter 4325593.60465242 ns/iter 0.86
Pointer_Position_Tracker_Get_Deeply_Nested 553.5732142857138 ns/iter 703.2725892859811 ns/iter 0.79
JSONPath_Descendant_Filter_Nested 2363.5011568067357 ns/iter 3228.7089285708653 ns/iter 0.73
URITemplateRouter_Create 40312.80250711561 ns/iter 47740.969704823845 ns/iter 0.84
URITemplateRouter_Match 242.35912473673636 ns/iter 266.9549374999747 ns/iter 0.91
URITemplateRouter_Match_BasePath 267.17971505262756 ns/iter 318.96790263249255 ns/iter 0.84
URITemplateRouterView_Restore 32597.881216896792 ns/iter 32320.457142873238 ns/iter 1.01
URITemplateRouterView_Match 184.55723076402586 ns/iter 213.64609019950734 ns/iter 0.86
URITemplateRouterView_Match_BasePath 209.88397500520014 ns/iter 240.91526379835736 ns/iter 0.87
URITemplateRouterView_Arguments 536.9479999999385 ns/iter 720.3016071429147 ns/iter 0.75
JSONL_Parse_Large 32299549.99999956 ns/iter 39606685.00001247 ns/iter 0.82
JSONL_Parse_Large_GZIP 33693770.00000213 ns/iter 39126142.10524847 ns/iter 0.86
JSONLD_Catalog_Annotation_List_Populate 3090178.124999454 ns/iter 4028579.487180067 ns/iter 0.77
JSONLD_Catalog_Materialize 9174865.555554688 ns/iter 11079862.666665576 ns/iter 0.83
HTML_Build_Table_100000 92557885.71428119 ns/iter 114587071.42855929 ns/iter 0.81
HTML_Render_Table_100000 7976602.222220208 ns/iter 9117672.222222002 ns/iter 0.87
GZIP_Compress_ISO_Language_Set_3_Locations 35592678.94736781 ns/iter 46733826.31577433 ns/iter 0.76
GZIP_Decompress_ISO_Language_Set_3_Locations 9961778.66666585 ns/iter 12631398.43749883 ns/iter 0.79
GZIP_Compress_ISO_Language_Set_3_Schema 2082902.6086953557 ns/iter 2682885.542168538 ns/iter 0.78
GZIP_Decompress_ISO_Language_Set_3_Schema 643109.6428570981 ns/iter 786795.9821429135 ns/iter 0.82
JOSE_VerifySignature_RS256 21348.096454059796 ns/iter 29370.144306424714 ns/iter 0.73
JOSE_VerifySignature_ES512 1395888.3534138498 ns/iter 1894606.6666670218 ns/iter 0.74

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

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