Lines Matching defs:seed

127  *   'evpmd' digest, 'p' prime, 'e' cofactor, gindex and seed.
135 int gindex, unsigned char *seed, size_t seedlen)
160 * W = Hash(seed || "ggen" || index || counter)
169 || !EVP_DigestUpdate(mctx, seed, seedlen)
231 /* seed_tmp buffer contains "seed + offset - 1" */
233 /* obtain "seed + offset + j" by incrementing by 1: */
242 * tmp = V(j) = Hash((seed + offset + j) % 2^seedlen)
314 int qsize, unsigned char *seed, size_t seedlen,
330 /* A.1.1.2 Step (5) : generate seed with size seed_len */
332 && RAND_bytes_ex(libctx, seed, seedlen, 0) <= 0)
337 * U = Hash(seed) % (2^(N-1))
339 if (!EVP_Digest(seed, seedlen, md, NULL, evpmd, NULL))
370 * A.1.1.3 Step (9) : If the provided seed didn't produce a prime q
387 unsigned char *buf, unsigned char *seed,
402 if (generate_seed && RAND_bytes_ex(libctx, seed, qsize, 0) <= 0)
405 memcpy(buf, seed, qsize);
406 memcpy(buf2, seed, qsize);
416 if (!EVP_Digest(seed, qsize, md, NULL, evpmd, NULL))
473 * the seed and index used during generation as input.
485 * - If the seed is passed in then generation of p & q uses this seed (and if
487 * - Otherwise the seed is generated, and values of p & q are generated and
488 * the value of seed and counter are optionally returned.
490 * - If the seed has been generated or passed in and a valid gindex is passed
494 * - p, q, and the seed and counter used for generation must be passed in.
497 * - For a canonical validation : the gindex and seed used for generation are
519 unsigned char *seed = NULL, *seed_tmp = NULL;
587 /* If the seed was passed in - use this value as the seed */
588 if (params->seed != NULL)
589 seed = params->seed;
598 /* Validation of p,q requires seed and counter to be valid */
600 if (seed == NULL || params->pcounter < 0) {
647 if (seed == NULL) {
648 /* Validation requires the seed to be supplied */
653 /* if the seed is not supplied then alloc a seed buffer */
654 seed = OPENSSL_malloc(seedlen);
655 if (seed == NULL)
683 if (!generate_q_fips186_4(ctx, q, md, qsize, seed, seedlen,
684 seed != params->seed, &m, res, cb))
696 memcpy(seed_tmp, seed, seedlen);
705 * If we get here we failed to get a p for the given seed. If the
706 * seed is not random then it needs to fail (as it will always fail).
708 if (seed == params->seed) {
745 /* Canonical g requires a seed and index to be set */
746 if ((seed != NULL) && (params->gindex != FFC_UNVERIFIABLE_GINDEX)) {
749 params->gindex, seed, seedlen)) {
781 if (!ossl_ffc_params_set_validate_params(params, seed, seedlen,
793 if (seed != params->seed)
794 OPENSSL_free(seed);
812 unsigned char seed[SHA256_DIGEST_LENGTH];
823 unsigned char *seed_in = params->seed;
873 /* Only consume as much seed as is expected. */
876 memcpy(seed, seed_in, seed_len);
905 /* Validation of p,q requires seed and counter to be valid */
930 if (!generate_q_fips186_2(ctx, q, md, buf, seed, qsize,
1018 if (!ossl_ffc_params_set_validate_params(params, seed, qsize, pcounter))