Lines Matching refs:secpar

36 #define ISVALID_SECPAR(secpar) (((secpar) % 16 == 0) && ((secpar) >= 16) && ((secpar) <= 16384))  argument
37 #define VALIDATE_SECPAR(secpar) assert(ISVALID_SECPAR(secpar)); argument
152 …_t gensquare(const gcry_mpi_t n, const void *seed, size_t seedlen, uint32_t idx, unsigned secpar) { in gensquare() argument
153 size_t buflen = secpar / 8; in gensquare()
234 static void store_secpar(void *buf, uint16_t secpar) { in store_secpar() argument
235 secpar = secpar / 16 - 1; in store_secpar()
236 ((uint8_t*) buf)[0] = (secpar >> 8) & 0xff; in store_secpar()
237 ((uint8_t*) buf)[1] = (secpar >> 0) & 0xff; in store_secpar()
241 uint16_t secpar; in read_secpar() local
242 secpar = in read_secpar()
245 return 16 * (secpar + 1); in read_secpar()
251 uint16_t secpar; in FSPRG_GenMK() local
254 secpar = _secpar; in FSPRG_GenMK()
264 p = genprime3mod4(secpar / 2, seed, seedlen, RND_GEN_P); in FSPRG_GenMK()
265 q = genprime3mod4(secpar / 2, seed, seedlen, RND_GEN_Q); in FSPRG_GenMK()
268 store_secpar(msk + 0, secpar); in FSPRG_GenMK()
269 mpi_export(msk + 2 + 0 * (secpar / 2) / 8, (secpar / 2) / 8, p); in FSPRG_GenMK()
270 mpi_export(msk + 2 + 1 * (secpar / 2) / 8, (secpar / 2) / 8, q); in FSPRG_GenMK()
276 assert(gcry_mpi_get_nbits(n) == secpar); in FSPRG_GenMK()
278 store_secpar(mpk + 0, secpar); in FSPRG_GenMK()
279 mpi_export(mpk + 2, secpar / 8, n); in FSPRG_GenMK()
290 uint16_t secpar; in FSPRG_GenState0() local
294 secpar = read_secpar(mpk + 0); in FSPRG_GenState0()
295 n = mpi_import(mpk + 2, secpar / 8); in FSPRG_GenState0()
296 x = gensquare(n, seed, seedlen, RND_GEN_X, secpar); in FSPRG_GenState0()
298 memcpy(state, mpk, 2 + secpar / 8); in FSPRG_GenState0()
299 mpi_export(state + 2 + 1 * secpar / 8, secpar / 8, x); in FSPRG_GenState0()
300 memzero(state + 2 + 2 * secpar / 8, 8); in FSPRG_GenState0()
308 uint16_t secpar; in FSPRG_Evolve() local
313 secpar = read_secpar(state + 0); in FSPRG_Evolve()
314 n = mpi_import(state + 2 + 0 * secpar / 8, secpar / 8); in FSPRG_Evolve()
315 x = mpi_import(state + 2 + 1 * secpar / 8, secpar / 8); in FSPRG_Evolve()
316 epoch = uint64_import(state + 2 + 2 * secpar / 8, 8); in FSPRG_Evolve()
321 mpi_export(state + 2 + 1 * secpar / 8, secpar / 8, x); in FSPRG_Evolve()
322 uint64_export(state + 2 + 2 * secpar / 8, 8, epoch); in FSPRG_Evolve()
329 uint16_t secpar; in FSPRG_GetEpoch() local
330 secpar = read_secpar(state + 0); in FSPRG_GetEpoch()
331 return uint64_import(state + 2 + 2 * secpar / 8, 8); in FSPRG_GetEpoch()
336 uint16_t secpar; in FSPRG_Seek() local
340 secpar = read_secpar(msk + 0); in FSPRG_Seek()
341 p = mpi_import(msk + 2 + 0 * (secpar / 2) / 8, (secpar / 2) / 8); in FSPRG_Seek()
342 q = mpi_import(msk + 2 + 1 * (secpar / 2) / 8, (secpar / 2) / 8); in FSPRG_Seek()
347 x = gensquare(n, seed, seedlen, RND_GEN_X, secpar); in FSPRG_Seek()
358 store_secpar(state + 0, secpar); in FSPRG_Seek()
359 mpi_export(state + 2 + 0 * secpar / 8, secpar / 8, n); in FSPRG_Seek()
360 mpi_export(state + 2 + 1 * secpar / 8, secpar / 8, xm); in FSPRG_Seek()
361 uint64_export(state + 2 + 2 * secpar / 8, 8, epoch); in FSPRG_Seek()
375 uint16_t secpar; in FSPRG_GetKey() local
379 secpar = read_secpar(state + 0); in FSPRG_GetKey()
380 det_randomize(key, keylen, state + 2, 2 * secpar / 8 + 8, idx); in FSPRG_GetKey()