Lines Matching refs:nbytes

32 MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)  in mpi_read_raw_data()  argument
40 while (nbytes > 0 && buffer[0] == 0) { in mpi_read_raw_data()
42 nbytes--; in mpi_read_raw_data()
45 nbits = nbytes * 8; in mpi_read_raw_data()
50 if (nbytes > 0) in mpi_read_raw_data()
55 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_data()
63 if (nbytes > 0) { in mpi_read_raw_data()
64 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_data()
84 unsigned nbits, nbytes, nlimbs, nread = 0; in mpi_read_from_buffer() local
99 nbytes = DIV_ROUND_UP(nbits, 8); in mpi_read_from_buffer()
100 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_from_buffer()
104 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_from_buffer()
160 int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes, in mpi_read_buffer() argument
168 if (buf_len < n || !buf || !nbytes) in mpi_read_buffer()
177 *nbytes = n - lzeros; in mpi_read_buffer()
228 void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) in mpi_get_buffer() argument
234 if (!nbytes) in mpi_get_buffer()
247 ret = mpi_read_buffer(a, buf, n, nbytes, sign); in mpi_get_buffer()
260 int mpi_set_buffer(MPI a, const void *xbuffer, unsigned nbytes, int sign) in mpi_set_buffer() argument
267 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_set_buffer()
272 for (i = 0, p = buffer + nbytes - 1; p >= buffer + BYTES_PER_MPI_LIMB;) { in mpi_set_buffer()
350 int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned *nbytes, in mpi_write_to_sgl() argument
358 if (!nbytes || *nbytes < n) in mpi_write_to_sgl()
366 *nbytes = n - lzeros; in mpi_write_to_sgl()
441 unsigned int nbits, nlimbs, nbytes; in mpi_read_raw_from_sgl() local
468 nbytes = 0; in mpi_read_raw_from_sgl()
470 nbytes = len - lzeros; in mpi_read_raw_from_sgl()
472 nbits = nbytes * 8; in mpi_read_raw_from_sgl()
478 if (nbytes > 0) in mpi_read_raw_from_sgl()
483 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_from_sgl()
492 if (nbytes == 0) in mpi_read_raw_from_sgl()
498 x = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_from_sgl()