CVSROOT: /cvs Module name: src Changes by: js...@cvs.openbsd.org 2025/05/24 22:30:55
Modified files: lib/libcrypto/bn: bn_internal.h bn_local.h Added files: lib/libcrypto/bn: bn_add_sub.c Log message: Provide additional variants of bn_add_words()/bn_sub_words(). Move bn_add_words() and bn_sub_words() from bn_add.c to bn_add_sub.c. These have effectively been replaced in the previous rewrites. Remove the asserts - if bad lengths are passed the results will be incorrect and things will fail (these should use size_t instead of int, but that is a problem for another day). Provide bn_sub_words_borrow(), which computes a subtraction but only returns the resulting borrow. Provide bn_add_words_masked() and bn_sub_words_masked(), which perform an masked addition or subtraction. These can also be used to implement constant time addition and subtraction, especially for reduction. ok beck@ tb@