Codebase list libcryptx-perl / b2dd91b
avoid long long Karel Miko 6 years ago
3 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1515 */
1616
1717 /* get the lower unsigned long long of an mp_int, platform dependent */
18 unsigned long long mp_get_long_long(const mp_int *a)
18 uint64_t mp_get_long_long(const mp_int *a)
1919 {
2020 int i;
21 unsigned long long res;
21 uint64_t res;
2222
2323 if (a->used == 0) {
2424 return 0;
2525 }
2626
2727 /* get number of digits of the lsb we have to read */
28 i = MIN(a->used, ((((int)sizeof(unsigned long long) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
28 i = MIN(a->used, ((((int)sizeof(uint64_t) * CHAR_BIT) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1;
2929
3030 /* get most significant digit of result */
3131 res = DIGIT(a, i);
1515 */
1616
1717 /* set a platform dependent unsigned long long int */
18 MP_SET_XLONG(mp_set_long_long, unsigned long long)
18 MP_SET_XLONG(mp_set_long_long, uint64_t)
1919 #endif
2020
2121 /* ref: $Format:%D$ */
241241 int mp_set_long(mp_int *a, unsigned long b);
242242
243243 /* set a platform dependent unsigned long long value */
244 int mp_set_long_long(mp_int *a, unsigned long long b);
244 int mp_set_long_long(mp_int *a, uint64_t b);
245245
246246 /* get a 32-bit value */
247247 unsigned long mp_get_int(const mp_int *a);
250250 unsigned long mp_get_long(const mp_int *a);
251251
252252 /* get a platform dependent unsigned long long value */
253 unsigned long long mp_get_long_long(const mp_int *a);
253 uint64_t mp_get_long_long(const mp_int *a);
254254
255255 /* initialize and set a digit */
256256 int mp_init_set(mp_int *a, mp_digit b);