[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 <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2024-10-07 12:13:42 +01:00
parent 3f4f843920
commit 7e0bf4ec5c
8 changed files with 60 additions and 60 deletions

View File

@@ -89,23 +89,23 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
} while ( 0 )
/**
* Rotate big integer left
* Shift big integer left
*
* @v value Big integer
*/
#define bigint_rol( value ) do { \
#define bigint_shl( value ) do { \
unsigned int size = bigint_size (value); \
bigint_rol_raw ( (value)->element, size ); \
bigint_shl_raw ( (value)->element, size ); \
} while ( 0 )
/**
* Rotate big integer right
* Shift big integer right
*
* @v value Big integer
*/
#define bigint_ror( value ) do { \
#define bigint_shr( value ) do { \
unsigned int size = bigint_size (value); \
bigint_ror_raw ( (value)->element, size ); \
bigint_shr_raw ( (value)->element, size ); \
} while ( 0 )
/**
@@ -293,8 +293,8 @@ void bigint_add_raw ( const bigint_element_t *addend0,
bigint_element_t *value0, unsigned int size );
void bigint_subtract_raw ( const bigint_element_t *subtrahend0,
bigint_element_t *value0, unsigned int size );
void bigint_rol_raw ( bigint_element_t *value0, unsigned int size );
void bigint_ror_raw ( bigint_element_t *value0, unsigned int size );
void bigint_shl_raw ( bigint_element_t *value0, unsigned int size );
void bigint_shr_raw ( bigint_element_t *value0, unsigned int size );
int bigint_is_zero_raw ( const bigint_element_t *value0, unsigned int size );
int bigint_is_geq_raw ( const bigint_element_t *value0,
const bigint_element_t *reference0,