Home
last modified time | relevance | path

Searched refs:key_len (Results 1 – 25 of 159) sorted by relevance

1234567

/drivers/firmware/efi/
Dapple-properties.c65 u32 key_len, val_len; in unmarshal_key_value_pairs() local
68 if (sizeof(key_len) > remaining) in unmarshal_key_value_pairs()
71 key_len = *(typeof(key_len) *)ptr; in unmarshal_key_value_pairs()
72 if (key_len + sizeof(val_len) > remaining || in unmarshal_key_value_pairs()
73 key_len < sizeof(key_len) + sizeof(efi_char16_t) || in unmarshal_key_value_pairs()
74 *(efi_char16_t *)(ptr + sizeof(key_len)) == 0) { in unmarshal_key_value_pairs()
80 val_len = *(typeof(val_len) *)(ptr + key_len); in unmarshal_key_value_pairs()
81 if (key_len + val_len > remaining || in unmarshal_key_value_pairs()
84 ptr - (void *)dev_header + key_len); in unmarshal_key_value_pairs()
89 key = kzalloc((key_len - sizeof(key_len)) * 4 + 1, GFP_KERNEL); in unmarshal_key_value_pairs()
[all …]
/drivers/crypto/ccp/
Dccp-crypto-aes-xts.c79 unsigned int key_len) in ccp_aes_xts_setkey() argument
86 ret = xts_check_key(xfm, key, key_len); in ccp_aes_xts_setkey()
93 switch (key_len) { in ccp_aes_xts_setkey()
95 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey()
99 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey()
102 ctx->u.aes.key_len = key_len / 2; in ccp_aes_xts_setkey()
103 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_xts_setkey()
105 return crypto_skcipher_setkey(ctx->u.aes.tfm_skcipher, key, key_len); in ccp_aes_xts_setkey()
119 if (!ctx->u.aes.key_len) in ccp_aes_xts_crypt()
148 (ctx->u.aes.key_len != AES_KEYSIZE_128)) in ccp_aes_xts_crypt()
[all …]
Dccp-crypto-aes.c42 unsigned int key_len) in ccp_aes_setkey() argument
48 switch (key_len) { in ccp_aes_setkey()
63 ctx->u.aes.key_len = key_len; in ccp_aes_setkey()
65 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_setkey()
66 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_setkey()
79 if (!ctx->u.aes.key_len) in ccp_aes_crypt()
105 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_crypt()
132 ctx->u.aes.key_len = 0; in ccp_aes_cra_init()
156 unsigned int key_len) in ccp_aes_rfc3686_setkey() argument
160 if (key_len < CTR_RFC3686_NONCE_SIZE) in ccp_aes_rfc3686_setkey()
[all …]
Dccp-crypto-aes-galois.c35 unsigned int key_len) in ccp_aes_gcm_setkey() argument
39 switch (key_len) { in ccp_aes_gcm_setkey()
55 ctx->u.aes.key_len = key_len; in ccp_aes_gcm_setkey()
57 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_gcm_setkey()
58 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_gcm_setkey()
92 if (!ctx->u.aes.key_len) in ccp_aes_gcm_crypt()
130 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_gcm_crypt()
160 ctx->u.aes.key_len = 0; in ccp_aes_gcm_cra_init()
Dccp-crypto-des3.c40 unsigned int key_len) in ccp_des3_setkey() argument
70 ctx->u.des3.key_len = key_len; in ccp_des3_setkey()
72 memcpy(ctx->u.des3.key, key, key_len); in ccp_des3_setkey()
73 sg_init_one(&ctx->u.des3.key_sg, ctx->u.des3.key, key_len); in ccp_des3_setkey()
86 if (!ctx->u.des3.key_len) in ccp_des3_crypt()
113 rctx->cmd.u.des3.key_len = ctx->u.des3.key_len; in ccp_des3_crypt()
140 ctx->u.des3.key_len = 0; in ccp_des3_cra_init()
Dccp-crypto-aes-cmac.c72 if (!ctx->u.aes.key_len) in ccp_do_cmac_update()
166 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_do_cmac_update()
260 unsigned int key_len) in ccp_aes_cmac_setkey() argument
270 switch (key_len) { in ccp_aes_cmac_setkey()
287 ctx->u.aes.key_len = 0; in ccp_aes_cmac_setkey()
290 ret = crypto_cipher_setkey(ctx->u.aes.tfm_cipher, key, key_len); in ccp_aes_cmac_setkey()
331 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_cmac_setkey()
332 ctx->u.aes.key_len = key_len; in ccp_aes_cmac_setkey()
333 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_cmac_setkey()
345 ctx->u.aes.key_len = 0; in ccp_aes_cmac_cra_init()
Dccp-crypto-sha.c163 rctx->cmd.u.sha.opad = ctx->u.sha.key_len ? in ccp_do_sha_update()
165 rctx->cmd.u.sha.opad_len = ctx->u.sha.key_len ? in ccp_do_sha_update()
198 if (ctx->u.sha.key_len) { in ccp_sha_init()
274 unsigned int key_len) in ccp_sha_setkey() argument
286 ctx->u.sha.key_len = 0; in ccp_sha_setkey()
293 if (key_len > block_size) { in ccp_sha_setkey()
299 ret = crypto_shash_digest(sdesc, key, key_len, in ccp_sha_setkey()
306 key_len = digest_size; in ccp_sha_setkey()
308 memcpy(ctx->u.sha.key, key, key_len); in ccp_sha_setkey()
319 ctx->u.sha.key_len = key_len; in ccp_sha_setkey()
[all …]
Dccp-crypto.h101 unsigned int key_len; member
170 unsigned int key_len; member
191 unsigned int key_len; member
241 unsigned int key_len; /* in bits */ member
/drivers/crypto/bcm/
Dspu2.c1011 flow_log(" key: %d\n", cipher_parms->key_len); in spu2_create_request()
1012 flow_dump(" key: ", cipher_parms->key_buf, cipher_parms->key_len); in spu2_create_request()
1018 flow_log(" authkey: %d\n", hash_parms->key_len); in spu2_create_request()
1019 flow_dump(" authkey: ", hash_parms->key_buf, hash_parms->key_len); in spu2_create_request()
1045 hash_parms->key_len = cipher_parms->key_len; in spu2_create_request()
1047 cipher_parms->key_len); in spu2_create_request()
1048 cipher_parms->key_len = 0; in spu2_create_request()
1083 hash_parms->key_len, cipher_parms->key_len, in spu2_create_request()
1090 spu2_fmd_ctrl2_write(fmd, cipher_offset, hash_parms->key_len, 0, in spu2_create_request()
1091 cipher_parms->key_len, cipher_parms->iv_len); in spu2_create_request()
[all …]
Dspu.c667 flow_log(" key: %d\n", cipher_parms->key_len); in spum_create_request()
668 flow_dump(" key: ", cipher_parms->key_buf, cipher_parms->key_len); in spum_create_request()
674 flow_log(" authkey: %d\n", hash_parms->key_len); in spum_create_request()
675 flow_dump(" authkey: ", hash_parms->key_buf, hash_parms->key_len); in spum_create_request()
723 if (hash_parms->key_len) { in spum_create_request()
724 memcpy(ptr, hash_parms->key_buf, hash_parms->key_len); in spum_create_request()
725 ptr += hash_parms->key_len; in spum_create_request()
726 buf_len += hash_parms->key_len; in spum_create_request()
727 sctx_words += hash_parms->key_len / 4; in spum_create_request()
757 if (cipher_parms->key_len) { in spum_create_request()
[all …]
/drivers/crypto/nx/
Dnx-aes-ctr.c36 unsigned int key_len) in ctr_aes_nx_set_key() argument
43 switch (key_len) { in ctr_aes_nx_set_key()
61 memcpy(csbcpb->cpb.aes_ctr.key, in_key, key_len); in ctr_aes_nx_set_key()
68 unsigned int key_len) in ctr3686_aes_nx_set_key() argument
72 if (key_len < CTR_RFC3686_NONCE_SIZE) in ctr3686_aes_nx_set_key()
76 in_key + key_len - CTR_RFC3686_NONCE_SIZE, in ctr3686_aes_nx_set_key()
79 key_len -= CTR_RFC3686_NONCE_SIZE; in ctr3686_aes_nx_set_key()
81 return ctr_aes_nx_set_key(tfm, in_key, key_len); in ctr3686_aes_nx_set_key()
Dnx-aes-gcm.c36 unsigned int key_len) in gcm_aes_nx_set_key() argument
44 switch (key_len) { in gcm_aes_nx_set_key()
65 memcpy(csbcpb->cpb.aes_gcm.key, in_key, key_len); in gcm_aes_nx_set_key()
68 memcpy(csbcpb_aead->cpb.aes_gca.key, in_key, key_len); in gcm_aes_nx_set_key()
75 unsigned int key_len) in gcm4106_aes_nx_set_key() argument
81 if (key_len < 4) in gcm4106_aes_nx_set_key()
84 key_len -= 4; in gcm4106_aes_nx_set_key()
86 rc = gcm_aes_nx_set_key(tfm, in_key, key_len); in gcm4106_aes_nx_set_key()
90 memcpy(nonce, in_key + key_len, 4); in gcm4106_aes_nx_set_key()
Dnx-aes-ccm.c37 unsigned int key_len) in ccm_aes_nx_set_key() argument
45 switch (key_len) { in ccm_aes_nx_set_key()
56 memcpy(csbcpb->cpb.aes_ccm.key, in_key, key_len); in ccm_aes_nx_set_key()
59 memcpy(csbcpb_aead->cpb.aes_cca.key, in_key, key_len); in ccm_aes_nx_set_key()
67 unsigned int key_len) in ccm4309_aes_nx_set_key() argument
71 if (key_len < 3) in ccm4309_aes_nx_set_key()
74 key_len -= 3; in ccm4309_aes_nx_set_key()
76 memcpy(nx_ctx->priv.ccm.nonce, in_key + key_len, 3); in ccm4309_aes_nx_set_key()
78 return ccm_aes_nx_set_key(tfm, in_key, key_len); in ccm4309_aes_nx_set_key()
/drivers/staging/rtl8192u/ieee80211/
Dieee80211_crypt_wep.c33 u8 key_len; member
106 klen = 3 + wep->key_len; in prism2_wep_encrypt()
128 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_encrypt()
187 klen = 3 + wep->key_len; in prism2_wep_decrypt()
190 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_decrypt()
237 wep->key_len = len; in prism2_wep_set_key()
247 if (len < wep->key_len) in prism2_wep_get_key()
250 memcpy(key, wep->key, wep->key_len); in prism2_wep_get_key()
252 return wep->key_len; in prism2_wep_get_key()
261 wep->key_idx, wep->key_len); in prism2_wep_print_stats()
/drivers/staging/rtl8192e/
Drtllib_crypt_wep.c28 u8 key_len; member
113 klen = 3 + wep->key_len; in prism2_wep_encrypt()
135 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_encrypt()
193 klen = 3 + wep->key_len; in prism2_wep_decrypt()
196 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_decrypt()
240 wep->key_len = len; in prism2_wep_set_key()
250 if (len < wep->key_len) in prism2_wep_get_key()
253 memcpy(key, wep->key, wep->key_len); in prism2_wep_get_key()
255 return wep->key_len; in prism2_wep_get_key()
263 seq_printf(m, "key[%d] alg=WEP len=%d\n", wep->key_idx, wep->key_len); in prism2_wep_print_stats()
/drivers/net/ethernet/netronome/nfp/flower/
Doffload.c61 u32 meta_len, key_len, mask_len, act_len, tot_len; in nfp_flower_xmit_flow() local
67 key_len = nfp_flow->meta.key_len; in nfp_flower_xmit_flow()
71 tot_len = meta_len + key_len + mask_len + act_len; in nfp_flower_xmit_flow()
76 nfp_flow->meta.key_len >>= NFP_FL_LW_SIZ; in nfp_flower_xmit_flow()
86 memcpy(&msg[meta_len], nfp_flow->unmasked_data, key_len); in nfp_flower_xmit_flow()
87 memcpy(&msg[meta_len + key_len], nfp_flow->mask_data, mask_len); in nfp_flower_xmit_flow()
88 memcpy(&msg[meta_len + key_len + mask_len], in nfp_flower_xmit_flow()
94 nfp_flow->meta.key_len <<= NFP_FL_LW_SIZ; in nfp_flower_xmit_flow()
241 flow_pay->meta.key_len = key_layer->key_size; in nfp_flower_allocate_new()
/drivers/staging/wilc1000/
Dwilc_wfi_cfgoperations.c711 priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len; in connect()
712 memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len); in connect()
714 g_key_wep_params.key_len = sme->key_len; in connect()
715 g_key_wep_params.key = kmalloc(sme->key_len, GFP_KERNEL); in connect()
716 memcpy(g_key_wep_params.key, sme->key, sme->key_len); in connect()
721 wilc_add_wep_key_bss_sta(vif, sme->key, sme->key_len, in connect()
726 priv->WILC_WFI_wep_key_len[sme->key_idx] = sme->key_len; in connect()
727 memcpy(priv->WILC_WFI_wep_key[sme->key_idx], sme->key, sme->key_len); in connect()
729 g_key_wep_params.key_len = sme->key_len; in connect()
730 g_key_wep_params.key = kmalloc(sme->key_len, GFP_KERNEL); in connect()
[all …]
/drivers/net/wireless/intersil/orinoco/
Dwext.c31 enum orinoco_alg alg, const u8 *key, int key_len, in orinoco_set_key() argument
37 if (key_len) { in orinoco_set_key()
38 priv->keys[index].key = kzalloc(key_len, GFP_ATOMIC); in orinoco_set_key()
51 priv->keys[index].key_len = key_len; in orinoco_set_key()
54 if (key_len) in orinoco_set_key()
55 memcpy((void *)priv->keys[index].key, key, key_len); in orinoco_set_key()
65 priv->keys[index].cipher = (key_len > SMALL_KEY_SIZE) ? in orinoco_set_key()
82 priv->keys[index].key_len = 0; in orinoco_set_key()
287 if (priv->keys[index].key_len == 0) { in orinoco_ioctl_setiwencode()
354 erq->length = priv->keys[index].key_len; in orinoco_ioctl_getiwencode()
[all …]
/drivers/net/ethernet/mellanox/mlx5/core/en_accel/
Dipsec.c115 unsigned int key_len = (x->aead->alg_key_len + 7) / 8 - 4; in mlx5e_ipsec_enc_mode() local
117 switch (key_len) { in mlx5e_ipsec_enc_mode()
124 key_len, x->aead->alg_name); in mlx5e_ipsec_enc_mode()
136 unsigned int key_len; in mlx5e_ipsec_build_hw_sa() local
143 key_len = crypto_data_len - 4; /* 4 bytes salt at end */ in mlx5e_ipsec_build_hw_sa()
148 memcpy(&hw_sa->key_enc, x->aead->alg_key, key_len); in mlx5e_ipsec_build_hw_sa()
150 if (key_len == 16) in mlx5e_ipsec_build_hw_sa()
151 memcpy(&hw_sa->key_enc[16], x->aead->alg_key, key_len); in mlx5e_ipsec_build_hw_sa()
153 hw_sa->gcm.salt = *((__be32 *)(x->aead->alg_key + key_len)); in mlx5e_ipsec_build_hw_sa()
/drivers/staging/lustre/lnet/libcfs/linux/
Dlinux-crypto.c64 unsigned int key_len) in cfs_crypto_hash_alloc() argument
95 err = crypto_ahash_setkey(tfm, key, key_len); in cfs_crypto_hash_alloc()
147 unsigned char *key, unsigned int key_len, in cfs_crypto_hash_digest() argument
158 err = cfs_crypto_hash_alloc(hash_alg, &type, &req, key, key_len); in cfs_crypto_hash_digest()
198 unsigned char *key, unsigned int key_len) in cfs_crypto_hash_init() argument
204 err = cfs_crypto_hash_alloc(hash_alg, &type, &req, key, key_len); in cfs_crypto_hash_init()
/drivers/s390/crypto/
Dzcrypt_cca_key.h192 int short_len, long_len, pad_len, key_len, size; in zcrypt_type6_crt_key() local
199 key_len = 3*long_len + 2*short_len + pad_len + crt->inputdatalength; in zcrypt_type6_crt_key()
200 size = sizeof(*key) + key_len + sizeof(*pub) + 3; in zcrypt_type6_crt_key()
212 key->pvt.section_length = sizeof(key->pvt) + key_len; in zcrypt_type6_crt_key()
233 pub = (struct cca_public_sec *)(key->key_parts + key_len); in zcrypt_type6_crt_key()
/drivers/crypto/
Dixp4xx_crypto.c604 int init_len, u32 ctx_addr, const u8 *key, int key_len) in register_chain_var() argument
629 memcpy(pad, key, key_len); in register_chain_var()
630 memset(pad + key_len, 0, HMAC_PAD_BLOCKLEN - key_len); in register_chain_var()
660 const u8 *key, int key_len, unsigned digest_len) in setup_auth() argument
699 init_len, npe_ctx_addr, key, key_len); in setup_auth()
703 init_len, npe_ctx_addr, key, key_len); in setup_auth()
735 const u8 *key, int key_len) in setup_cipher() argument
754 switch (key_len) { in setup_cipher()
782 memcpy(cinfo, key, key_len); in setup_cipher()
784 if (key_len < DES3_EDE_KEY_SIZE && !(cipher_cfg & MOD_AES)) { in setup_cipher()
[all …]
/drivers/firmware/google/
Dvpd_decode.c74 u32 key_len; in vpd_decode_string() local
91 &key_len) != VPD_OK) in vpd_decode_string()
99 return callback(key, key_len, value, value_len, in vpd_decode_string()
/drivers/staging/skein/
Dskein_api.c83 int skein_mac_init(struct skein_ctx *ctx, const u8 *key, size_t key_len, in skein_mac_init() argument
101 tree_info, key, key_len); in skein_mac_init()
106 tree_info, key, key_len); in skein_mac_init()
110 tree_info, key, key_len); in skein_mac_init()
/drivers/net/wireless/marvell/mwifiex/
Dsta_cmd.c553 key_param_set->key_len = in mwifiex_set_keyparamset_wep()
609 km->key_param_set.key_params.cmac_aes.key_len = in mwifiex_set_aes_key_v2()
610 cpu_to_le16(enc_key->key_len); in mwifiex_set_aes_key_v2()
612 enc_key->key_material, enc_key->key_len); in mwifiex_set_aes_key_v2()
626 km->key_param_set.key_params.aes.key_len = in mwifiex_set_aes_key_v2()
627 cpu_to_le16(enc_key->key_len); in mwifiex_set_aes_key_v2()
629 enc_key->key_material, enc_key->key_len); in mwifiex_set_aes_key_v2()
712 if (enc_key->key_len <= WLAN_KEY_LEN_WEP104) { in mwifiex_cmd_802_11_key_material_v2()
735 km->key_param_set.key_params.wep.key_len = in mwifiex_cmd_802_11_key_material_v2()
736 cpu_to_le16(enc_key->key_len); in mwifiex_cmd_802_11_key_material_v2()
[all …]

1234567