/crypto/ |
D | testmgr.h | 38 const char *key; member 65 const char *key; member 106 const char *key; member 123 const char *key; member 150 const unsigned char *key; member 185 .key = 215 .key = 259 .key = 324 .key = 368 .key = [all …]
|
D | rsa_helper.c | 19 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 …]
|
D | nhpoly1305.c | 42 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 …]
|
D | cast6_generic.c | 93 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 …]
|
D | rsa.c | 25 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 …]
|
D | twofish_common.c | 469 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 …]
|
D | crc32c_generic.c | 45 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()
|
D | salsa20_generic.c | 111 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()
|
D | cipher.c | 20 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()
|
D | aegis.h | 43 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()
|
D | fips140-selftests.c | 65 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 …]
|
D | tea.c | 46 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()
|
D | aegis128-core.c | 36 union aegis_block key; member 64 const union aegis_block *key, 110 const union aegis_block *key, in crypto_aegis128_init() argument 116 key_iv = *key; in crypto_aegis128_init() 122 state->blocks[3] = *key; in crypto_aegis128_init() 123 state->blocks[4] = *key; in crypto_aegis128_init() 129 crypto_aegis128_update_a(state, key); in crypto_aegis128_init() 370 static int crypto_aegis128_setkey(struct crypto_aead *aead, const u8 *key, in crypto_aegis128_setkey() argument 378 memcpy(ctx->key.bytes, key, AEGIS128_KEY_SIZE); in crypto_aegis128_setkey() 404 crypto_aegis128_init_simd(&state, &ctx->key, req->iv); in crypto_aegis128_encrypt() [all …]
|
D | ansi_cprng.c | 277 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()
|
D | blowfish_common.c | 344 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()
|
D | camellia_generic.c | 545 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 …]
|
D | crc32_generic.c | 46 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 65 *mctx = get_unaligned_le32(key); in crc32_setkey()
|
D | ecrdsa.c | 42 const char *key; /* raw public key */ member 179 ctx->key = value; in ecrdsa_parse_pub_key() 191 static int ecrdsa_set_pub_key(struct crypto_akcipher *tfm, const void *key, in ecrdsa_set_pub_key() argument 200 err = asn1_ber_decoder(&ecrdsa_pub_key_decoder, ctx, key, keylen); in ecrdsa_set_pub_key() 206 ecrdsa_unpack_u32(&algo, (u8 *)key + keylen)); in ecrdsa_set_pub_key() 242 vli_from_le64(ctx->pub_key.x, ctx->key, ndigits); in ecrdsa_set_pub_key() 243 vli_from_le64(ctx->pub_key.y, ctx->key + ndigits * sizeof(u64), in ecrdsa_set_pub_key()
|
/crypto/asymmetric_keys/ |
D | restrict.c | 70 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 …]
|
D | asymmetric_type.c | 46 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 …]
|
D | pkcs7_trust.c | 24 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 …]
|
D | public_key.c | 30 static void public_key_describe(const struct key *asymmetric_key, in public_key_describe() 33 struct public_key *key = asymmetric_key->payload.data[asym_crypto]; in public_key_describe() local 35 if (key) in public_key_describe() 36 seq_printf(m, "%s.%s", key->id_type, key->pkey_algo); in public_key_describe() 42 void public_key_free(struct public_key *key) in public_key_free() argument 44 if (key) { in public_key_free() 45 kfree(key->key); in public_key_free() 46 kfree(key->params); in public_key_free() 47 kfree(key); in public_key_free() 109 struct public_key *pkey = params->key->payload.data[asym_crypto]; in software_key_query() [all …]
|
D | Kconfig | 3 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 …]
|
D | signature.c | 46 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()
|
D | pkcs8_parser.c | 26 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()
|