Lines Matching refs:a
30 void mpi_normalize(MPI a) in mpi_normalize() argument
32 for (; a->nlimbs && !a->d[a->nlimbs - 1]; a->nlimbs--) in mpi_normalize()
40 unsigned mpi_get_nbits(MPI a) in mpi_get_nbits() argument
44 mpi_normalize(a); in mpi_get_nbits()
46 if (a->nlimbs) { in mpi_get_nbits()
47 mpi_limb_t alimb = a->d[a->nlimbs - 1]; in mpi_get_nbits()
52 n = BITS_PER_MPI_LIMB - n + (a->nlimbs - 1) * BITS_PER_MPI_LIMB; in mpi_get_nbits()
62 int mpi_test_bit(MPI a, unsigned int n) in mpi_test_bit() argument
70 if (limbno >= a->nlimbs) in mpi_test_bit()
72 limb = a->d[limbno]; in mpi_test_bit()
80 void mpi_set_bit(MPI a, unsigned int n) in mpi_set_bit() argument
87 if (limbno >= a->nlimbs) { in mpi_set_bit()
88 for (i = a->nlimbs; i < a->alloced; i++) in mpi_set_bit()
89 a->d[i] = 0; in mpi_set_bit()
90 mpi_resize(a, limbno+1); in mpi_set_bit()
91 a->nlimbs = limbno+1; in mpi_set_bit()
93 a->d[limbno] |= (A_LIMB_1<<bitno); in mpi_set_bit()
99 void mpi_set_highbit(MPI a, unsigned int n) in mpi_set_highbit() argument
106 if (limbno >= a->nlimbs) { in mpi_set_highbit()
107 for (i = a->nlimbs; i < a->alloced; i++) in mpi_set_highbit()
108 a->d[i] = 0; in mpi_set_highbit()
109 mpi_resize(a, limbno+1); in mpi_set_highbit()
110 a->nlimbs = limbno+1; in mpi_set_highbit()
112 a->d[limbno] |= (A_LIMB_1<<bitno); in mpi_set_highbit()
114 a->d[limbno] &= ~(A_LIMB_1 << bitno); in mpi_set_highbit()
115 a->nlimbs = limbno+1; in mpi_set_highbit()
122 void mpi_clear_highbit(MPI a, unsigned int n) in mpi_clear_highbit() argument
129 if (limbno >= a->nlimbs) in mpi_clear_highbit()
133 a->d[limbno] &= ~(A_LIMB_1 << bitno); in mpi_clear_highbit()
134 a->nlimbs = limbno+1; in mpi_clear_highbit()
140 void mpi_clear_bit(MPI a, unsigned int n) in mpi_clear_bit() argument
147 if (limbno >= a->nlimbs) in mpi_clear_bit()
149 a->d[limbno] &= ~(A_LIMB_1 << bitno); in mpi_clear_bit()
158 void mpi_rshift_limbs(MPI a, unsigned int count) in mpi_rshift_limbs() argument
160 mpi_ptr_t ap = a->d; in mpi_rshift_limbs()
161 mpi_size_t n = a->nlimbs; in mpi_rshift_limbs()
165 a->nlimbs = 0; in mpi_rshift_limbs()
172 a->nlimbs -= count; in mpi_rshift_limbs()
178 void mpi_rshift(MPI x, MPI a, unsigned int n) in mpi_rshift() argument
185 if (x == a) { in mpi_rshift()
202 xsize = a->nlimbs; in mpi_rshift()
203 x->sign = a->sign; in mpi_rshift()
206 for (i = 0; i < a->nlimbs; i++) in mpi_rshift()
207 x->d[i] = a->d[i]; in mpi_rshift()
226 xsize = a->nlimbs; in mpi_rshift()
227 x->sign = a->sign; in mpi_rshift()
233 mpihelp_rshift(x->d, a->d, x->nlimbs, nbits); in mpi_rshift()
239 x->d[i] = a->d[i]; in mpi_rshift()
251 void mpi_lshift_limbs(MPI a, unsigned int count) in mpi_lshift_limbs() argument
254 int n = a->nlimbs; in mpi_lshift_limbs()
260 RESIZE_IF_NEEDED(a, n+count); in mpi_lshift_limbs()
262 ap = a->d; in mpi_lshift_limbs()
267 a->nlimbs += count; in mpi_lshift_limbs()
273 void mpi_lshift(MPI x, MPI a, unsigned int n) in mpi_lshift() argument
278 if (x == a && !n) in mpi_lshift()
281 if (x != a) { in mpi_lshift()
283 unsigned int alimbs = a->nlimbs; in mpi_lshift()
284 int asign = a->sign; in mpi_lshift()
289 ap = a->d; in mpi_lshift()
292 x->flags = a->flags; in mpi_lshift()