]> git.ipfire.org Git - thirdparty/shadow.git/commit
Add bit manipulation functions
authorAlejandro Colomar <alx@kernel.org>
Mon, 30 Jan 2023 11:43:34 +0000 (12:43 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 30 Jan 2023 17:24:15 +0000 (18:24 +0100)
commit0712b236c3bc93987ce64f7631f5a9fa4b042f4f
tree60efd9f6ef64bfcdbe1766170b0729e091888eaf
parent848f53c1d3c1362c86d3baab6906e1e4419d2634
Add bit manipulation functions

We do need the unoptimized version of csrand_uniform() for high values
of `n`, since the optimized version depends on having __int128, and it's
not available on several platforms, including ARMv7, IA32, and MK68k.

This reverts commit 848f53c1d3c1362c86d3baab6906e1e4419d2634; however,
I applied some tweaks to the reverted commit.

Reported-by: Adam Sampson <ats@offog.org>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/bit.h [new file with mode: 0644]
libmisc/Makefile.am
libmisc/bit.c [new file with mode: 0644]