Home
last modified time | relevance | path

Searched refs:keylen (Results 1 – 25 of 313) sorted by relevance

12345678910>>...13

/kernel/linux/linux-5.10/include/crypto/
Dblake2s.h47 const void *key, size_t keylen) in __blake2s_init() argument
49 state->h[0] = BLAKE2S_IV0 ^ (0x01010000 | keylen << 8 | outlen); in __blake2s_init()
63 if (keylen) { in __blake2s_init()
64 memcpy(state->buf, key, keylen); in __blake2s_init()
65 memset(&state->buf[keylen], 0, BLAKE2S_BLOCK_SIZE - keylen); in __blake2s_init()
78 const size_t keylen) in blake2s_init_key() argument
81 !key || !keylen || keylen > BLAKE2S_KEY_SIZE)); in blake2s_init_key()
83 __blake2s_init(state, outlen, key, keylen); in blake2s_init_key()
91 const size_t keylen) in blake2s() argument
96 outlen > BLAKE2S_HASH_SIZE || keylen > BLAKE2S_KEY_SIZE || in blake2s()
[all …]
Dxts.h12 const u8 *key, unsigned int keylen) in xts_check_key() argument
18 if (keylen % 2) in xts_check_key()
22 if (fips_enabled && !crypto_memneq(key, key + (keylen / 2), keylen / 2)) in xts_check_key()
29 const u8 *key, unsigned int keylen) in xts_verify_key() argument
35 if (keylen % 2) in xts_verify_key()
41 !crypto_memneq(key, key + (keylen / 2), keylen / 2)) in xts_verify_key()
/kernel/linux/linux-5.10/drivers/staging/wlan-ng/
Dp80211wep.c67 int wep_change_key(struct wlandevice *wlandev, int keynum, u8 *key, int keylen) in wep_change_key() argument
69 if (keylen < 0) in wep_change_key()
71 if (keylen >= MAX_KEYLEN) in wep_change_key()
80 wlandev->wep_keylens[keynum] = keylen; in wep_change_key()
81 memcpy(wlandev->wep_keys[keynum], key, keylen); in wep_change_key()
93 u32 i, j, k, crc, keylen; in wep_decrypt() local
113 keylen = wlandev->wep_keylens[keyidx]; in wep_decrypt()
115 if (keylen == 0) in wep_decrypt()
119 memcpy(key + 3, wlandev->wep_keys[keyidx], keylen); in wep_decrypt()
121 keylen += 3; /* add in IV bytes */ in wep_decrypt()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/amcc/
Dcrypto4xx_alg.c123 unsigned int keylen, in crypto4xx_setkey_aes() argument
131 if (keylen != AES_KEYSIZE_256 && keylen != AES_KEYSIZE_192 && in crypto4xx_setkey_aes()
132 keylen != AES_KEYSIZE_128) in crypto4xx_setkey_aes()
139 rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4); in crypto4xx_setkey_aes()
161 key, keylen); in crypto4xx_setkey_aes()
162 sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); in crypto4xx_setkey_aes()
163 sa->sa_command_1.bf.key_len = keylen >> 3; in crypto4xx_setkey_aes()
178 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_cbc() argument
180 return crypto4xx_setkey_aes(cipher, key, keylen, CRYPTO_MODE_CBC, in crypto4xx_setkey_aes_cbc()
185 const u8 *key, unsigned int keylen) in crypto4xx_setkey_aes_cfb() argument
[all …]
/kernel/linux/linux-5.10/fs/cachefiles/
Dkey.c33 char *cachefiles_cook_key(const u8 *raw, int keylen, uint8_t type) in cachefiles_cook_key() argument
40 _enter(",%d", keylen); in cachefiles_cook_key()
42 BUG_ON(keylen < 2 || keylen > 514); in cachefiles_cook_key()
46 for (loop = 2; loop < keylen; loop++) { in cachefiles_cook_key()
54 max = keylen - 2; in cachefiles_cook_key()
63 keylen = (keylen + 2) / 3; in cachefiles_cook_key()
65 max = keylen * 4; in cachefiles_cook_key()
98 for (loop = keylen; loop > 0; loop--) { in cachefiles_cook_key()
117 for (loop = keylen; loop > 0; loop--) { in cachefiles_cook_key()
/kernel/linux/linux-5.10/fs/hfs/
Dbfind.c60 u16 off, len, keylen; in __hfs_brec_find() local
71 keylen = hfs_brec_keylen(bnode, rec); in __hfs_brec_find()
72 if (keylen == 0) { in __hfs_brec_find()
76 hfs_bnode_read(bnode, fd->key, off, keylen); in __hfs_brec_find()
90 keylen = hfs_brec_keylen(bnode, e); in __hfs_brec_find()
91 if (keylen == 0) { in __hfs_brec_find()
95 hfs_bnode_read(bnode, fd->key, off, keylen); in __hfs_brec_find()
100 fd->keylength = keylen; in __hfs_brec_find()
101 fd->entryoffset = off + keylen; in __hfs_brec_find()
102 fd->entrylength = len - keylen; in __hfs_brec_find()
[all …]
/kernel/linux/linux-5.10/crypto/
Dcipher.c20 unsigned int keylen) in setkey_unaligned() argument
28 absize = keylen + alignmask; in setkey_unaligned()
34 memcpy(alignbuffer, key, keylen); in setkey_unaligned()
35 ret = cia->cia_setkey(crypto_cipher_tfm(tfm), alignbuffer, keylen); in setkey_unaligned()
36 memset(alignbuffer, 0, keylen); in setkey_unaligned()
43 const u8 *key, unsigned int keylen) in crypto_cipher_setkey() argument
48 if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) in crypto_cipher_setkey()
52 return setkey_unaligned(tfm, key, keylen); in crypto_cipher_setkey()
54 return cia->cia_setkey(crypto_cipher_tfm(tfm), key, keylen); in crypto_cipher_setkey()
/kernel/linux/linux-5.10/fs/hfsplus/
Dbfind.c117 u16 off, len, keylen; in __hfs_brec_find() local
129 keylen = hfs_brec_keylen(bnode, rec); in __hfs_brec_find()
130 if (keylen == 0) { in __hfs_brec_find()
134 hfs_bnode_read(bnode, fd->key, off, keylen); in __hfs_brec_find()
143 keylen = hfs_brec_keylen(bnode, e); in __hfs_brec_find()
144 if (keylen == 0) { in __hfs_brec_find()
148 hfs_bnode_read(bnode, fd->key, off, keylen); in __hfs_brec_find()
154 fd->keylength = keylen; in __hfs_brec_find()
155 fd->entryoffset = off + keylen; in __hfs_brec_find()
156 fd->entrylength = len - keylen; in __hfs_brec_find()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/cavium/cpt/
Dcptvf_algs.c233 u32 keylen) in cvm_xts_setkey() argument
239 const u8 *key2 = key + (keylen / 2); in cvm_xts_setkey()
241 err = xts_check_key(tfm, key, keylen); in cvm_xts_setkey()
244 ctx->key_len = keylen; in cvm_xts_setkey()
245 memcpy(ctx->enc_key, key1, keylen / 2); in cvm_xts_setkey()
246 memcpy(ctx->enc_key + KEY2_OFFSET, key2, keylen / 2); in cvm_xts_setkey()
262 static int cvm_validate_keylen(struct cvm_enc_ctx *ctx, u32 keylen) in cvm_validate_keylen() argument
264 if ((keylen == 16) || (keylen == 24) || (keylen == 32)) { in cvm_validate_keylen()
265 ctx->key_len = keylen; in cvm_validate_keylen()
290 u32 keylen, u8 cipher_type) in cvm_setkey() argument
[all …]
/kernel/linux/linux-5.10/drivers/crypto/caam/
Dkey_gen.c45 struct alginfo * const adata, const u8 *key_in, u32 keylen, in gen_split_key() argument
54 adata->keylen = split_key_len(adata->algtype & OP_ALG_ALGSEL_MASK); in gen_split_key()
57 local_max = max(keylen, adata->keylen_pad); in gen_split_key()
60 adata->keylen, adata->keylen_pad); in gen_split_key()
62 DUMP_PREFIX_ADDRESS, 16, 4, key_in, keylen, 1); in gen_split_key()
73 memcpy(key_out, key_in, keylen); in gen_split_key()
82 append_key(desc, dma_addr, keylen, CLASS_2 | KEY_DEST_CLASS_REG); in gen_split_key()
100 append_fifo_store(desc, dma_addr, adata->keylen, in gen_split_key()
Dcaamhash_desc.c36 if (state != OP_ALG_AS_UPDATE && adata->keylen) { in cnstr_shdsc_ahash()
46 adata->keylen, CLASS_2 | in cnstr_shdsc_ahash()
98 append_key_as_imm(desc, adata->key_virt, adata->keylen, in cnstr_shdsc_sk_hash()
99 adata->keylen, CLASS_1 | KEY_DEST_CLASS_REG); in cnstr_shdsc_sk_hash()
103 append_key(desc, adata->key_dma, adata->keylen, in cnstr_shdsc_sk_hash()
106 append_key_as_imm(desc, adata->key_virt, adata->keylen, in cnstr_shdsc_sk_hash()
107 adata->keylen, CLASS_1 | in cnstr_shdsc_sk_hash()
138 append_fifo_store(desc, adata->key_dma, adata->keylen, in cnstr_shdsc_sk_hash()
Dcaamalg_desc.c69 adata->keylen_pad, adata->keylen, in cnstr_shdsc_aead_null_encap()
73 append_key(desc, adata->key_dma, adata->keylen, in cnstr_shdsc_aead_null_encap()
148 adata->keylen_pad, adata->keylen, in cnstr_shdsc_aead_null_decap()
152 append_key(desc, adata->key_dma, adata->keylen, in cnstr_shdsc_aead_null_decap()
216 unsigned int enckeylen = cdata->keylen; in init_sh_desc_key_aead()
236 adata->keylen_pad, adata->keylen, in init_sh_desc_key_aead()
240 append_key(desc, adata->key_dma, adata->keylen, in init_sh_desc_key_aead()
647 append_key_as_imm(desc, cdata->key_virt, cdata->keylen, in cnstr_shdsc_gcm_encap()
648 cdata->keylen, CLASS_1 | KEY_DEST_CLASS_REG); in cnstr_shdsc_gcm_encap()
650 append_key(desc, cdata->key_dma, cdata->keylen, CLASS_1 | in cnstr_shdsc_gcm_encap()
[all …]
/kernel/linux/linux-5.10/net/mac80211/
Dwep.c31 static inline bool ieee80211_wep_weak_iv(u32 iv, int keylen) in ieee80211_wep_weak_iv() argument
40 if (B >= 3 && B < 3 + keylen) in ieee80211_wep_weak_iv()
48 int keylen, int keyidx, u8 *iv) in ieee80211_wep_get_iv() argument
51 if (ieee80211_wep_weak_iv(local->wep_iv, keylen)) in ieee80211_wep_get_iv()
66 int keylen, int keyidx) in ieee80211_wep_add_iv() argument
87 ieee80211_wep_get_iv(local, keylen, keyidx, newhdr + hdrlen); in ieee80211_wep_add_iv()
133 const u8 *key, int keylen, int keyidx) in ieee80211_wep_encrypt() argument
142 iv = ieee80211_wep_add_iv(local, skb, keylen, keyidx); in ieee80211_wep_encrypt()
152 memcpy(rc4key + 3, key, keylen); in ieee80211_wep_encrypt()
157 return ieee80211_wep_encrypt_data(&local->wep_tx_ctx, rc4key, keylen + 3, in ieee80211_wep_encrypt()
[all …]
/kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/
Dopal-secvar.c74 static int opal_get_next_variable(const char *key, uint64_t *keylen, in opal_get_next_variable() argument
79 if (!key || !keylen) in opal_get_next_variable()
82 *keylen = cpu_to_be64(*keylen); in opal_get_next_variable()
84 rc = opal_secvar_get_next(key, keylen, keybufsize); in opal_get_next_variable()
86 *keylen = be64_to_cpu(*keylen); in opal_get_next_variable()
/kernel/linux/linux-5.10/drivers/staging/wfx/
Dkey.c36 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_pair()
37 msg->key_length = key->keylen; in fill_wep_pair()
38 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_pair()
46 WARN(key->keylen > sizeof(msg->key_data), "inconsistent data"); in fill_wep_group()
48 msg->key_length = key->keylen; in fill_wep_group()
49 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_group()
58 WARN(key->keylen != sizeof(msg->tkip_key_data) in fill_tkip_pair()
77 WARN(key->keylen != sizeof(msg->tkip_key_data) in fill_tkip_group()
98 WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data"); in fill_ccmp_pair()
100 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_pair()
[all …]
/kernel/linux/linux-5.10/lib/crypto/
Dblake2s-selftest.c564 int keylen = (13 * i) % (BLAKE2S_KEY_SIZE + 1); in blake2s_selftest() local
566 blake2s(hash, buf, key + BLAKE2S_KEY_SIZE - keylen, outlen, i, in blake2s_selftest()
567 keylen); in blake2s_selftest()
573 if (!keylen) in blake2s_selftest()
577 key + BLAKE2S_KEY_SIZE - keylen, in blake2s_selftest()
578 keylen); in blake2s_selftest()
/kernel/linux/linux-5.10/drivers/crypto/cavium/nitrox/
Dnitrox_skcipher.c167 unsigned int keylen) in nitrox_skcipher_setkey() argument
192 memcpy(fctx->crypto.u.key, key, keylen); in nitrox_skcipher_setkey()
198 unsigned int keylen) in nitrox_aes_setkey() argument
202 aes_keylen = flexi_aes_keylen(keylen); in nitrox_aes_setkey()
205 return nitrox_skcipher_setkey(cipher, aes_keylen, key, keylen); in nitrox_aes_setkey()
321 const u8 *key, unsigned int keylen) in nitrox_3des_setkey() argument
324 nitrox_skcipher_setkey(cipher, 0, key, keylen); in nitrox_3des_setkey()
338 const u8 *key, unsigned int keylen) in nitrox_aes_xts_setkey() argument
345 ret = xts_check_key(tfm, key, keylen); in nitrox_aes_xts_setkey()
349 keylen /= 2; in nitrox_aes_xts_setkey()
[all …]
/kernel/linux/linux-5.10/include/crypto/internal/
Dblake2s.h83 unsigned int keylen; member
87 const u8 *key, unsigned int keylen) in crypto_blake2s_setkey() argument
91 if (keylen == 0 || keylen > BLAKE2S_KEY_SIZE) in crypto_blake2s_setkey()
94 memcpy(tctx->key, key, keylen); in crypto_blake2s_setkey()
95 tctx->keylen = keylen; in crypto_blake2s_setkey()
106 __blake2s_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2s_init()
/kernel/linux/linux-5.10/drivers/s390/crypto/
Dpkey_api.c387 static int pkey_nonccatok2pkey(const u8 *key, u32 keylen, in pkey_nonccatok2pkey() argument
398 if (keylen != sizeof(struct protaeskeytoken)) in pkey_nonccatok2pkey()
417 if (keylen < sizeof(struct clearaeskeytoken)) in pkey_nonccatok2pkey()
420 if (keylen != sizeof(*t) + t->len) in pkey_nonccatok2pkey()
457 rc = ep11_check_aes_key(debug_info, 3, key, keylen, 1); in pkey_nonccatok2pkey()
465 rc = ep11_check_aes_key_with_hdr(debug_info, 3, key, keylen, 1); in pkey_nonccatok2pkey()
485 static int pkey_ccainttok2pkey(const u8 *key, u32 keylen, in pkey_ccainttok2pkey() argument
492 if (keylen != sizeof(struct secaeskeytoken)) in pkey_ccainttok2pkey()
496 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_ccainttok2pkey()
511 int pkey_keyblob2pkey(const u8 *key, u32 keylen, in pkey_keyblob2pkey() argument
[all …]
/kernel/linux/linux-5.10/drivers/crypto/rockchip/
Drk3288_crypto_skcipher.c86 const u8 *key, unsigned int keylen) in rk_aes_setkey() argument
91 if (keylen != AES_KEYSIZE_128 && keylen != AES_KEYSIZE_192 && in rk_aes_setkey()
92 keylen != AES_KEYSIZE_256) in rk_aes_setkey()
94 ctx->keylen = keylen; in rk_aes_setkey()
95 memcpy(ctx->key, key, keylen); in rk_aes_setkey()
97 return crypto_skcipher_setkey(ctx->fallback_tfm, key, keylen); in rk_aes_setkey()
101 const u8 *key, unsigned int keylen) in rk_des_setkey() argument
110 ctx->keylen = keylen; in rk_des_setkey()
111 memcpy(ctx->key, key, keylen); in rk_des_setkey()
113 return crypto_skcipher_setkey(ctx->fallback_tfm, key, keylen); in rk_des_setkey()
[all …]
/kernel/linux/linux-5.10/crypto/asymmetric_keys/
Dpublic_key.c170 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_query()
174 memcpy(key, pkey->key, pkey->keylen); in software_key_query()
175 ptr = key + pkey->keylen; in software_key_query()
181 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query()
183 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query()
239 key = kmalloc(pkey->keylen + sizeof(u32) * 2 + pkey->paramlen, in software_key_eds_op()
244 memcpy(key, pkey->key, pkey->keylen); in software_key_eds_op()
245 ptr = key + pkey->keylen; in software_key_eds_op()
251 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_eds_op()
253 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_eds_op()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/qce/
Dskcipher.c170 unsigned int keylen) in qce_skcipher_setkey() argument
177 if (!key || !keylen) in qce_skcipher_setkey()
180 switch (IS_XTS(flags) ? keylen >> 1 : keylen) { in qce_skcipher_setkey()
183 memcpy(ctx->enc_key, key, keylen); in qce_skcipher_setkey()
187 ret = crypto_skcipher_setkey(ctx->fallback, key, keylen); in qce_skcipher_setkey()
189 ctx->enc_keylen = keylen; in qce_skcipher_setkey()
194 unsigned int keylen) in qce_des_setkey() argument
203 ctx->enc_keylen = keylen; in qce_des_setkey()
204 memcpy(ctx->enc_key, key, keylen); in qce_des_setkey()
209 unsigned int keylen) in qce_des3_setkey() argument
[all …]
/kernel/linux/linux-5.10/fs/befs/
Dbtree.c117 int index, u16 * keylen);
335 u16 keylen; in befs_find_key() local
346 thiskey = befs_bt_get_key(sb, node, last, &keylen); in befs_find_key()
348 eq = befs_compare_strings(thiskey, keylen, findkey, findkey_len); in befs_find_key()
363 thiskey = befs_bt_get_key(sb, node, mid, &keylen); in befs_find_key()
364 eq = befs_compare_strings(thiskey, keylen, findkey, in befs_find_key()
421 u16 keylen; in befs_btree_read() local
490 keystart = befs_bt_get_key(sb, this_node, cur_key, &keylen); in befs_btree_read()
494 (int)keylen); in befs_btree_read()
496 if (bufsize < keylen + 1) { in befs_btree_read()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/allwinner/sun8i-ss/
Dsun8i-ss-cipher.c181 op->keylen); in sun8i_ss_cipher()
189 rctx->keylen = op->keylen; in sun8i_ss_cipher()
191 rctx->p_key = dma_map_single(ss->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
302 dma_unmap_single(ss->dev, rctx->p_key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
419 unsigned int keylen) in sun8i_ss_aes_setkey() argument
424 switch (keylen) { in sun8i_ss_aes_setkey()
432 dev_dbg(ss->dev, "ERROR: Invalid keylen %u\n", keylen); in sun8i_ss_aes_setkey()
436 op->keylen = keylen; in sun8i_ss_aes_setkey()
437 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ss_aes_setkey()
444 return crypto_skcipher_setkey(op->fallback_tfm, key, keylen); in sun8i_ss_aes_setkey()
[all …]
/kernel/linux/linux-5.10/drivers/crypto/vmx/
Daes_xts.c54 unsigned int keylen) in p8_aes_xts_setkey() argument
59 ret = xts_verify_key(tfm, key, keylen); in p8_aes_xts_setkey()
66 ret = aes_p8_set_encrypt_key(key + keylen/2, (keylen/2) * 8, &ctx->tweak_key); in p8_aes_xts_setkey()
67 ret |= aes_p8_set_encrypt_key(key, (keylen/2) * 8, &ctx->enc_key); in p8_aes_xts_setkey()
68 ret |= aes_p8_set_decrypt_key(key, (keylen/2) * 8, &ctx->dec_key); in p8_aes_xts_setkey()
73 ret |= crypto_skcipher_setkey(ctx->fallback, key, keylen); in p8_aes_xts_setkey()

12345678910>>...13