Home
last modified time | relevance | path

Searched refs:key (Results 1 – 25 of 84) sorted by relevance

1234

/crypto/
Dtestmgr.h39 const char *key; member
67 const char *key; member
108 const char *key; member
125 const char *key; member
152 const unsigned char *key; member
187 .key =
230 .key =
297 .key =
405 .key =
449 .key =
[all …]
Drsa_helper.c19 struct rsa_key *key = context; in rsa_get_n() local
40 key->n = value; in rsa_get_n()
41 key->n_sz = vlen; in rsa_get_n()
49 struct rsa_key *key = context; in rsa_get_e() local
52 if (!value || !key->n_sz || !vlen || vlen > key->n_sz) in rsa_get_e()
55 key->e = value; in rsa_get_e()
56 key->e_sz = vlen; in rsa_get_e()
64 struct rsa_key *key = context; in rsa_get_d() local
67 if (!value || !key->n_sz || !vlen || vlen > key->n_sz) in rsa_get_d()
70 key->d = value; in rsa_get_d()
[all …]
Dnhpoly1305.c42 static void nh_generic(const u32 *key, const u8 *message, size_t message_len, in nh_generic() argument
56 sums[0] += (u64)(u32)(m0 + key[ 0]) * (u32)(m2 + key[ 2]); in nh_generic()
57 sums[1] += (u64)(u32)(m0 + key[ 4]) * (u32)(m2 + key[ 6]); in nh_generic()
58 sums[2] += (u64)(u32)(m0 + key[ 8]) * (u32)(m2 + key[10]); in nh_generic()
59 sums[3] += (u64)(u32)(m0 + key[12]) * (u32)(m2 + key[14]); in nh_generic()
60 sums[0] += (u64)(u32)(m1 + key[ 1]) * (u32)(m3 + key[ 3]); in nh_generic()
61 sums[1] += (u64)(u32)(m1 + key[ 5]) * (u32)(m3 + key[ 7]); in nh_generic()
62 sums[2] += (u64)(u32)(m1 + key[ 9]) * (u32)(m3 + key[11]); in nh_generic()
63 sums[3] += (u64)(u32)(m1 + key[13]) * (u32)(m3 + key[15]); in nh_generic()
64 key += NH_MESSAGE_UNIT / sizeof(key[0]); in nh_generic()
[all …]
Drsa.c31 static int _rsa_enc(const struct rsa_mpi_key *key, MPI c, MPI m) in _rsa_enc() argument
34 if (mpi_cmp_ui(m, 0) < 0 || mpi_cmp(m, key->n) >= 0) in _rsa_enc()
38 return mpi_powm(c, m, key->e, key->n); in _rsa_enc()
48 static int _rsa_dec_crt(const struct rsa_mpi_key *key, MPI m_or_m1_or_h, MPI c) in _rsa_dec_crt() argument
54 if (mpi_cmp_ui(c, 0) < 0 || mpi_cmp(c, key->n) >= 0) in _rsa_dec_crt()
63 ret = mpi_powm(m_or_m1_or_h, c, key->dp, key->p); in _rsa_dec_crt()
68 ret = mpi_powm(m2, c, key->dq, key->q); in _rsa_dec_crt()
74 mpi_mulm(m_or_m1_or_h, m12_or_qh, key->qinv, key->p); in _rsa_dec_crt()
77 mpi_mul(m12_or_qh, key->q, m_or_m1_or_h); in _rsa_dec_crt()
78 mpi_addm(m_or_m1_or_h, m2, m12_or_qh, key->n); in _rsa_dec_crt()
[all …]
Dcast6_generic.c93 static inline void W(u32 *key, unsigned int i) in W() argument
96 key[6] ^= F1(key[7], Tr[i % 4][0], Tm[i][0]); in W()
97 key[5] ^= F2(key[6], Tr[i % 4][1], Tm[i][1]); in W()
98 key[4] ^= F3(key[5], Tr[i % 4][2], Tm[i][2]); in W()
99 key[3] ^= F1(key[4], Tr[i % 4][3], Tm[i][3]); in W()
100 key[2] ^= F2(key[3], Tr[i % 4][4], Tm[i][4]); in W()
101 key[1] ^= F3(key[2], Tr[i % 4][5], Tm[i][5]); in W()
102 key[0] ^= F1(key[1], Tr[i % 4][6], Tm[i][6]); in W()
103 key[7] ^= F2(key[0], Tr[i % 4][7], Tm[i][7]); in W()
109 u32 key[8]; in __cast6_setkey() local
[all …]
Dtwofish_common.c469 if (key[i]) { \
470 tmp = poly_to_exp[key[i] - 1]; \
530 mds[0][q0[a ^ key[(j) + 8]] ^ key[j]] \
531 ^ mds[1][q0[b ^ key[(j) + 9]] ^ key[(j) + 1]] \
532 ^ mds[2][q1[c ^ key[(j) + 10]] ^ key[(j) + 2]] \
533 ^ mds[3][q1[d ^ key[(j) + 11]] ^ key[(j) + 3]]
543 CALC_K_2 (q0[a ^ key[(j) + 16]], \
544 q1[b ^ key[(j) + 17]], \
545 q0[c ^ key[(j) + 18]], \
546 q1[d ^ key[(j) + 19]], j)
[all …]
Dcrc32c_generic.c45 u32 key; member
62 ctx->crc = mctx->key; in chksum_init()
72 static int chksum_setkey(struct crypto_shash *tfm, const u8 *key, in chksum_setkey() argument
77 if (keylen != sizeof(mctx->key)) in chksum_setkey()
79 mctx->key = get_unaligned_le32(key); in chksum_setkey()
119 return __chksum_finup(&mctx->key, data, length, out); in chksum_digest()
126 mctx->key = ~0; in crc32c_cra_init()
Daria_generic.c30 const __be32 *key = (const __be32 *)in_key; in aria_set_encrypt_key() local
38 w0[0] = be32_to_cpu(key[0]); in aria_set_encrypt_key()
39 w0[1] = be32_to_cpu(key[1]); in aria_set_encrypt_key()
40 w0[2] = be32_to_cpu(key[2]); in aria_set_encrypt_key()
41 w0[3] = be32_to_cpu(key[3]); in aria_set_encrypt_key()
51 w1[0] = be32_to_cpu(key[4]); in aria_set_encrypt_key()
52 w1[1] = be32_to_cpu(key[5]); in aria_set_encrypt_key()
54 w1[2] = be32_to_cpu(key[6]); in aria_set_encrypt_key()
55 w1[3] = be32_to_cpu(key[7]); in aria_set_encrypt_key()
192 u32 key[][ARIA_RD_KEY_WORDS]) in __aria_crypt()
[all …]
Ddh.c86 ctx->xa = mpi_read_raw_data(params.key, params.key_size); in dh_set_secret()
350 __be64 *key; in dh_safe_prime_gen_privkey() local
379 key = kmalloc(oversampling_size, GFP_KERNEL); in dh_safe_prime_gen_privkey()
380 if (!key) in dh_safe_prime_gen_privkey()
391 err = crypto_rng_get_bytes(crypto_default_rng, (u8 *)key, in dh_safe_prime_gen_privkey()
425 h = be64_to_cpu(key[0]); in dh_safe_prime_gen_privkey()
426 h = __add_u64_to_be(key + 1, n, h); in dh_safe_prime_gen_privkey()
427 h = __add_u64_to_be(key + 1, n, h); in dh_safe_prime_gen_privkey()
431 o = __add_u64_to_be(key + 1, n, 1); in dh_safe_prime_gen_privkey()
439 key[n] = cpu_to_be64(1); in dh_safe_prime_gen_privkey()
[all …]
Dcipher.c20 static int setkey_unaligned(struct crypto_cipher *tfm, const u8 *key, in setkey_unaligned() argument
35 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
44 const u8 *key, unsigned int keylen) in crypto_cipher_setkey() argument
52 if ((unsigned long)key & alignmask) in crypto_cipher_setkey()
53 return setkey_unaligned(tfm, key, keylen); in crypto_cipher_setkey()
55 return cia->cia_setkey(crypto_cipher_tfm(tfm), key, keylen); in crypto_cipher_setkey()
Daegis.h34 const union aegis_block *key,
62 const union aegis_block *key) in crypto_aegis_aesenc() argument
73 dst->words32[0] = cpu_to_le32(d0) ^ key->words32[0]; in crypto_aegis_aesenc()
74 dst->words32[1] = cpu_to_le32(d1) ^ key->words32[1]; in crypto_aegis_aesenc()
75 dst->words32[2] = cpu_to_le32(d2) ^ key->words32[2]; in crypto_aegis_aesenc()
76 dst->words32[3] = cpu_to_le32(d3) ^ key->words32[3]; in crypto_aegis_aesenc()
Dfips140-selftests.c65 const u8 *key; member
79 const u8 *key; member
90 const u8 *key; member
208 err = aes_expandkey(&ctx, vec->key, vec->key_size); in fips_test_aes_library()
264 err = crypto_skcipher_setkey(tfm, vec->key, vec->key_size); in fips_test_skcipher()
347 err = crypto_aead_setkey(tfm, vec->key, vec->key_size); in fips_test_aead()
427 if (vec->key) { in fips_test_hash()
428 err = crypto_shash_setkey(tfm, vec->key, vec->key_size); in fips_test_hash()
578 .key = fips_aes_key,
615 .key = fips_aes_key,
[all …]
Dtea.c46 const __le32 *key = (const __le32 *)in_key; in tea_setkey() local
48 ctx->KEY[0] = le32_to_cpu(key[0]); in tea_setkey()
49 ctx->KEY[1] = le32_to_cpu(key[1]); in tea_setkey()
50 ctx->KEY[2] = le32_to_cpu(key[2]); in tea_setkey()
51 ctx->KEY[3] = le32_to_cpu(key[3]); in tea_setkey()
119 const __le32 *key = (const __le32 *)in_key; in xtea_setkey() local
121 ctx->KEY[0] = le32_to_cpu(key[0]); in xtea_setkey()
122 ctx->KEY[1] = le32_to_cpu(key[1]); in xtea_setkey()
123 ctx->KEY[2] = le32_to_cpu(key[2]); in xtea_setkey()
124 ctx->KEY[3] = le32_to_cpu(key[3]); in xtea_setkey()
Dansi_cprng.c277 const unsigned char *key, size_t klen, in reset_prng_context() argument
286 prng_key = (key != NULL) ? key : (unsigned char *)DEFAULT_PRNG_KEY; in reset_prng_context()
288 if (!key) in reset_prng_context()
368 const u8 *key = seed + DEFAULT_BLK_SZ; in cprng_reset() local
375 dt = key + DEFAULT_PRNG_KSZ; in cprng_reset()
377 reset_prng_context(prng, key, DEFAULT_PRNG_KSZ, seed, dt); in cprng_reset()
398 const u8 *key = seed + DEFAULT_BLK_SZ; in fips_cprng_reset() local
407 if (!memcmp(seed, key, DEFAULT_PRNG_KSZ)) in fips_cprng_reset()
Dblowfish_common.c344 int blowfish_setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in blowfish_setkey() argument
363 temp = (((u32)key[j] << 24) | in blowfish_setkey()
364 ((u32)key[(j + 1) % keylen] << 16) | in blowfish_setkey()
365 ((u32)key[(j + 2) % keylen] << 8) | in blowfish_setkey()
366 ((u32)key[(j + 3) % keylen])); in blowfish_setkey()
Dcrc32_generic.c24 u32 *key = crypto_tfm_ctx(tfm); in crc32_cra_init() local
26 *key = 0; in crc32_cra_init()
36 static int crc32_setkey(struct crypto_shash *hash, const u8 *key, in crc32_setkey() argument
43 *mctx = get_unaligned_le32(key); in crc32_setkey()
Daegis128-core.c36 union aegis_block key; member
99 const union aegis_block *key, in crypto_aegis128_init() argument
105 key_iv = *key; in crypto_aegis128_init()
111 state->blocks[3] = *key; in crypto_aegis128_init()
112 state->blocks[4] = *key; in crypto_aegis128_init()
118 crypto_aegis128_update_a(state, key, false); in crypto_aegis128_init()
366 static int crypto_aegis128_setkey(struct crypto_aead *aead, const u8 *key, in crypto_aegis128_setkey() argument
374 memcpy(ctx->key.bytes, key, AEGIS128_KEY_SIZE); in crypto_aegis128_setkey()
399 crypto_aegis128_init(&state, &ctx->key, req->iv); in crypto_aegis128_encrypt_generic()
425 crypto_aegis128_init(&state, &ctx->key, req->iv); in crypto_aegis128_decrypt_generic()
[all …]
/crypto/asymmetric_keys/
Drestrict.c70 int restrict_link_by_signature(struct key *dest_keyring, in restrict_link_by_signature()
73 struct key *trust_keyring) in restrict_link_by_signature()
76 struct key *key; in restrict_link_by_signature() local
97 key = find_asymmetric_key(trust_keyring, in restrict_link_by_signature()
100 if (IS_ERR(key)) in restrict_link_by_signature()
103 if (use_builtin_keys && !test_bit(KEY_FLAG_BUILTIN, &key->flags)) in restrict_link_by_signature()
106 ret = verify_signature(key, sig); in restrict_link_by_signature()
107 key_put(key); in restrict_link_by_signature()
118 static int key_or_keyring_common(struct key *dest_keyring, in key_or_keyring_common()
121 struct key *trusted, bool check_dest) in key_or_keyring_common()
[all …]
Dasymmetric_type.c52 struct key *find_asymmetric_key(struct key *keyring, in find_asymmetric_key()
58 struct key *key; in find_asymmetric_key() local
116 key = key_ref_to_ptr(ref); in find_asymmetric_key()
118 const struct asymmetric_key_ids *kids = asymmetric_key_ids(key); in find_asymmetric_key()
130 pr_devel("<==%s() = 0 [%x]\n", __func__, key_serial(key)); in find_asymmetric_key()
131 return key; in find_asymmetric_key()
134 key_put(key); in find_asymmetric_key()
262 static bool asymmetric_key_cmp(const struct key *key, in asymmetric_key_cmp() argument
265 const struct asymmetric_key_ids *kids = asymmetric_key_ids(key); in asymmetric_key_cmp()
275 static bool asymmetric_key_cmp_partial(const struct key *key, in asymmetric_key_cmp_partial() argument
[all …]
Dpkcs7_trust.c24 struct key *trust_keyring) in pkcs7_validate_trust_one()
28 struct key *key; in pkcs7_validate_trust_one() local
50 key = find_asymmetric_key(trust_keyring, in pkcs7_validate_trust_one()
52 if (!IS_ERR(key)) { in pkcs7_validate_trust_one()
59 sinfo->index, x509->index, key_serial(key)); in pkcs7_validate_trust_one()
62 if (key == ERR_PTR(-ENOMEM)) in pkcs7_validate_trust_one()
82 key = find_asymmetric_key(trust_keyring, in pkcs7_validate_trust_one()
86 if (!IS_ERR(key)) { in pkcs7_validate_trust_one()
89 sinfo->index, x509->index, key_serial(key)); in pkcs7_validate_trust_one()
92 if (PTR_ERR(key) != -ENOKEY) in pkcs7_validate_trust_one()
[all …]
Dpublic_key.c31 static void public_key_describe(const struct key *asymmetric_key, in public_key_describe()
34 struct public_key *key = asymmetric_key->payload.data[asym_crypto]; in public_key_describe() local
36 if (key) in public_key_describe()
37 seq_printf(m, "%s.%s", key->id_type, key->pkey_algo); in public_key_describe()
43 void public_key_free(struct public_key *key) in public_key_free() argument
45 if (key) { in public_key_free()
46 kfree(key->key); in public_key_free()
47 kfree(key->params); in public_key_free()
48 kfree(key); in public_key_free()
155 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query()
[all …]
Dsignature.c46 struct key *key = params->key; in query_asymmetric_key() local
51 if (key->type != &key_type_asymmetric) in query_asymmetric_key()
53 subtype = asymmetric_key_subtype(key); in query_asymmetric_key()
55 !key->payload.data[0]) in query_asymmetric_key()
137 int verify_signature(const struct key *key, in verify_signature() argument
145 if (key->type != &key_type_asymmetric) in verify_signature()
147 subtype = asymmetric_key_subtype(key); in verify_signature()
149 !key->payload.data[0]) in verify_signature()
154 ret = subtype->verify_signature(key, sig); in verify_signature()
DKconfig3 bool "Asymmetric (public-key cryptographic) key type"
6 This option provides support for a key type that holds the data for
7 the asymmetric keys used for public key cryptographic operations such
14 tristate "Asymmetric public-key crypto algorithm subtype"
20 This option provides support for asymmetric public key type handling.
31 This option provides support for parsing X.509 format blobs for key
32 data and provides the ability to instantiate a crypto key from a
33 public key packet found inside the certificate.
36 tristate "PKCS#8 private key parser"
42 private key data and provides the ability to instantiate a crypto key
[all …]
Dx509_loader.c9 const struct key *keyring) in x509_load_certificate_list()
11 key_ref_t key; in x509_load_certificate_list() local
31 key = key_create_or_update(make_key_ref(keyring, 1), in x509_load_certificate_list()
41 if (IS_ERR(key)) { in x509_load_certificate_list()
43 PTR_ERR(key)); in x509_load_certificate_list()
46 key_ref_to_ptr(key)->description); in x509_load_certificate_list()
47 key_ref_put(key); in x509_load_certificate_list()
Dpkcs8_parser.c26 const void *key; member
89 ctx->key = value; in pkcs8_note_key()
119 pub->key = kmemdup(ctx.key, ctx.key_size, GFP_KERNEL); in pkcs8_parse()
120 if (!pub->key) in pkcs8_parse()

1234