Lines Matching refs:nbytes
35 MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes) in mpi_read_raw_data() argument
43 while (nbytes > 0 && buffer[0] == 0) { in mpi_read_raw_data()
45 nbytes--; in mpi_read_raw_data()
48 nbits = nbytes * 8; in mpi_read_raw_data()
53 if (nbytes > 0) in mpi_read_raw_data()
56 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_data()
64 if (nbytes > 0) { in mpi_read_raw_data()
65 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_data()
84 unsigned int nbits, nbytes; in mpi_read_from_buffer() local
96 nbytes = DIV_ROUND_UP(nbits, 8); in mpi_read_from_buffer()
97 if (nbytes + 2 > *ret_nread) { in mpi_read_from_buffer()
99 nbytes, *ret_nread); in mpi_read_from_buffer()
103 val = mpi_read_raw_data(buffer + 2, nbytes); in mpi_read_from_buffer()
107 *ret_nread = nbytes + 2; in mpi_read_from_buffer()
143 int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes, in mpi_read_buffer() argument
157 if (!buf || !nbytes) in mpi_read_buffer()
166 *nbytes = n - lzeros; in mpi_read_buffer()
171 *nbytes = n - lzeros; in mpi_read_buffer()
203 void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) in mpi_get_buffer() argument
209 if (!nbytes) in mpi_get_buffer()
222 ret = mpi_read_buffer(a, buf, n, nbytes, sign); in mpi_get_buffer()
247 int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned nbytes, in mpi_write_to_sgl() argument
266 if (nbytes < n) in mpi_write_to_sgl()
269 nents = sg_nents_for_len(sgl, nbytes); in mpi_write_to_sgl()
278 while (nbytes > n) { in mpi_write_to_sgl()
279 i = min_t(unsigned, nbytes - n, buf_len); in mpi_write_to_sgl()
282 nbytes -= i; in mpi_write_to_sgl()
330 MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes) in mpi_read_raw_from_sgl() argument
340 ents = sg_nents_for_len(sgl, nbytes); in mpi_read_raw_from_sgl()
348 while (nbytes > 0) { in mpi_read_raw_from_sgl()
362 nbytes -= lzeros; in mpi_read_raw_from_sgl()
368 nbytes -= lzeros; in mpi_read_raw_from_sgl()
369 nbits = nbytes * 8; in mpi_read_raw_from_sgl()
376 if (nbytes > 0) in mpi_read_raw_from_sgl()
381 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_from_sgl()
390 if (nbytes == 0) in mpi_read_raw_from_sgl()
395 z = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_from_sgl()