diff options
| author | Michael Brown | 2024-10-08 12:52:07 +0200 |
|---|---|---|
| committer | Michael Brown | 2024-10-10 16:35:16 +0200 |
| commit | f78c5a763cc7bb2e2b7b437e7cc74a3efb876960 (patch) | |
| tree | c0e9186ed0dfad5c3201f87ec5cde3ac4967ae9c /src/arch/riscv/include | |
| parent | [crypto] Rename bigint_rol()/bigint_ror() to bigint_shl()/bigint_shr() (diff) | |
| download | ipxe-f78c5a763cc7bb2e2b7b437e7cc74a3efb876960.tar.gz ipxe-f78c5a763cc7bb2e2b7b437e7cc74a3efb876960.tar.xz ipxe-f78c5a763cc7bb2e2b7b437e7cc74a3efb876960.zip | |
[crypto] Use architecture-independent bigint_is_set()
Every architecture uses the same implementation for bigint_is_set(),
and there is no reason to suspect that a future CPU architecture will
provide a more efficient way to implement this operation.
Simplify the code by providing a single architecture-independent
implementation of bigint_is_set().
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/riscv/include')
| -rw-r--r-- | src/arch/riscv/include/bits/bigint.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/arch/riscv/include/bits/bigint.h b/src/arch/riscv/include/bits/bigint.h index 58351ac07..5b22b9ac7 100644 --- a/src/arch/riscv/include/bits/bigint.h +++ b/src/arch/riscv/include/bits/bigint.h @@ -260,25 +260,6 @@ bigint_is_geq_raw ( const unsigned long *value0, } /** - * Test if bit is set in big integer - * - * @v value0 Element 0 of big integer - * @v size Number of elements - * @v bit Bit to test - * @ret is_set Bit is set - */ -static inline __attribute__ (( always_inline )) int -bigint_bit_is_set_raw ( const unsigned long *value0, unsigned int size, - unsigned int bit ) { - const bigint_t ( size ) __attribute__ (( may_alias )) *value = - ( ( const void * ) value0 ); - unsigned int index = ( bit / ( 8 * sizeof ( *value0 ) ) ); - unsigned int subindex = ( bit % ( 8 * sizeof ( *value0 ) ) ); - - return ( !! ( value->element[index] & ( 1UL << subindex ) ) ); -} - -/** * Find highest bit set in big integer * * @v value0 Element 0 of big integer |
