Lines Matching defs:key
31 * If base is g we compute the public key
33 * else if base if the counterpart public key we compute the shared secret
77 /* Free the old MPI key if any */
86 ctx->xa = mpi_read_raw_data(params.key, params.key_size);
98 * SP800-56A public key verification:
228 /* SP800-56A rev 3 5.6.2.1.3 key check */
354 __be64 *key;
359 * Generate a private key following NIST SP800-56Ar3,
362 * 5.6.1.1.1: choose key length N such that
383 key = kmalloc(oversampling_size, GFP_KERNEL);
384 if (!key)
395 err = crypto_rng_get_bytes(crypto_default_rng, (u8 *)key,
406 * key = (key[] mod (M - 1)) + 1 = (key[] mod (2^N - 1)) + 1.
411 * The big endian integer key[] composed of n + 1 64bit words
412 * may be written as key[] = h * 2^N + l, with h = key[0]
429 h = be64_to_cpu(key[0]);
430 h = __add_u64_to_be(key + 1, n, h);
431 h = __add_u64_to_be(key + 1, n, h);
435 o = __add_u64_to_be(key + 1, n, 1);
438 * one. If zero, key[1:n] holds the final result in big-endian
439 * order. If one, key[1:n] is zero now, but needs to be set to
443 key[n] = cpu_to_be64(1);
448 memmove(key, &key[1], *key_size);
450 return key;
453 kfree_sensitive(key);
464 void *buf = NULL, *key = NULL;
482 key = dh_safe_prime_gen_privkey(inst_ctx->safe_prime,
484 if (IS_ERR(key))
485 return PTR_ERR(key);
486 params.key = key;
503 kfree_sensitive(key);