mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 03:52:49 -05:00
New mpint function mp_get_integer().
If you have an mp_int that you know will fit in an ordinary integer type, this function gives it to you in that form.
This commit is contained in:
6
mpint.h
6
mpint.h
@ -100,6 +100,12 @@ mp_int *mp_power_2(size_t power);
|
||||
uint8_t mp_get_byte(mp_int *x, size_t byte);
|
||||
unsigned mp_get_bit(mp_int *x, size_t bit);
|
||||
|
||||
/*
|
||||
* Retrieve the value of an mp_int as a uintmax_t, assuming it's small
|
||||
* enough to fit.
|
||||
*/
|
||||
uintmax_t mp_get_integer(mp_int *x);
|
||||
|
||||
/*
|
||||
* Set an mp_int bit. Again, the bit index is not considered secret.
|
||||
* Do not pass an out-of-range index, on pain of assertion failure.
|
||||
|
Reference in New Issue
Block a user