Skip to content

Conversation

@GarmashAlex
Copy link

The precomputed Straus implementations for both the vector and serial backends build NafLookupTable8 for static points, which stores odd multiples up to 127A, but they decomposed static scalars with a width-5 NAF, restricting lookups to 1..15 and leaving most of the table unused. This change switches static scalar decomposition to non_adjacent_form(8), fully utilizing the 64-entry odd table. It reduces the number of static additions due to the lower nonzero digit density of width-8 NAF while keeping the number of doublings and the memory footprint unchanged, since the larger table was already computed. The change is safe because Scalar::non_adjacent_form supports w<=8 and NafLookupTable8::select requires odd digits less than 128, and it matches the existing pattern in vartime double-base multiplication where width 8 is used when a large odd-multiples table is available. No API or behavioral changes beyond this decomposition width are introduced.

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