summaryrefslogtreecommitdiff
path: root/src/usr.bin
diff options
context:
space:
mode:
authortb <>2024-12-06 15:39:59 +0000
committertb <>2024-12-06 15:39:59 +0000
commiteb3e08f70ebb64ce7a9848592ac4705ef64a899b (patch)
tree44c20f6fb0ea8e363cf71669252bebc957b68254 /src/usr.bin
parent9026f3119d0fb71e88abcced3e32e113044416c2 (diff)
downloadopenbsd-eb3e08f70ebb64ce7a9848592ac4705ef64a899b.tar.gz
openbsd-eb3e08f70ebb64ce7a9848592ac4705ef64a899b.tar.bz2
openbsd-eb3e08f70ebb64ce7a9848592ac4705ef64a899b.zip
ec_mult: manage wNAF data in a struct
This refactors the wNAF multiplication further and introduces a small API that manages the wNAF digits for bn and the multiples of digit * point in a single struct that is initialized and freed in two API calls in the main function, ec_wNAF_mul(). This way the main algorithm is no longer cluttered with logic to keep various arrays in sync, helper functions calculating the wNAF splitting of bn and multiples of the point do not need to deal with memory management, and a pair of accessors obviates previously missing bounds checking. At this point we have reached a relatively clean and straightforward wNAF implementation that fits precisely the purpose needed in libcrypto, i.e., ECDSA verification instead of being generalized and optimized to the max for no good reason apart from endowing the author with an academic degree. Popper's famous maxim "if you can't say it clearly, keep quiet, and keep working until you can" very much applies to code as well. In other words, shut up and hack (and don't pour too much energy into commit messages, tb). ok jsing
Diffstat (limited to 'src/usr.bin')
0 files changed, 0 insertions, 0 deletions