41 b->sign = (
n < 0) ? -1 : 1;
45 #ifdef RZ_BIG_WORD_SIZE
46 #if (RZ_BIG_WORD_SIZE == 1)
47 b->array[0] = (
v & 0x000000ff);
48 b->array[1] = (
v & 0x0000ff00) >> 8;
49 b->array[2] = (
v & 0x00ff0000) >> 16;
50 b->array[3] = (
v & 0xff000000) >> 24;
51 #elif (RZ_BIG_WORD_SIZE == 2)
52 b->array[0] = (
v & 0x0000ffff);
53 b->array[1] = (
v & 0xffff0000) >> 16;
54 #elif (RZ_BIG_WORD_SIZE == 4)
69 #ifdef RZ_BIG_WORD_SIZE
70 #if (RZ_BIG_WORD_SIZE == 1)
71 b->array[0] = (
v & 0x000000ff);
72 b->array[1] = (
v & 0x0000ff00) >> 8;
73 b->array[2] = (
v & 0x00ff0000) >> 16;
74 b->array[3] = (
v & 0xff000000) >> 24;
75 #elif (RZ_BIG_WORD_SIZE == 2)
76 b->array[0] = (
v & 0x0000ffff);
77 b->array[1] = (
v & 0xffff0000) >> 16;
78 #elif (RZ_BIG_WORD_SIZE == 4)
93 #if (RZ_BIG_WORD_SIZE == 1)
95 ret +=
b->array[1] << 8;
96 ret +=
b->array[2] << 16;
97 ret +=
b->array[3] << 24;
98 #elif (RZ_BIG_WORD_SIZE == 2)
100 ret +=
b->array[1] << 16;
101 #elif (RZ_BIG_WORD_SIZE == 4)
126 if (
str[0] ==
'0' &&
str[1] ==
'x') {
148 for (;
i >= 0;
i--) {
165 for (;
b->array[j] == 0 && j >= 0; j--) {
186 for (z =
k; ret_str[
i + z] && z < last_z; z++) {
187 ret_str[
i + z -
k] = ret_str[
i + z];
192 for (; j >= 0; j--) {
225 c->sign = (sign >= 0 ? 1 : -1);
247 if (
a->sign >= 0 &&
b->sign >= 0) {
252 if (
a->sign >= 0 &&
b->sign < 0) {
256 if (
a->sign < 0 &&
b->sign >= 0) {
260 if (
a->sign < 0 &&
b->sign < 0) {
272 if (
a->sign >= 0 &&
b->sign >= 0) {
276 if (
a->sign >= 0 &&
b->sign < 0) {
281 if (
a->sign < 0 &&
b->sign >= 0) {
286 if (
a->sign < 0 &&
b->sign < 0) {
317 res->
sign =
a->sign *
b->sign;
338 int sign =
a->sign *
b->sign;
433 c->array[
i] = (
a->array[
i] &
b->array[
i]);
446 c->array[
i] = (
a->array[
i] |
b->array[
i]);
459 c->array[
i] = (
a->array[
i] ^
b->array[
i]);
472 int nwords = nbits / nbits_pr_word;
475 nbits -= (nwords * nbits_pr_word);
483 b->array[
i] <<= nbits;
496 int nwords = nbits / nbits_pr_word;
499 nbits -= (nwords * nbits_pr_word);
507 b->array[
i] >>= nbits;
515 if (
a->sign !=
b->sign)
516 return a->sign > 0 ? 1 : -1;
521 if (
a->array[
i] >
b->array[
i]) {
524 if (
a->array[
i] <
b->array[
i]) {
642 a->array[
i] =
a->array[
i + nwords];
656 a->array[
i] =
a->array[
i - nwords];
659 for (;
i >= 0;
i--) {
RZ_API char * rz_big_to_hexstr(RzNumBig *b)
RZ_API void rz_big_dec(RzNumBig *a)
static void rz_big_from_unsigned(RzNumBig *b, ut64 v)
static void _rshift_one_bit(RzNumBig *a)
RZ_API int rz_big_cmp(RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_assign(RzNumBig *dst, RzNumBig *src)
RZ_API void rz_big_and(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_rshift(RzNumBig *b, RzNumBig *a, size_t nbits)
RZ_API void rz_big_from_int(RzNumBig *b, st64 n)
RZ_API void rz_big_xor(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_lshift(RzNumBig *b, RzNumBig *a, size_t nbits)
RZ_API void rz_big_fini(RzNumBig *b)
RZ_API void rz_big_add(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_from_hexstr(RzNumBig *n, const char *str)
static void _r_big_zero_out(RzNumBig *n)
RZ_API void rz_big_divmod(RzNumBig *c, RzNumBig *d, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_free(RzNumBig *b)
static void rz_big_sub_inner(RzNumBig *c, RzNumBig *a, RzNumBig *b)
static void rz_big_add_inner(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_or(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API st64 rz_big_to_int(RzNumBig *b)
RZ_API RzNumBig * rz_big_new(void)
RZ_API void rz_big_powm(RzNumBig *c, RzNumBig *a, RzNumBig *b, RzNumBig *m)
RZ_API void rz_big_div(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_init(RzNumBig *b)
RZ_API void rz_big_sub(RzNumBig *c, RzNumBig *a, RzNumBig *b)
static void _rshift_word(RzNumBig *a, int nwords)
static void _lshift_one_bit(RzNumBig *a)
RZ_API void rz_big_mod(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API void rz_big_isqrt(RzNumBig *b, RzNumBig *a)
static void _lshift_word(RzNumBig *a, int nwords)
RZ_API void rz_big_inc(RzNumBig *a)
RZ_API void rz_big_mul(RzNumBig *c, RzNumBig *a, RzNumBig *b)
RZ_API int rz_big_is_zero(RzNumBig *a)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void nbytes
RZ_API void Ht_() free(HtName_(Ht) *ht)
return memset(p, 0, total)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * calloc(size_t number, size_t size)
#define rz_return_if_fail(expr)
#define rz_return_val_if_fail(expr, val)
#define RZ_BIG_ARRAY_SIZE
#define RZ_BIG_FORMAT_STR_LEN
#define RZ_BIG_SPRINTF_FORMAT_STR
#define RZ_BIG_SSCANF_FORMAT_STR
RZ_API int rz_snprintf(char *string, int len, const char *fmt,...) RZ_PRINTF_CHECK(3
RZ_BIG_DTYPE array[RZ_BIG_ARRAY_SIZE]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()