Lines Matching refs:buflen
49 static void mpi_export(void *buf, size_t buflen, const gcry_mpi_t x) { in mpi_export() argument
55 assert(len <= buflen); in mpi_export()
56 memzero(buf, buflen); in mpi_export()
57 gcry_mpi_print(GCRYMPI_FMT_USG, buf + (buflen - len), len, &nwritten, x); in mpi_export()
61 static gcry_mpi_t mpi_import(const void *buf, size_t buflen) { in mpi_import() argument
65 assert_se(gcry_mpi_scan(&h, GCRYMPI_FMT_USG, buf, buflen, NULL) == 0); in mpi_import()
67 assert(len <= buflen); in mpi_import()
73 static void uint64_export(void *buf, size_t buflen, uint64_t x) { in uint64_export() argument
74 assert(buflen == 8); in uint64_export()
85 _pure_ static uint64_t uint64_import(const void *buf, size_t buflen) { in uint64_import() argument
86 assert(buflen == 8); in uint64_import()
99 static void det_randomize(void *buf, size_t buflen, const void *seed, size_t seedlen, uint32_t idx)… in det_randomize() argument
114 for (ctr = 0; buflen; ctr++) { in det_randomize()
122 cpylen = (buflen < olen) ? buflen : olen; in det_randomize()
126 buflen -= cpylen; in det_randomize()
133 size_t buflen = bits / 8; in genprime3mod4() local
134 uint8_t buf[buflen]; in genprime3mod4()
138 assert(buflen > 0); in genprime3mod4()
140 det_randomize(buf, buflen, seed, seedlen, idx); in genprime3mod4()
142 buf[buflen - 1] |= 0x03; /* set lower two bits, to have result 3 (mod 4) */ in genprime3mod4()
144 p = mpi_import(buf, buflen); in genprime3mod4()
153 size_t buflen = secpar / 8; in gensquare() local
154 uint8_t buf[buflen]; in gensquare()
157 det_randomize(buf, buflen, seed, seedlen, idx); in gensquare()
159 x = mpi_import(buf, buflen); in gensquare()