Lines Matching defs:idx
93 /* deterministically generate from seed/idx a string of buflen pseudorandom bytes */
94 static void det_randomize(void *buf, size_t buflen, const void *seed, size_t seedlen, uint32_t idx) {
102 gcry_md_putc(hd, (idx >> 24) & 0xff);
103 gcry_md_putc(hd, (idx >> 16) & 0xff);
104 gcry_md_putc(hd, (idx >> 8) & 0xff);
105 gcry_md_putc(hd, (idx >> 0) & 0xff);
123 /* deterministically generate from seed/idx a prime of length `bits' that is 3 (mod 4) */
124 static gcry_mpi_t genprime3mod4(int bits, const void *seed, size_t seedlen, uint32_t idx) {
132 det_randomize(buf, buflen, seed, seedlen, idx);
143 /* deterministically generate from seed/idx a quadratic residue (mod n) */
144 static gcry_mpi_t gensquare(const gcry_mpi_t n, const void *seed, size_t seedlen, uint32_t idx, unsigned secpar) {
149 det_randomize(buf, buflen, seed, seedlen, idx);
380 void FSPRG_GetKey(const void *state, void *key, size_t keylen, uint32_t idx) {
386 det_randomize(key, keylen, state + 2, 2 * secpar / 8 + 8, idx);