summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_primitives.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Provide and use bn_clzw() in place of bn_word_clz().jsing2023-06-211-2/+4
| | | | | | | | | | On some architectures, we can provide an optimised (often single instruction) count-leading-zero implementation. In order to do this effectively, provide bn_clzw() as a static inline that can be replaced by an architecture specific version. The default implementation defers to the bn_word_clz() function (which may also be architecture specific). ok tb@
* Make BN_num_bits() independent of bn->top.jsing2023-06-211-0/+63
Provide bn_bitsize(), which performs a constant time scan of a BN in order to determine the bit size of the BN value. Use this for BN_num_bits() such that it is no longer dependent on the bn->top value. ok tb@