21 #include <linux/bitops.h>
25 #define MAX_EXTERN_MPI_BITS 16384
36 unsigned nbits, nlimbs;
40 while (nbytes >= 0 && buffer[0] == 0) {
47 pr_info(
"MPI: mpi too large (%u bits)\n", nbits);
66 for (j = nlimbs; j > 0; j--) {
84 unsigned nbits,
nbytes, nlimbs, nread = 0;
90 nbits = buffer[0] << 8 | buffer[1];
93 pr_info(
"MPI: mpi too large (%u bits)\n", nbits);
99 nbytes = (nbits + 7) / 8;
112 if (++nread > *ret_nread) {
114 (
"MPI: mpi larger than buffer nread=%d ret_nread=%d\n",
154 for (i = a->
nlimbs - 1; i >= 0; i--) {
156 #if BYTES_PER_MPI_LIMB == 4
161 #elif BYTES_PER_MPI_LIMB == 8
171 #error please implement for this limb size.
197 if (RESIZE_IF_NEEDED(a, nlimbs) < 0)
202 #if BYTES_PER_MPI_LIMB == 4
207 #elif BYTES_PER_MPI_LIMB == 8
217 #error please implement for this limb size.
222 #if BYTES_PER_MPI_LIMB == 4
230 #elif BYTES_PER_MPI_LIMB == 8
247 #error please implement for this limb size.
254 pr_emerg(
"MPI: mpi_set_buffer: Assertion failed (%d != %d)", i,