Skip to content

Speed up the Crypto reference implementation even more - #2822

Merged
jviotti merged 4 commits into
mainfrom
reference-fast-2
Sep 13, 2026
Merged

Speed up the Crypto reference implementation even more#2822
jviotti merged 4 commits into
mainfrom
reference-fast-2

Conversation

@jviotti

@jviotti jviotti commented Sep 13, 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 Sep 13, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR further accelerates the reference cryptography implementation.

Changes:

  • Adds an optional specialized reduction callback to Barrett field contexts.
  • Uses constant-time Mersenne reductions for the P-521 and Ed25519 fields.
  • Replaces bit-at-a-time secret scalar multiplication with fixed four-bit windows.
  • Builds and masked-selects from complete-formula point-multiple tables.
  • Caches Ed25519 and Ed448 domain parameters and their reduction contexts.
  • Reuses cached field/order contexts throughout EdDSA signing and encoding.
  • Updates P-521 affine recovery to select the optimized field context.
  • Refactors SHA-1, SHA-2, and SHAKE internals to use raw array data pointers.
Technical Notes: The scalar-window loops retain public fixed widths and scan all table entries; generic Barrett reduction remains the fallback for other moduli.

🤖 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. No suggestions at this time.

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

@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: fbbf44e Previous: 1866173 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 2.179419681943247 ns/iter 2.2031374251953197 ns/iter 0.99
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 2.1791367582045673 ns/iter 2.178193531362298 ns/iter 1.00
Regex_Period_Asterisk 2.1786618033783376 ns/iter 2.1780173834466625 ns/iter 1.00
Regex_Group_Period_Asterisk_Group 2.184331317953498 ns/iter 2.179580704918548 ns/iter 1.00
Regex_Period_Plus 2.8018439012785703 ns/iter 2.800208347141128 ns/iter 1.00
Regex_Period 2.8017611068126804 ns/iter 2.7998629579810643 ns/iter 1.00
Regex_Caret_Period_Plus_Dollar 2.801003653134923 ns/iter 2.8078595785219838 ns/iter 1.00
Regex_Caret_Group_Period_Plus_Group_Dollar 2.800239044367059 ns/iter 2.8008786276310573 ns/iter 1.00
Regex_Caret_Period_Asterisk_Dollar 3.4260797526478637 ns/iter 3.4260590235818933 ns/iter 1.00
Regex_Caret_Group_Period_Asterisk_Group_Dollar 3.4325290764732785 ns/iter 3.4224771637146483 ns/iter 1.00
Regex_Caret_X_Hyphen 5.298618354944526 ns/iter 5.297629819037629 ns/iter 1.00
Regex_Period_Md_Dollar 28.41816432311909 ns/iter 27.462422239276833 ns/iter 1.03
Regex_Caret_Slash_Period_Asterisk 5.915262014999376 ns/iter 5.913862301622809 ns/iter 1.00
Regex_Caret_Period_Range_Dollar 3.1138525697704886 ns/iter 4.357953138413142 ns/iter 0.71
Regex_Nested_Backtrack 41.54952408047446 ns/iter 41.67807737886758 ns/iter 1.00
JSON_Array_Of_Objects_Unique 401.334941492509 ns/iter 418.80889007755184 ns/iter 0.96
JSON_Parse_1 4477.305079870328 ns/iter 4552.603643216028 ns/iter 0.98
JSON_Parse_Real 4849.493900555921 ns/iter 5004.822620000198 ns/iter 0.97
JSON_Parse_Decimal 7270.770767394845 ns/iter 7367.737963079643 ns/iter 0.99
JSON_Parse_Schema_ISO_Language 3347581.107692285 ns/iter 3347905.576190361 ns/iter 1.00
JSON_Parse_Integer 3546.561571750768 ns/iter 3630.5282094865684 ns/iter 0.98
JSON_Parse_String_NonSSO_Plain 3088.1223203361933 ns/iter 3106.8769386155077 ns/iter 0.99
JSON_Parse_String_SSO_Plain 2621.304468273919 ns/iter 2690.7253032265066 ns/iter 0.97
JSON_Parse_String_Escape_Heavy 12038.093325973297 ns/iter 11883.27534316224 ns/iter 1.01
JSON_Parse_Object_Short_Keys 7639.611847437863 ns/iter 7619.978426188958 ns/iter 1.00
JSON_Parse_Object_Scalar_Properties 3910.6767514586936 ns/iter 3901.5291612694273 ns/iter 1.00
JSON_Parse_Object_Array_Properties 5484.9820933521805 ns/iter 5473.545507812538 ns/iter 1.00
JSON_Parse_Object_Object_Properties 5453.813981402865 ns/iter 5258.113981945282 ns/iter 1.04
JSON_Parse_Nested_Containers 34589.064723957774 ns/iter 34789.76451612859 ns/iter 0.99
JSON_From_String_Copy 11.05389665904717 ns/iter 11.038453089443866 ns/iter 1.00
JSON_From_String_Temporary 9.900071963398638 ns/iter 9.822339073173127 ns/iter 1.01
JSON_Number_To_Double 22.095786038815632 ns/iter 23.087222386665527 ns/iter 0.96
JSON_Object_At_Last_Key/8 3.92467325910408 ns/iter 3.936628349679255 ns/iter 1.00
JSON_Object_At_Last_Key/32 12.330549302533015 ns/iter 12.292568060483905 ns/iter 1.00
JSON_Object_At_Last_Key/128 49.09835419097793 ns/iter 49.11414696636941 ns/iter 1.00
JSON_Object_At_Last_Key/512 391.579834545481 ns/iter 392.1696183986196 ns/iter 1.00
JSON_Fast_Hash_Helm_Chart_Lock 60.99096360198901 ns/iter 61.025082560828395 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 148.33480854032354 ns/iter 154.74919497760672 ns/iter 0.96
JSON_Divisible_By_Decimal 231.5771109625075 ns/iter 234.15637439864753 ns/iter 0.99
JSON_String_Equal/10 5.610957227019857 ns/iter 5.610709840021346 ns/iter 1.00
JSON_String_Equal/100 6.254988680203837 ns/iter 6.2816536067564215 ns/iter 1.00
JSON_String_Equal_Small_By_Perfect_Hash/10 0.9387417861273571 ns/iter 0.9351871088775354 ns/iter 1.00
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.930827357382112 ns/iter 14.956666004531497 ns/iter 1.00
JSON_String_Fast_Hash/10 2.490208858512605 ns/iter 2.50193753494707 ns/iter 1.00
JSON_String_Fast_Hash/100 2.4933469468363914 ns/iter 2.491023071472072 ns/iter 1.00
JSON_String_Key_Hash/10 2.729817474519002 ns/iter 2.756085248220807 ns/iter 0.99
JSON_String_Key_Hash/100 9.02808258445626 ns/iter 9.025715096093087 ns/iter 1.00
JSON_Object_Defines_Miss_Same_Length 3.4274582612535345 ns/iter 3.430131838089259 ns/iter 1.00
JSON_Object_Defines_Miss_Too_Small 3.092598765436784 ns/iter 3.1180321121321817 ns/iter 0.99
JSON_Object_Defines_Miss_Too_Large 2.6466824458060474 ns/iter 2.7763028983416884 ns/iter 0.95
Pointer_Object_Traverse 28.49219418460717 ns/iter 29.353305158779502 ns/iter 0.97
Pointer_Object_Try_Traverse 30.319005994335473 ns/iter 31.231009529872217 ns/iter 0.97
Pointer_Push_Back_Pointer_To_Weak_Pointer 195.6696753155163 ns/iter 170.64051322003962 ns/iter 1.15
Pointer_Walker_Schema_ISO_Language 1505488.3556034253 ns/iter 1499664.5350877244 ns/iter 1.00
Pointer_Maybe_Tracked_Deeply_Nested/0 1262637.2558558516 ns/iter 1248246.4766187111 ns/iter 1.01
Pointer_Maybe_Tracked_Deeply_Nested/1 1601900.108294939 ns/iter 1612198.67123289 ns/iter 0.99
Pointer_Position_Tracker_Get_Deeply_Nested 636.1866468520642 ns/iter 614.0367000153828 ns/iter 1.04
Schema_Tracker_ISO_Language 4452302.854430439 ns/iter 4587407.415094224 ns/iter 0.97
Schema_Tracker_ISO_Language_To_JSON 16841896.047619034 ns/iter 16986535.238095663 ns/iter 0.99
Schema_Frame_WoT_References 2195079.2250000183 ns/iter 2186045.5678233416 ns/iter 1.00
Schema_Frame_OMC_References 9480885.216216417 ns/iter 9924825.90000025 ns/iter 0.96
Schema_Frame_OMC_Pointers 17948356.256410465 ns/iter 17877407.974359527 ns/iter 1.00
Schema_Frame_OMC_Locations 8241586.870588316 ns/iter 8119162.827586285 ns/iter 1.02
Schema_Frame_ISO_Language_Locations 42786735.12500042 ns/iter 43234889.52941127 ns/iter 0.99
Schema_Frame_ISO_Language_Root 294.49557311112676 ns/iter 294.15955088158694 ns/iter 1.00
Schema_Frame_KrakenD_References 15327626.021739542 ns/iter 16233390.23255809 ns/iter 0.94
Schema_Frame_KrakenD_Reachable 144084115.9999991 ns/iter 138337273.60000694 ns/iter 1.04
Schema_Frame_ISO_Language_Locations_To_JSON 31737839.826087855 ns/iter 31476945.99999924 ns/iter 1.01
Schema_Frame_Many_Resources_References 135195971.79999894 ns/iter 135467415.40000084 ns/iter 1.00
Schema_Frame_Deeply_Nested_References 11090038.031746132 ns/iter 11102421.564516366 ns/iter 1.00
JSONPath_Descendant_Filter_Nested 1551.1906042164528 ns/iter 1597.3225457140338 ns/iter 0.97
URITemplateRouter_Create 23782.951143840495 ns/iter 24484.099444252082 ns/iter 0.97
URITemplateRouter_Match 170.0824651217812 ns/iter 176.66970704383644 ns/iter 0.96
URITemplateRouter_Match_BasePath 200.92755581500867 ns/iter 204.2506605894024 ns/iter 0.98
URITemplateRouterView_Restore 8441.793381988202 ns/iter 8437.565704086288 ns/iter 1.00
URITemplateRouterView_Match 142.25725165929745 ns/iter 141.92891712861507 ns/iter 1.00
URITemplateRouterView_Match_BasePath 163.9841686662776 ns/iter 162.8170657904313 ns/iter 1.01
URITemplateRouterView_Arguments 421.0000258934425 ns/iter 423.63259183132226 ns/iter 0.99
JSONL_Parse_Large 9097014.688311728 ns/iter 9140624.909090778 ns/iter 1.00
JSONL_Parse_Large_GZIP 10638778.833333274 ns/iter 10603573.500000263 ns/iter 1.00
JSONLD_Catalog_Annotation_List_Populate 584064.8168896165 ns/iter 588731.1353383275 ns/iter 0.99
JSONLD_Catalog_Materialize 3452652.5714285844 ns/iter 3490359.3299999614 ns/iter 0.99
HTML_Build_Table_100000 57608257.090909 ns/iter 56908485.909089416 ns/iter 1.01
HTML_Render_Table_100000 1933618.7583333084 ns/iter 1845518.4609374637 ns/iter 1.05
GZIP_Compress_ISO_Language_Set_3_Locations 33332079.619047556 ns/iter 33329796.333333664 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Locations 4075097.4186046394 ns/iter 4060621.9768785597 ns/iter 1.00
GZIP_Compress_ISO_Language_Set_3_Schema 1885430.3521505492 ns/iter 1894888.2857142629 ns/iter 1.00
GZIP_Decompress_ISO_Language_Set_3_Schema 351962.33802816237 ns/iter 352747.28280188673 ns/iter 1.00
JOSE_VerifySignature_RS256 48681.92192379893 ns/iter 57885.934112381445 ns/iter 0.84
JOSE_VerifySignature_ES512 1742082.2194513963 ns/iter 2017025.1440922269 ns/iter 0.86

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

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

No issues found across 8 files

Re-trigger cubic

@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: fbbf44e Previous: 1866173 Ratio
JOSE_VerifySignature_RS256 18966.818704717363 ns/iter 22644.98280821073 ns/iter 0.84
JOSE_VerifySignature_ES512 502388.5961262512 ns/iter 514688.9381443314 ns/iter 0.98
GZIP_Compress_ISO_Language_Set_3_Locations 30183598.086955994 ns/iter 30014600.86956528 ns/iter 1.01
GZIP_Decompress_ISO_Language_Set_3_Locations 2834288.8588709338 ns/iter 3831152.901098762 ns/iter 0.74
GZIP_Compress_ISO_Language_Set_3_Schema 1740197.290000012 ns/iter 1921335.8794520167 ns/iter 0.91
GZIP_Decompress_ISO_Language_Set_3_Schema 198530.54142814135 ns/iter 362391.30816960987 ns/iter 0.55
HTML_Build_Table_100000 57236103.75000021 ns/iter 57316177.69999957 ns/iter 1.00
HTML_Render_Table_100000 2048846.0658682613 ns/iter 3680934.2500000577 ns/iter 0.56
JSONLD_Catalog_Annotation_List_Populate 540573.1090342832 ns/iter 748016.546325871 ns/iter 0.72
JSONLD_Catalog_Materialize 2681560.4269230035 ns/iter 3267305.2009347035 ns/iter 0.82
JSONL_Parse_Large 7398201.0315791955 ns/iter 9271870.200000195 ns/iter 0.80
JSONL_Parse_Large_GZIP 8648213.621951273 ns/iter 10701455.09230761 ns/iter 0.81
URITemplateRouter_Create 15442.974592891054 ns/iter 16584.31937677995 ns/iter 0.93
URITemplateRouter_Match 119.03539774132022 ns/iter 164.63474903239936 ns/iter 0.72
URITemplateRouter_Match_BasePath 141.32434905260553 ns/iter 186.43964860256796 ns/iter 0.76
URITemplateRouterView_Restore 7639.889254119439 ns/iter 3553.820209826641 ns/iter 2.15
URITemplateRouterView_Match 93.80253603726311 ns/iter 117.9443146410185 ns/iter 0.80
URITemplateRouterView_Match_BasePath 104.64504431238927 ns/iter 135.56635511655725 ns/iter 0.77
URITemplateRouterView_Arguments 360.19189433957825 ns/iter 461.3259800025439 ns/iter 0.78
JSONPath_Descendant_Filter_Nested 1365.4652960771712 ns/iter 1361.4221123924099 ns/iter 1.00
Schema_Frame_WoT_References 1774065.1520618438 ns/iter 2225006.2564103026 ns/iter 0.80
Schema_Frame_OMC_References 8086154.564706007 ns/iter 9553305.567567963 ns/iter 0.85
Schema_Frame_OMC_Pointers 15092089.77777803 ns/iter 17973349.17948745 ns/iter 0.84
Schema_Frame_OMC_Locations 7032204.230000048 ns/iter 8361449.270587935 ns/iter 0.84
Schema_Frame_ISO_Language_Locations 34382664.47619077 ns/iter 36979566.84210698 ns/iter 0.93
Schema_Frame_ISO_Language_Root 209.1232522061803 ns/iter 243.6209670104345 ns/iter 0.86
Schema_Frame_KrakenD_References 14436348.235294333 ns/iter 15288211.555556092 ns/iter 0.94
Schema_Frame_KrakenD_Reachable 89199592.5000053 ns/iter 115482840.49999325 ns/iter 0.77
Schema_Frame_ISO_Language_Locations_To_JSON 27520394.239999175 ns/iter 30190676.826086234 ns/iter 0.91
Schema_Frame_Many_Resources_References 117057585.16666739 ns/iter 136106612.59999686 ns/iter 0.86
Schema_Frame_Deeply_Nested_References 9198741.199999934 ns/iter 10458839.970149359 ns/iter 0.88
Pointer_Object_Traverse 19.14724272635266 ns/iter 21.347198346463973 ns/iter 0.90
Pointer_Object_Try_Traverse 20.611619328241815 ns/iter 23.9236473467396 ns/iter 0.86
Pointer_Push_Back_Pointer_To_Weak_Pointer 105.92933972453717 ns/iter 210.4469388397777 ns/iter 0.50
Pointer_Walker_Schema_ISO_Language 1084316.089922468 ns/iter 1936163.9608937546 ns/iter 0.56
Pointer_Maybe_Tracked_Deeply_Nested/0 974604.7977684743 ns/iter 1224641.5747331632 ns/iter 0.80
Pointer_Maybe_Tracked_Deeply_Nested/1 1358727.023255816 ns/iter 1817001.0446193898 ns/iter 0.75
Pointer_Position_Tracker_Get_Deeply_Nested 513.8237898677609 ns/iter 757.8093387322796 ns/iter 0.68
Schema_Tracker_ISO_Language 3912782.21666656 ns/iter 4755862.263513754 ns/iter 0.82
Schema_Tracker_ISO_Language_To_JSON 12076358.561403679 ns/iter 15852200.340908306 ns/iter 0.76
JSON_Array_Of_Objects_Unique 359.7590791210203 ns/iter 390.8811949743182 ns/iter 0.92
JSON_Parse_1 4025.8891926895813 ns/iter 4770.229054531092 ns/iter 0.84
JSON_Parse_Real 4328.354567791052 ns/iter 5007.403323883706 ns/iter 0.86
JSON_Parse_Decimal 6865.346485723606 ns/iter 7704.236990755987 ns/iter 0.89
JSON_Parse_Schema_ISO_Language 2861276.151639354 ns/iter 3455679.9999998882 ns/iter 0.83
JSON_Parse_Integer 2907.0961436036223 ns/iter 3226.85358584881 ns/iter 0.90
JSON_Parse_String_NonSSO_Plain 2807.884141397504 ns/iter 2853.040315112254 ns/iter 0.98
JSON_Parse_String_SSO_Plain 2243.4576619958057 ns/iter 2608.5080524896284 ns/iter 0.86
JSON_Parse_String_Escape_Heavy 12562.3931967148 ns/iter 15753.934603852273 ns/iter 0.80
JSON_Parse_Object_Short_Keys 6938.22273627884 ns/iter 8292.838536238494 ns/iter 0.84
JSON_Parse_Object_Scalar_Properties 3538.5092742100082 ns/iter 4249.059005345484 ns/iter 0.83
JSON_Parse_Object_Array_Properties 5460.932266612883 ns/iter 6128.296416821504 ns/iter 0.89
JSON_Parse_Object_Object_Properties 5250.811585946087 ns/iter 6152.816293573781 ns/iter 0.85
JSON_Parse_Nested_Containers 32340.84567815651 ns/iter 38685.23092998999 ns/iter 0.84
JSON_From_String_Copy 8.284032783748643 ns/iter 8.185368816370065 ns/iter 1.01
JSON_From_String_Temporary 6.119231286610201 ns/iter 5.784703910554783 ns/iter 1.06
JSON_Number_To_Double 15.81813709952568 ns/iter 22.762185527642686 ns/iter 0.69
JSON_Object_At_Last_Key/8 5.146466589999932 ns/iter 6.663061906749585 ns/iter 0.77
JSON_Object_At_Last_Key/32 18.542048642541836 ns/iter 22.184092276704153 ns/iter 0.84
JSON_Object_At_Last_Key/128 70.95643397305898 ns/iter 83.57681794465265 ns/iter 0.85
JSON_Object_At_Last_Key/512 293.78448281319197 ns/iter 231.93003294686613 ns/iter 1.27
JSON_Fast_Hash_Helm_Chart_Lock 63.67696356348049 ns/iter 66.41825266895891 ns/iter 0.96
JSON_Equality_Helm_Chart_Lock 122.85686411098767 ns/iter 147.13710178348956 ns/iter 0.83
JSON_Divisible_By_Decimal 200.34315267181842 ns/iter 256.005532237767 ns/iter 0.78
JSON_String_Equal/10 4.737722809714786 ns/iter 6.165270679495309 ns/iter 0.77
JSON_String_Equal/100 5.577840473901321 ns/iter 7.499083127577302 ns/iter 0.74
JSON_String_Equal_Small_By_Perfect_Hash/10 0.5532619517564529 ns/iter 0.9508146107305214 ns/iter 0.58
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 17.064489474482574 ns/iter 17.61244130220265 ns/iter 0.97
JSON_String_Fast_Hash/10 2.4664774064969275 ns/iter 3.113033061910226 ns/iter 0.79
JSON_String_Fast_Hash/100 2.4659539314603065 ns/iter 3.1311043170019373 ns/iter 0.79
JSON_String_Key_Hash/10 1.3647213473566278 ns/iter 1.980764002113349 ns/iter 0.69
JSON_String_Key_Hash/100 11.69729889917224 ns/iter 13.37510118002632 ns/iter 0.87
JSON_Object_Defines_Miss_Same_Length 2.4571895843976463 ns/iter 3.1842577823540528 ns/iter 0.77
JSON_Object_Defines_Miss_Too_Small 2.4609257300301004 ns/iter 3.1529570276865515 ns/iter 0.78
JSON_Object_Defines_Miss_Too_Large 2.454881394976599 ns/iter 3.0690092599183436 ns/iter 0.80
Regex_Lower_S_Or_Upper_S_Asterisk 1.7729772701203375 ns/iter 2.7579047182320173 ns/iter 0.64
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8407106283958112 ns/iter 2.7407134392815777 ns/iter 0.67
Regex_Period_Asterisk 1.8414051211336653 ns/iter 2.7288910115542073 ns/iter 0.67
Regex_Group_Period_Asterisk_Group 1.8054483410419306 ns/iter 2.7747329603513253 ns/iter 0.65
Regex_Period_Plus 1.7759871691322524 ns/iter 2.777798200274068 ns/iter 0.64
Regex_Period 1.8411961945335253 ns/iter 2.764280226267438 ns/iter 0.67
Regex_Caret_Period_Plus_Dollar 1.842443382443005 ns/iter 2.743597887704712 ns/iter 0.67
Regex_Caret_Group_Period_Plus_Group_Dollar 1.781054572486387 ns/iter 2.7332628307204976 ns/iter 0.65
Regex_Caret_Period_Asterisk_Dollar 1.7737190549471682 ns/iter 2.7510276644661764 ns/iter 0.64
Regex_Caret_Group_Period_Asterisk_Group_Dollar 1.8441984756273968 ns/iter 2.7525007796821424 ns/iter 0.67
Regex_Caret_X_Hyphen 5.853051009396875 ns/iter 6.576227644356309 ns/iter 0.89
Regex_Period_Md_Dollar 26.318465512820133 ns/iter 19.352112603435458 ns/iter 1.36
Regex_Caret_Slash_Period_Asterisk 6.159423964727805 ns/iter 6.4986269595189565 ns/iter 0.95
Regex_Caret_Period_Range_Dollar 3.207936191190911 ns/iter 3.5386077806472493 ns/iter 0.91
Regex_Nested_Backtrack 33.119953015976186 ns/iter 36.199339082540206 ns/iter 0.91

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: fbbf44e Previous: 1866173 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 5.066811000000371 ns/iter 2.552594774506456 ns/iter 1.98
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 5.20670100000018 ns/iter 2.6487682142861297 ns/iter 1.97
Regex_Period_Asterisk 5.127363999999943 ns/iter 2.5889903325097157 ns/iter 1.98
Regex_Group_Period_Asterisk_Group 5.157258928571297 ns/iter 2.579229372696582 ns/iter 2.00
Regex_Period_Plus 5.0586400000003096 ns/iter 2.6459035244236246 ns/iter 1.91
Regex_Period 5.135777678571429 ns/iter 2.5924931673285343 ns/iter 1.98
Regex_Caret_Period_Plus_Dollar 5.090273349350432 ns/iter 2.6010350000003006 ns/iter 1.96
Regex_Caret_Group_Period_Plus_Group_Dollar 5.226288999999724 ns/iter 2.578726071428556 ns/iter 2.03
Regex_Caret_Period_Asterisk_Dollar 5.020539000000213 ns/iter 2.594229595897997 ns/iter 1.94
Regex_Caret_Group_Period_Asterisk_Group_Dollar 5.104144000000019 ns/iter 2.5795337030541514 ns/iter 1.98
Regex_Caret_X_Hyphen 8.179114955356885 ns/iter 5.89410892857042 ns/iter 1.39
Regex_Period_Md_Dollar 48.57797724484019 ns/iter 26.27444504201328 ns/iter 1.85
Regex_Caret_Slash_Period_Asterisk 8.485812500000277 ns/iter 5.834492000001318 ns/iter 1.45
Regex_Caret_Period_Range_Dollar 5.652711607142789 ns/iter 3.0132618736541192 ns/iter 1.88
Regex_Nested_Backtrack 60.816196428571544 ns/iter 36.355161850793934 ns/iter 1.67
JSON_Array_Of_Objects_Unique 790.4928571428803 ns/iter 443.46865799941367 ns/iter 1.78
JSON_Parse_1 9112.720478926803 ns/iter 6627.216071428117 ns/iter 1.38
JSON_Parse_Real 16070.005156284358 ns/iter 10474.621875001589 ns/iter 1.53
JSON_Parse_Decimal 11966.196875000001 ns/iter 8048.780133927482 ns/iter 1.49
JSON_Parse_Schema_ISO_Language 7617634.444444673 ns/iter 7711252.678571359 ns/iter 0.99
JSON_Parse_Integer 6332.131250000016 ns/iter 4092.8831249999575 ns/iter 1.55
JSON_Parse_String_NonSSO_Plain 8578.869419642668 ns/iter 5845.7690000000175 ns/iter 1.47
JSON_Parse_String_SSO_Plain 3914.4821428571677 ns/iter 2569.68892857198 ns/iter 1.52
JSON_Parse_String_Escape_Heavy 23191.515624999327 ns/iter 20683.77499999485 ns/iter 1.12
JSON_Parse_Object_Short_Keys 14141.651785713804 ns/iter 9113.524046768274 ns/iter 1.55
JSON_Parse_Object_Scalar_Properties 7885.1662946429915 ns/iter 4634.190701318857 ns/iter 1.70
JSON_Parse_Object_Array_Properties 16632.550000000127 ns/iter 8559.148437500751 ns/iter 1.94
JSON_Parse_Object_Object_Properties 12766.88214285672 ns/iter 8507.549519869952 ns/iter 1.50
JSON_Parse_Nested_Containers 86706.66294643097 ns/iter 57414.21000000173 ns/iter 1.51
JSON_From_String_Copy 66.5886428571432 ns/iter 44.52227569253383 ns/iter 1.50
JSON_From_String_Temporary 59.79708928571422 ns/iter 51.53872999999294 ns/iter 1.16
JSON_Number_To_Double 138.94075000000126 ns/iter 84.35284598213855 ns/iter 1.65
JSON_Object_At_Last_Key/8 8.463163355075627 ns/iter 6.8630160714267925 ns/iter 1.23
JSON_Object_At_Last_Key/32 25.9148281249999 ns/iter 18.92959540895451 ns/iter 1.37
JSON_Object_At_Last_Key/128 96.81326562500203 ns/iter 87.31185267856846 ns/iter 1.11
JSON_Object_At_Last_Key/512 454.5800920682864 ns/iter 311.55925094202235 ns/iter 1.46
JSON_Fast_Hash_Helm_Chart_Lock 149.2691919969137 ns/iter 77.02614955356069 ns/iter 1.94
JSON_Equality_Helm_Chart_Lock 219.1937070708783 ns/iter 210.81174999999064 ns/iter 1.04
JSON_Divisible_By_Decimal 306.68013392854175 ns/iter 240.1786004264939 ns/iter 1.28
JSON_String_Equal/10 10.933196874999496 ns/iter 8.332459821429289 ns/iter 1.31
JSON_String_Equal/100 12.066514285714497 ns/iter 11.27969843750165 ns/iter 1.07
JSON_String_Equal_Small_By_Perfect_Hash/10 2.543742499999878 ns/iter 1.1484520312500024 ns/iter 2.21
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 14.289836320135088 ns/iter 8.920926339285476 ns/iter 1.60
JSON_String_Fast_Hash/10 12.233099999999553 ns/iter 3.2368267857145434 ns/iter 3.78
JSON_String_Fast_Hash/100 12.704439285714994 ns/iter 3.247370982142529 ns/iter 3.91
JSON_String_Key_Hash/10 5.372052999999823 ns/iter 3.102039239686463 ns/iter 1.73
JSON_String_Key_Hash/100 11.931546428570527 ns/iter 7.395662500000201 ns/iter 1.61
JSON_Object_Defines_Miss_Same_Length 4.748921831416653 ns/iter 4.325280625000971 ns/iter 1.10
JSON_Object_Defines_Miss_Too_Small 4.805441528583924 ns/iter 4.280740913267027 ns/iter 1.12
JSON_Object_Defines_Miss_Too_Large 4.778325469816649 ns/iter 4.399572500000204 ns/iter 1.09
Pointer_Object_Traverse 70.62044642857249 ns/iter 34.83614124707036 ns/iter 2.03
Pointer_Object_Try_Traverse 72.40886160715071 ns/iter 38.54028145464606 ns/iter 1.88
Pointer_Push_Back_Pointer_To_Weak_Pointer 185.18164856126978 ns/iter 134.50232212043522 ns/iter 1.38
Pointer_Walker_Schema_ISO_Language 11870704.687499512 ns/iter 9761565.625002077 ns/iter 1.22
Pointer_Maybe_Tracked_Deeply_Nested/0 2307520.7142856666 ns/iter 1994235.9420291313 ns/iter 1.16
Pointer_Maybe_Tracked_Deeply_Nested/1 3787145.45454532 ns/iter 3474110.78431427 ns/iter 1.09
Pointer_Position_Tracker_Get_Deeply_Nested 564.0952678570598 ns/iter 505.45473214295305 ns/iter 1.12
Schema_Tracker_ISO_Language 10647406.249999491 ns/iter 10246948.437501403 ns/iter 1.04
Schema_Tracker_ISO_Language_To_JSON 64007027.272726774 ns/iter 51206481.818181515 ns/iter 1.25
Schema_Frame_WoT_References 5711014.285714506 ns/iter 4414861.875000043 ns/iter 1.29
Schema_Frame_OMC_References 23524369.999999333 ns/iter 19624141.176470455 ns/iter 1.20
Schema_Frame_OMC_Pointers 44782100.000006154 ns/iter 37786284.21052513 ns/iter 1.19
Schema_Frame_OMC_Locations 20130488.23529155 ns/iter 17051612.19511843 ns/iter 1.18
Schema_Frame_ISO_Language_Locations 80909171.42858091 ns/iter 63895763.63635156 ns/iter 1.27
Schema_Frame_ISO_Language_Root 2169.573124999857 ns/iter 1917.435104852524 ns/iter 1.13
Schema_Frame_KrakenD_References 40869247.05882879 ns/iter 31992022.72726738 ns/iter 1.28
Schema_Frame_KrakenD_Reachable 260543366.66660067 ns/iter 169467075.00000003 ns/iter 1.54
Schema_Frame_ISO_Language_Locations_To_JSON 164373625.0000245 ns/iter 134873479.99998745 ns/iter 1.22
Schema_Frame_Many_Resources_References 697058199.9999013 ns/iter 441223049.99996233 ns/iter 1.58
Schema_Frame_Deeply_Nested_References 23088158.33333237 ns/iter 17704128.571429987 ns/iter 1.30
JSONPath_Descendant_Filter_Nested 2435.0283091202487 ns/iter 1557.0627232140819 ns/iter 1.56
URITemplateRouter_Create 41231.65225465893 ns/iter 33533.291145169125 ns/iter 1.23
URITemplateRouter_Match 236.12324999998435 ns/iter 221.87750000000506 ns/iter 1.06
URITemplateRouter_Match_BasePath 264.96394709662155 ns/iter 252.61278571430725 ns/iter 1.05
URITemplateRouterView_Restore 33586.33572399104 ns/iter 16060.712053571942 ns/iter 2.09
URITemplateRouterView_Match 182.19384662446382 ns/iter 155.02079441868472 ns/iter 1.18
URITemplateRouterView_Match_BasePath 205.6498926049011 ns/iter 177.0724443814606 ns/iter 1.16
URITemplateRouterView_Arguments 539.5571999999902 ns/iter 396.89938616062545 ns/iter 1.36
JSONL_Parse_Large 32949533.33333762 ns/iter 22718340.000005808 ns/iter 1.45
JSONL_Parse_Large_GZIP 33403939.999999464 ns/iter 23175500.00000068 ns/iter 1.44
JSONLD_Catalog_Annotation_List_Populate 3000407.627118644 ns/iter 2534908.5714286244 ns/iter 1.18
JSONLD_Catalog_Materialize 7992947.7777770655 ns/iter 6151420.535713571 ns/iter 1.30
HTML_Build_Table_100000 92109828.57143791 ns/iter 93773549.99999928 ns/iter 0.98
HTML_Render_Table_100000 7902445.333334071 ns/iter 11810533.928569708 ns/iter 0.67
GZIP_Compress_ISO_Language_Set_3_Locations 36208844.99999875 ns/iter 28359291.999995545 ns/iter 1.28
GZIP_Decompress_ISO_Language_Set_3_Locations 10337559.999999637 ns/iter 11516329.68750249 ns/iter 0.90
GZIP_Compress_ISO_Language_Set_3_Schema 2103124.374999865 ns/iter 1891016.2162164832 ns/iter 1.11
GZIP_Decompress_ISO_Language_Set_3_Schema 641442.1428571262 ns/iter 608457.5892856491 ns/iter 1.05
JOSE_VerifySignature_RS256 21444.181997562137 ns/iter 18784.823078778303 ns/iter 1.14
JOSE_VerifySignature_ES512 1365697.0312499795 ns/iter 974872.0214189001 ns/iter 1.40

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

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: fbbf44e Previous: 1866173 Ratio
Regex_Lower_S_Or_Upper_S_Asterisk 1.9692900639644522 ns/iter 2.1299292668924203 ns/iter 0.92
Regex_Caret_Lower_S_Or_Upper_S_Asterisk_Dollar 1.8998178856561811 ns/iter 1.8730928473313013 ns/iter 1.01
Regex_Period_Asterisk 1.9317602035015027 ns/iter 1.8120596008337349 ns/iter 1.07
Regex_Group_Period_Asterisk_Group 1.9639231217777198 ns/iter 1.904316552380809 ns/iter 1.03
Regex_Period_Plus 2.283265119772487 ns/iter 2.1836617783489363 ns/iter 1.05
Regex_Period 2.2449453452090427 ns/iter 2.4533445092674517 ns/iter 0.92
Regex_Caret_Period_Plus_Dollar 2.164006452830597 ns/iter 2.5012268023611806 ns/iter 0.87
Regex_Caret_Group_Period_Plus_Group_Dollar 2.195189197185996 ns/iter 2.384812769810697 ns/iter 0.92
Regex_Caret_Period_Asterisk_Dollar 1.9147034232702222 ns/iter 1.9461600653876567 ns/iter 0.98
Regex_Caret_Group_Period_Asterisk_Group_Dollar 2.204889795304325 ns/iter 2.617074884050454 ns/iter 0.84
Regex_Caret_X_Hyphen 6.501096128281999 ns/iter 7.276254348227989 ns/iter 0.89
Regex_Period_Md_Dollar 23.439144993810274 ns/iter 20.76106172950252 ns/iter 1.13
Regex_Caret_Slash_Period_Asterisk 5.379060237392602 ns/iter 5.083001306530222 ns/iter 1.06
Regex_Caret_Period_Range_Dollar 2.1991931446361677 ns/iter 2.219753525617766 ns/iter 0.99
Regex_Nested_Backtrack 29.761093218842504 ns/iter 28.937840425924616 ns/iter 1.03
JSON_Array_Of_Objects_Unique 386.06201598791415 ns/iter 384.4082767393008 ns/iter 1.00
JSON_Parse_1 3638.0081539957964 ns/iter 3327.720595671409 ns/iter 1.09
JSON_Parse_Real 5531.693369839053 ns/iter 5616.753676888138 ns/iter 0.98
JSON_Parse_Decimal 6092.712469744036 ns/iter 6361.496543125906 ns/iter 0.96
JSON_Parse_Schema_ISO_Language 2728834.4726028526 ns/iter 2236809.215434127 ns/iter 1.22
JSON_Parse_Integer 3462.9968191101048 ns/iter 3283.272426135341 ns/iter 1.05
JSON_Parse_String_NonSSO_Plain 3076.09057225005 ns/iter 3461.9338118650485 ns/iter 0.89
JSON_Parse_String_SSO_Plain 1760.9619060161583 ns/iter 1982.5100140895222 ns/iter 0.89
JSON_Parse_String_Escape_Heavy 17166.66573417178 ns/iter 17277.375365162705 ns/iter 0.99
JSON_Parse_Object_Short_Keys 5386.831289321528 ns/iter 5727.2791159880635 ns/iter 0.94
JSON_Parse_Object_Scalar_Properties 2738.956125840413 ns/iter 2868.3033150139963 ns/iter 0.95
JSON_Parse_Object_Array_Properties 3514.316048687207 ns/iter 3723.759172211508 ns/iter 0.94
JSON_Parse_Object_Object_Properties 3717.1273308656932 ns/iter 3691.002064867173 ns/iter 1.01
JSON_Parse_Nested_Containers 24174.299612600542 ns/iter 25379.248174633376 ns/iter 0.95
JSON_From_String_Copy 11.165885322566597 ns/iter 10.570104601897592 ns/iter 1.06
JSON_From_String_Temporary 6.732540121375501 ns/iter 6.336228551891288 ns/iter 1.06
JSON_Number_To_Double 34.66089725456982 ns/iter 33.91235547641594 ns/iter 1.02
JSON_Object_At_Last_Key/8 4.134614764166915 ns/iter 4.1531211059055755 ns/iter 1.00
JSON_Object_At_Last_Key/32 12.434722338183198 ns/iter 13.161012545594568 ns/iter 0.94
JSON_Object_At_Last_Key/128 62.8079840412745 ns/iter 57.20010365390477 ns/iter 1.10
JSON_Object_At_Last_Key/512 204.94251499467256 ns/iter 188.95477135619203 ns/iter 1.08
JSON_Fast_Hash_Helm_Chart_Lock 60.9802567684944 ns/iter 61.00616217427392 ns/iter 1.00
JSON_Equality_Helm_Chart_Lock 167.59118486627196 ns/iter 165.4438889655264 ns/iter 1.01
JSON_Divisible_By_Decimal 299.5615432967721 ns/iter 206.63861444445726 ns/iter 1.45
JSON_String_Equal/10 10.734626746216229 ns/iter 7.813490184122933 ns/iter 1.37
JSON_String_Equal/100 8.51688038010823 ns/iter 7.673060604068962 ns/iter 1.11
JSON_String_Equal_Small_By_Perfect_Hash/10 0.3908701442830112 ns/iter 0.3577757238432079 ns/iter 1.09
JSON_String_Equal_Small_By_Runtime_Perfect_Hash/10 3.3998653306101136 ns/iter 3.4738705424840814 ns/iter 0.98
JSON_String_Fast_Hash/10 2.6799525496445025 ns/iter 2.462901773892171 ns/iter 1.09
JSON_String_Fast_Hash/100 2.228731112350604 ns/iter 2.072318011237633 ns/iter 1.08
JSON_String_Key_Hash/10 1.9703584431555379 ns/iter 1.8519736362705956 ns/iter 1.06
JSON_String_Key_Hash/100 2.856521802227555 ns/iter 2.228023050387129 ns/iter 1.28
JSON_Object_Defines_Miss_Same_Length 2.965002551766222 ns/iter 2.7104219156157066 ns/iter 1.09
JSON_Object_Defines_Miss_Too_Small 3.053792385585807 ns/iter 2.7119755677282815 ns/iter 1.13
JSON_Object_Defines_Miss_Too_Large 3.300613353314706 ns/iter 2.8317469517406075 ns/iter 1.17
Pointer_Object_Traverse 25.71888379275702 ns/iter 21.545546314207964 ns/iter 1.19
Pointer_Object_Try_Traverse 40.987173928662486 ns/iter 33.95985852606024 ns/iter 1.21
Pointer_Push_Back_Pointer_To_Weak_Pointer 186.95086230395626 ns/iter 140.29138891386108 ns/iter 1.33
Pointer_Walker_Schema_ISO_Language 1710247.844686871 ns/iter 1347878.222641414 ns/iter 1.27
Pointer_Maybe_Tracked_Deeply_Nested/0 1086722.167948787 ns/iter 831745.4180984739 ns/iter 1.31
Pointer_Maybe_Tracked_Deeply_Nested/1 1482177.3108910702 ns/iter 1037312.0643714014 ns/iter 1.43
Pointer_Position_Tracker_Get_Deeply_Nested 373.8173964884391 ns/iter 381.1283879846826 ns/iter 0.98
Schema_Tracker_ISO_Language 3047609.37499954 ns/iter 2823137.883534441 ns/iter 1.08
Schema_Tracker_ISO_Language_To_JSON 11183688.854839234 ns/iter 10758246.78461616 ns/iter 1.04
Schema_Frame_WoT_References 1930721.982758421 ns/iter 2275665.9325509286 ns/iter 0.85
Schema_Frame_OMC_References 9214319.448718611 ns/iter 11339580.18181836 ns/iter 0.81
Schema_Frame_OMC_Pointers 18465722.599999677 ns/iter 23456907.818179004 ns/iter 0.79
Schema_Frame_OMC_Locations 7534062.292928305 ns/iter 8935691.558442406 ns/iter 0.84
Schema_Frame_ISO_Language_Locations 22125261.13333221 ns/iter 22470536.290322874 ns/iter 0.98
Schema_Frame_ISO_Language_Root 108.69841783860707 ns/iter 117.70628436458945 ns/iter 0.92
Schema_Frame_KrakenD_References 12616943.927272668 ns/iter 14479292.510203574 ns/iter 0.87
Schema_Frame_KrakenD_Reachable 141463283.39998037 ns/iter 157311983.4000863 ns/iter 0.90
Schema_Frame_ISO_Language_Locations_To_JSON 20194390.15151475 ns/iter 23360140.62500169 ns/iter 0.86
Schema_Frame_Many_Resources_References 98987607.14286579 ns/iter 103605444.50001423 ns/iter 0.96
Schema_Frame_Deeply_Nested_References 12856768.714286495 ns/iter 12231351.928570736 ns/iter 1.05
JSONPath_Descendant_Filter_Nested 1227.5636541395425 ns/iter 1199.7418309345846 ns/iter 1.02
URITemplateRouter_Create 18100.769067197445 ns/iter 17927.8042498425 ns/iter 1.01
URITemplateRouter_Match 178.634578122562 ns/iter 169.86457654419593 ns/iter 1.05
URITemplateRouter_Match_BasePath 233.1415394293469 ns/iter 206.57659932468457 ns/iter 1.13
URITemplateRouterView_Restore 11560.97514403954 ns/iter 10676.581181863716 ns/iter 1.08
URITemplateRouterView_Match 134.60931509941955 ns/iter 144.09941657060673 ns/iter 0.93
URITemplateRouterView_Match_BasePath 158.11355214707487 ns/iter 164.73337208677148 ns/iter 0.96
URITemplateRouterView_Arguments 529.913745282253 ns/iter 579.6118639940852 ns/iter 0.91
JSONL_Parse_Large 6070324.561403196 ns/iter 7894139.031580045 ns/iter 0.77
JSONL_Parse_Large_GZIP 6627405.092592232 ns/iter 8815057.047619184 ns/iter 0.75
JSONLD_Catalog_Annotation_List_Populate 497813.21862069645 ns/iter 529717.8524343824 ns/iter 0.94
JSONLD_Catalog_Materialize 2142543.6424049367 ns/iter 2405655.3778624944 ns/iter 0.89
HTML_Build_Table_100000 35009410.449998766 ns/iter 42115485.29411523 ns/iter 0.83
HTML_Render_Table_100000 1422076.5850203077 ns/iter 1692833.4474393604 ns/iter 0.84
GZIP_Compress_ISO_Language_Set_3_Locations 26280066.96428591 ns/iter 30094574.666662768 ns/iter 0.87
GZIP_Decompress_ISO_Language_Set_3_Locations 3271261.961722368 ns/iter 3411064.53804415 ns/iter 0.96
GZIP_Compress_ISO_Language_Set_3_Schema 1434057.7046842906 ns/iter 1531897.871110838 ns/iter 0.94
GZIP_Decompress_ISO_Language_Set_3_Schema 266140.2520775412 ns/iter 275468.45611286943 ns/iter 0.97
JOSE_VerifySignature_RS256 21187.219618105682 ns/iter 21664.34668534034 ns/iter 0.98
JOSE_VerifySignature_ES512 928871.637566115 ns/iter 985837.1098900889 ns/iter 0.94

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

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
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 across 5 files (changes from recent commits).

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_bignum.h">

<violation number="1" location="src/core/crypto/crypto_bignum.h:844">
P2: When RSA uses `bignum_mod_exp_ct`, this new scalar retains a 64-bit function of the secret prime on the stack after return. Wipe `montgomery_factor` with a non-elidable secure scalar wipe alongside the other Montgomery constants.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

// The constants of a context that reduces through Montgomery multiplication:
// the negated inverse of the modulus modulo 2^64, left zero by a context that
// does not, and R^2 modulo the modulus for moving values into Montgomery form
std::uint64_t montgomery_factor{0};

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 RSA uses bignum_mod_exp_ct, this new scalar retains a 64-bit function of the secret prime on the stack after return. Wipe montgomery_factor with a non-elidable secure scalar wipe alongside the other Montgomery constants.

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

<comment>When RSA uses `bignum_mod_exp_ct`, this new scalar retains a 64-bit function of the secret prime on the stack after return. Wipe `montgomery_factor` with a non-elidable secure scalar wipe alongside the other Montgomery constants.</comment>

<file context>
@@ -828,6 +838,11 @@ template <std::size_t Capacity> struct BasicBarrettContext {
+  // The constants of a context that reduces through Montgomery multiplication:
+  // the negated inverse of the modulus modulo 2^64, left zero by a context that
+  // does not, and R^2 modulo the modulus for moving values into Montgomery form
+  std::uint64_t montgomery_factor{0};
+  BasicBignum<Capacity> montgomery_square;
 };
</file context>

@jviotti
jviotti merged commit c2b9fd0 into main Sep 13, 2026
15 checks passed
@jviotti
jviotti deleted the reference-fast-2 branch September 13, 2026 23:17
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