From 7e0bf4ec5cb3dd608d97735575e3f62252455878 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 7 Oct 2024 12:13:42 +0100 Subject: [crypto] Rename bigint_rol()/bigint_ror() to bigint_shl()/bigint_shr() The big integer shift operations are misleadingly described as rotations since the original x86 implementations are essentially trivial loops around the relevant rotate-through-carry instruction. The overall operation performed is a shift rather than a rotation. Update the function names and descriptions to reflect this. Signed-off-by: Michael Brown --- src/arch/riscv/include/bits/bigint.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/arch/riscv') diff --git a/src/arch/riscv/include/bits/bigint.h b/src/arch/riscv/include/bits/bigint.h index 13fd16759..58351ac07 100644 --- a/src/arch/riscv/include/bits/bigint.h +++ b/src/arch/riscv/include/bits/bigint.h @@ -135,13 +135,13 @@ bigint_subtract_raw ( const unsigned long *subtrahend0, unsigned long *value0, } /** - * Rotate big integer left + * Shift big integer left * * @v value0 Element 0 of big integer * @v size Number of elements */ static inline __attribute__ (( always_inline )) void -bigint_rol_raw ( unsigned long *value0, unsigned int size ) { +bigint_shl_raw ( unsigned long *value0, unsigned int size ) { bigint_t ( size ) __attribute__ (( may_alias )) *value = ( ( void * ) value0 ); unsigned long *valueN = ( value0 + size ); @@ -174,13 +174,13 @@ bigint_rol_raw ( unsigned long *value0, unsigned int size ) { } /** - * Rotate big integer right + * Shift big integer right * * @v value0 Element 0 of big integer * @v size Number of elements */ static inline __attribute__ (( always_inline )) void -bigint_ror_raw ( unsigned long *value0, unsigned int size ) { +bigint_shr_raw ( unsigned long *value0, unsigned int size ) { bigint_t ( size ) __attribute__ (( may_alias )) *value = ( ( void * ) value0 ); unsigned long *valueN = ( value0 + size ); -- cgit