summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/arch/i386 (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Rename old assembly bn_sqr_words() to bn_sqr_word_wise().jsing2025-09-071-2/+1
| | | | | | | bn_sqr_words() does not actually compute the square of the words, it only computes the square of each individual word - rename it to reflect reality. Discussed with tb@
* Rename bn_mul_words()/bn_mul_add_words().jsing2025-08-301-3/+3
| | | | | | | | | | | | | | Most bn_.*_words() functions operate on two word arrays, however bn_mul_words() and bn_mul_add_words() operate on one word array and multiply by a single word. Rename these to bn_mulw_words() and bn_mulw_add_words() to reflect this, following naming scheme that we use for primitives. This frees up bn_mul_words() to actually be used for multiplying two word arrays. Rename bn_mul_normal() to bn_mul_words(), which will then become one of the possible assembly integration points. ok tb@
* Rename bn_umul_hilo() to bn_mulw().jsing2023-02-161-7/+7
| | | | | | | | | This keeps the naming consistent with the other bignum primitives that have been recently introduced. Also, use 1/0 intead of h/l (e.g. a1 instead of ah), as this keeps consistency with other primitives and allows for naming that works with double word, triple word and quadruple word inputs/outputs. Discussed with tb@
* Provide inline assembly versions of bn_umul_hilo() for aarch64/amd64/i386.jsing2023-01-311-1/+23
| | | | ok tb@
* Provide bn_div_rem_words() and make use of it.jsing2023-01-281-1/+26
| | | | | | | | | | | | | | | | Provide a function that divides a double word (h:l) by d, returning the quotient q and the remainder r, such that q * d + r is equal to the numerator. Call this from the three places that currently implement this themselves. This is implemented with some slight indirection, which allows for per architecture implementations, replacing the define/macro tangle, which messes with variables that are not passed to it. Also remove a duplicate of bn_div_words() for the BN_ULLONG && BN_DIV2W case - this is already handled. ok tb@
* Move bn_mul_add_words() and bn_mul_words() from bn_asm.c to bn_mul.c.jsing2023-01-231-1/+3
| | | | | | These are wrapped with #ifndef HAVE_BN_ADD_MUL_WORDS/HAVE_BN_MUL_WORDS, which are defined for architectures that provide their own assembly versions.
* Move bn_sqr_words from bn_asm.c to bn_sqr.c.jsing2023-01-231-1/+2
| | | | | This is wrapped with #ifndef HAVE_BN_SQR_WORDS, which is then defined for architectures that provide their own assembly versions.
* Move bn_div_words from bn_asm.c to bn_div.c.jsing2023-01-231-1/+3
| | | | | This is wrapped with #ifndef HAVE_BN_DIV_WORDS, which are defined for architectures that provide their own assembly versions.
* Move bn_add_words() and bn_sub_words from bn_asm.c to bn_add.c.jsing2023-01-231-1/+5
| | | | | These are wrapped with #ifndef HAVE_BN_ADD_WORDS/HAVE_BN_SUB_WORDS, which are defined for architectures that provide their own assembly versions.
* Move bn_{mul,sqr}_comba{4,8}() from bn_asm.c to bn_mul.c/bn_sqr.c.jsing2023-01-201-1/+7
| | | | | | | Wrap these in HAVE_BN_{MUL,SQR}_COMBA{4,8} defines. Add these defines to bn_arch.h where the architecture currently provides its own version. ok tb@
* Provide a per machine bn_arch.h.jsing2023-01-201-0/+24
This will provide a location for machine specific defines, prototypes and inline functions. ok tb@