mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
mpint: add mp_lshift_fixed().
This is a version of mp_lshift_fixed_into() which allocates the output number, which it can do because you know the size of the original number and are allowed to treat the shift count as non-secret. (By contrast, mp_lshift_safe() would be a nonsensical function - if you're trying to keep the shift count secret, you _can't_ use it as a parameter of memory allocation! In that situation you have no choice but to allocate memory based on a fixed upper bound.)
This commit is contained in:
1
mpint.h
1
mpint.h
@ -383,6 +383,7 @@ mp_int *mp_rshift_safe(mp_int *x, size_t shift);
|
||||
*/
|
||||
void mp_lshift_fixed_into(mp_int *r, mp_int *a, size_t shift);
|
||||
void mp_rshift_fixed_into(mp_int *r, mp_int *x, size_t shift);
|
||||
mp_int *mp_lshift_fixed(mp_int *x, size_t shift);
|
||||
mp_int *mp_rshift_fixed(mp_int *x, size_t shift);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user