Lines Matching refs:nbytes

36 MPI mpi_read_raw_data(const void *xbuffer, size_t nbytes)  in mpi_read_raw_data()  argument
44 while (nbytes > 0 && buffer[0] == 0) { in mpi_read_raw_data()
46 nbytes--; in mpi_read_raw_data()
49 nbits = nbytes * 8; in mpi_read_raw_data()
54 if (nbytes > 0) in mpi_read_raw_data()
57 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_data()
65 if (nbytes > 0) { in mpi_read_raw_data()
66 i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_data()
85 unsigned int nbits, nbytes; in mpi_read_from_buffer() local
97 nbytes = DIV_ROUND_UP(nbits, 8); in mpi_read_from_buffer()
98 if (nbytes + 2 > *ret_nread) { in mpi_read_from_buffer()
100 nbytes, *ret_nread); in mpi_read_from_buffer()
104 val = mpi_read_raw_data(buffer + 2, nbytes); in mpi_read_from_buffer()
108 *ret_nread = nbytes + 2; in mpi_read_from_buffer()
121 unsigned int nbits, nbytes, nlimbs; in mpi_fromstr() local
142 nbytes = (nbits+7) / 8; in mpi_fromstr()
143 nlimbs = (nbytes+BYTES_PER_MPI_LIMB-1) / BYTES_PER_MPI_LIMB; in mpi_fromstr()
148 i = BYTES_PER_MPI_LIMB - (nbytes % BYTES_PER_MPI_LIMB); in mpi_fromstr()
250 int mpi_read_buffer(MPI a, uint8_t *buf, unsigned buf_len, unsigned *nbytes, in mpi_read_buffer() argument
264 if (!buf || !nbytes) in mpi_read_buffer()
273 *nbytes = n - lzeros; in mpi_read_buffer()
278 *nbytes = n - lzeros; in mpi_read_buffer()
310 void *mpi_get_buffer(MPI a, unsigned *nbytes, int *sign) in mpi_get_buffer() argument
316 if (!nbytes) in mpi_get_buffer()
329 ret = mpi_read_buffer(a, buf, n, nbytes, sign); in mpi_get_buffer()
354 int mpi_write_to_sgl(MPI a, struct scatterlist *sgl, unsigned nbytes, in mpi_write_to_sgl() argument
373 if (nbytes < n) in mpi_write_to_sgl()
376 nents = sg_nents_for_len(sgl, nbytes); in mpi_write_to_sgl()
385 while (nbytes > n) { in mpi_write_to_sgl()
386 i = min_t(unsigned, nbytes - n, buf_len); in mpi_write_to_sgl()
389 nbytes -= i; in mpi_write_to_sgl()
437 MPI mpi_read_raw_from_sgl(struct scatterlist *sgl, unsigned int nbytes) in mpi_read_raw_from_sgl() argument
447 ents = sg_nents_for_len(sgl, nbytes); in mpi_read_raw_from_sgl()
455 while (nbytes > 0) { in mpi_read_raw_from_sgl()
469 nbytes -= lzeros; in mpi_read_raw_from_sgl()
475 nbytes -= lzeros; in mpi_read_raw_from_sgl()
476 nbits = nbytes * 8; in mpi_read_raw_from_sgl()
483 if (nbytes > 0) in mpi_read_raw_from_sgl()
488 nlimbs = DIV_ROUND_UP(nbytes, BYTES_PER_MPI_LIMB); in mpi_read_raw_from_sgl()
497 if (nbytes == 0) in mpi_read_raw_from_sgl()
502 z = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB; in mpi_read_raw_from_sgl()
507 len = min_t(unsigned, miter.length, nbytes); in mpi_read_raw_from_sgl()
508 nbytes -= len; in mpi_read_raw_from_sgl()