Home
last modified time | relevance | path

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

1234

/crypto/
Dtestmgr.h38 const char *key; member
65 const char *key; member
100 const char *key; member
117 const char *key; member
144 const unsigned char *key; member
179 .key =
209 .key =
253 .key =
318 .key =
362 .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.c41 static void nh_generic(const u32 *key, const u8 *message, size_t message_len, in nh_generic() argument
55 sums[0] += (u64)(u32)(m0 + key[ 0]) * (u32)(m2 + key[ 2]); in nh_generic()
56 sums[1] += (u64)(u32)(m0 + key[ 4]) * (u32)(m2 + key[ 6]); in nh_generic()
57 sums[2] += (u64)(u32)(m0 + key[ 8]) * (u32)(m2 + key[10]); in nh_generic()
58 sums[3] += (u64)(u32)(m0 + key[12]) * (u32)(m2 + key[14]); in nh_generic()
59 sums[0] += (u64)(u32)(m1 + key[ 1]) * (u32)(m3 + key[ 3]); in nh_generic()
60 sums[1] += (u64)(u32)(m1 + key[ 5]) * (u32)(m3 + key[ 7]); in nh_generic()
61 sums[2] += (u64)(u32)(m1 + key[ 9]) * (u32)(m3 + key[11]); in nh_generic()
62 sums[3] += (u64)(u32)(m1 + key[13]) * (u32)(m3 + key[15]); in nh_generic()
63 key += NH_MESSAGE_UNIT / sizeof(key[0]); in nh_generic()
[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()
110 u32 key[8]; in __cast6_setkey() local
[all …]
Drsa.c25 static int _rsa_enc(const struct rsa_mpi_key *key, MPI c, MPI m) in _rsa_enc() argument
28 if (mpi_cmp_ui(m, 0) < 0 || mpi_cmp(m, key->n) >= 0) in _rsa_enc()
32 return mpi_powm(c, m, key->e, key->n); in _rsa_enc()
39 static int _rsa_dec(const struct rsa_mpi_key *key, MPI m, MPI c) in _rsa_dec() argument
42 if (mpi_cmp_ui(c, 0) < 0 || mpi_cmp(c, key->n) >= 0) in _rsa_dec()
46 return mpi_powm(m, c, key->d, key->n); in _rsa_dec()
131 static void rsa_free_mpi_key(struct rsa_mpi_key *key) in rsa_free_mpi_key() argument
133 mpi_free(key->d); in rsa_free_mpi_key()
134 mpi_free(key->e); in rsa_free_mpi_key()
135 mpi_free(key->n); in rsa_free_mpi_key()
[all …]
Dchacha_generic.c65 state[4] = ctx->key[0]; in crypto_chacha_init()
66 state[5] = ctx->key[1]; in crypto_chacha_init()
67 state[6] = ctx->key[2]; in crypto_chacha_init()
68 state[7] = ctx->key[3]; in crypto_chacha_init()
69 state[8] = ctx->key[4]; in crypto_chacha_init()
70 state[9] = ctx->key[5]; in crypto_chacha_init()
71 state[10] = ctx->key[6]; in crypto_chacha_init()
72 state[11] = ctx->key[7]; in crypto_chacha_init()
80 static int chacha_setkey(struct crypto_skcipher *tfm, const u8 *key, in chacha_setkey() argument
89 for (i = 0; i < ARRAY_SIZE(ctx->key); i++) in chacha_setkey()
[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()
81 mctx->key = get_unaligned_le32(key); in chksum_setkey()
121 return __chksum_finup(&mctx->key, data, length, out); in chksum_digest()
128 mctx->key = ~0; in crc32c_cra_init()
Dsalsa20_generic.c111 static int salsa20_setkey(struct crypto_skcipher *tfm, const u8 *key, in salsa20_setkey() argument
123 ctx->initial_state[1] = get_unaligned_le32(key + 0); in salsa20_setkey()
124 ctx->initial_state[2] = get_unaligned_le32(key + 4); in salsa20_setkey()
125 ctx->initial_state[3] = get_unaligned_le32(key + 8); in salsa20_setkey()
126 ctx->initial_state[4] = get_unaligned_le32(key + 12); in salsa20_setkey()
128 key += 16; in salsa20_setkey()
133 ctx->initial_state[11] = get_unaligned_le32(key + 0); in salsa20_setkey()
134 ctx->initial_state[12] = get_unaligned_le32(key + 4); in salsa20_setkey()
135 ctx->initial_state[13] = get_unaligned_le32(key + 8); in salsa20_setkey()
136 ctx->initial_state[14] = get_unaligned_le32(key + 12); in salsa20_setkey()
Dpoly1305_generic.c50 void poly1305_core_setkey(struct poly1305_key *key, const u8 *raw_key) in poly1305_core_setkey() argument
53 key->r[0] = (get_unaligned_le32(raw_key + 0) >> 0) & 0x3ffffff; in poly1305_core_setkey()
54 key->r[1] = (get_unaligned_le32(raw_key + 3) >> 2) & 0x3ffff03; in poly1305_core_setkey()
55 key->r[2] = (get_unaligned_le32(raw_key + 6) >> 4) & 0x3ffc0ff; in poly1305_core_setkey()
56 key->r[3] = (get_unaligned_le32(raw_key + 9) >> 6) & 0x3f03fff; in poly1305_core_setkey()
57 key->r[4] = (get_unaligned_le32(raw_key + 12) >> 8) & 0x00fffff; in poly1305_core_setkey()
91 const struct poly1305_key *key, in poly1305_blocks_internal() argument
103 r0 = key->r[0]; in poly1305_blocks_internal()
104 r1 = key->r[1]; in poly1305_blocks_internal()
105 r2 = key->r[2]; in poly1305_blocks_internal()
[all …]
Dcipher.c19 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
34 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
42 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
53 if ((unsigned long)key & alignmask) in setkey()
54 return setkey_unaligned(tfm, key, keylen); in setkey()
56 return cia->cia_setkey(tfm, key, keylen); in setkey()
Daegis.h43 const union aegis_block *key) in crypto_aegis_aesenc() argument
54 dst->words32[0] = cpu_to_le32(d0) ^ key->words32[0]; in crypto_aegis_aesenc()
55 dst->words32[1] = cpu_to_le32(d1) ^ key->words32[1]; in crypto_aegis_aesenc()
56 dst->words32[2] = cpu_to_le32(d2) ^ key->words32[2]; in crypto_aegis_aesenc()
57 dst->words32[3] = cpu_to_le32(d3) ^ key->words32[3]; in crypto_aegis_aesenc()
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.c276 const unsigned char *key, size_t klen, in reset_prng_context() argument
285 prng_key = (key != NULL) ? key : (unsigned char *)DEFAULT_PRNG_KEY; in reset_prng_context()
287 if (!key) in reset_prng_context()
367 const u8 *key = seed + DEFAULT_BLK_SZ; in cprng_reset() local
374 dt = key + DEFAULT_PRNG_KSZ; in cprng_reset()
376 reset_prng_context(prng, key, DEFAULT_PRNG_KSZ, seed, dt); in cprng_reset()
397 const u8 *key = seed + DEFAULT_BLK_SZ; in fips_cprng_reset() local
406 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()
Dcamellia_generic.c545 static void camellia_setup128(const unsigned char *key, u32 *subkey) in camellia_setup128() argument
555 kll = get_unaligned_be32(key); in camellia_setup128()
556 klr = get_unaligned_be32(key + 4); in camellia_setup128()
557 krl = get_unaligned_be32(key + 8); in camellia_setup128()
558 krr = get_unaligned_be32(key + 12); in camellia_setup128()
651 static void camellia_setup256(const unsigned char *key, u32 *subkey) in camellia_setup256() argument
663 kll = get_unaligned_be32(key); in camellia_setup256()
664 klr = get_unaligned_be32(key + 4); in camellia_setup256()
665 krl = get_unaligned_be32(key + 8); in camellia_setup256()
666 krr = get_unaligned_be32(key + 12); in camellia_setup256()
[all …]
Dcrc32_generic.c46 u32 *key = crypto_tfm_ctx(tfm); in crc32_cra_init() local
48 *key = 0; in crc32_cra_init()
58 static int crc32_setkey(struct crypto_shash *hash, const u8 *key, in crc32_setkey() argument
67 *mctx = get_unaligned_le32(key); in crc32_setkey()
Decrdsa.c41 const char *key; /* raw public key */ member
178 ctx->key = value; in ecrdsa_parse_pub_key()
190 static int ecrdsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, in ecrdsa_set_pub_key() argument
199 err = asn1_ber_decoder(&ecrdsa_pub_key_decoder, ctx, key, keylen); in ecrdsa_set_pub_key()
205 ecrdsa_unpack_u32(&algo, (u8 *)key + keylen)); in ecrdsa_set_pub_key()
241 vli_from_le64(ctx->pub_key.x, ctx->key, ndigits); in ecrdsa_set_pub_key()
242 vli_from_le64(ctx->pub_key.y, ctx->key + ndigits * sizeof(u64), in ecrdsa_set_pub_key()
/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 …]
Dpublic_key.c28 static void public_key_describe(const struct key *asymmetric_key, in public_key_describe()
31 struct public_key *key = asymmetric_key->payload.data[asym_crypto]; in public_key_describe() local
33 if (key) in public_key_describe()
34 seq_printf(m, "%s.%s", key->id_type, key->pkey_algo); in public_key_describe()
40 void public_key_free(struct public_key *key) in public_key_free() argument
42 if (key) { in public_key_free()
43 kfree(key->key); in public_key_free()
44 kfree(key->params); in public_key_free()
45 kfree(key); in public_key_free()
107 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query()
[all …]
Dasymmetric_type.c46 struct key *find_asymmetric_key(struct key *keyring, in find_asymmetric_key()
51 struct key *key; in find_asymmetric_key() local
103 key = key_ref_to_ptr(ref); in find_asymmetric_key()
105 const struct asymmetric_key_ids *kids = asymmetric_key_ids(key); in find_asymmetric_key()
117 pr_devel("<==%s() = 0 [%x]\n", __func__, key_serial(key)); in find_asymmetric_key()
118 return key; in find_asymmetric_key()
121 key_put(key); in find_asymmetric_key()
247 static bool asymmetric_key_cmp(const struct key *key, in asymmetric_key_cmp() argument
250 const struct asymmetric_key_ids *kids = asymmetric_key_ids(key); in asymmetric_key_cmp()
260 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 …]
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.
26 tristate "Asymmetric TPM backed private key subtype"
33 This option provides support for TPM backed private key type handling.
35 the TPM after the private key is loaded.
43 This option provides support for parsing X.509 format blobs for key
44 data and provides the ability to instantiate a crypto key from a
[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()
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