/Linux-v5.4/arch/x86/crypto/ |
D | aes_ctrby8_avx-x86_64.S | 155 .macro do_aes b, k, key_len 158 .set klen, \key_len 426 .macro do_aes_load val, key_len 427 do_aes \val, 1, \key_len 430 .macro do_aes_noload val, key_len 431 do_aes \val, 0, \key_len 436 .macro do_aes_ctrmain key_len 438 jb .Ldo_return2\key_len 446 jz .Lmult_of_8_blks\key_len 450 jg .Lgt4\key_len [all …]
|
/Linux-v5.4/drivers/firmware/efi/ |
D | apple-properties.c | 56 u32 key_len, val_len; in unmarshal_key_value_pairs() local 59 if (sizeof(key_len) > remaining) in unmarshal_key_value_pairs() 62 key_len = *(typeof(key_len) *)ptr; in unmarshal_key_value_pairs() 63 if (key_len + sizeof(val_len) > remaining || in unmarshal_key_value_pairs() 64 key_len < sizeof(key_len) + sizeof(efi_char16_t) || in unmarshal_key_value_pairs() 65 *(efi_char16_t *)(ptr + sizeof(key_len)) == 0) { in unmarshal_key_value_pairs() 71 val_len = *(typeof(val_len) *)(ptr + key_len); in unmarshal_key_value_pairs() 72 if (key_len + val_len > remaining || in unmarshal_key_value_pairs() 75 ptr - (void *)dev_header + key_len); in unmarshal_key_value_pairs() 80 key = kzalloc((key_len - sizeof(key_len)) * 4 + 1, GFP_KERNEL); in unmarshal_key_value_pairs() [all …]
|
/Linux-v5.4/arch/sparc/crypto/ |
D | camellia_glue.c | 30 int key_len; member 34 unsigned int key_len, u64 *decrypt_key); 37 unsigned int key_len) in camellia_set_key() argument 43 if (key_len != 16 && key_len != 24 && key_len != 32) { in camellia_set_key() 48 ctx->key_len = key_len; in camellia_set_key() 51 key_len, &ctx->decrypt_key[0]); in camellia_set_key() 56 u32 *output, unsigned int key_len); 64 (u32 *) dst, ctx->key_len); in camellia_encrypt() 73 (u32 *) dst, ctx->key_len); in camellia_decrypt() 76 extern void camellia_sparc64_load_keys(const u64 *key, unsigned int key_len); [all …]
|
/Linux-v5.4/arch/s390/crypto/ |
D | aes_s390.c | 44 int key_len; member 55 int key_len; member 72 unsigned int key_len) in setkey_fallback_cip() argument 81 ret = crypto_cipher_setkey(sctx->fallback.cip, in_key, key_len); in setkey_fallback_cip() 91 unsigned int key_len) in aes_set_key() argument 97 fc = (key_len == 16) ? CPACF_KM_AES_128 : in aes_set_key() 98 (key_len == 24) ? CPACF_KM_AES_192 : in aes_set_key() 99 (key_len == 32) ? CPACF_KM_AES_256 : 0; in aes_set_key() 104 return setkey_fallback_cip(tfm, in_key, key_len); in aes_set_key() 106 sctx->key_len = key_len; in aes_set_key() [all …]
|
/Linux-v5.4/drivers/crypto/ccp/ |
D | ccp-crypto-aes-xts.c | 76 unsigned int key_len) in ccp_aes_xts_setkey() argument 83 ret = xts_check_key(xfm, key, key_len); in ccp_aes_xts_setkey() 90 switch (key_len) { in ccp_aes_xts_setkey() 92 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey() 96 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey() 99 ctx->u.aes.key_len = key_len / 2; in ccp_aes_xts_setkey() 100 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_xts_setkey() 102 return crypto_sync_skcipher_setkey(ctx->u.aes.tfm_skcipher, key, key_len); in ccp_aes_xts_setkey() 116 if (!ctx->u.aes.key_len) in ccp_aes_xts_crypt() 142 (ctx->u.aes.key_len != AES_KEYSIZE_128)) in ccp_aes_xts_crypt() [all …]
|
D | ccp-crypto-aes.c | 38 unsigned int key_len) in ccp_aes_setkey() argument 44 switch (key_len) { in ccp_aes_setkey() 59 ctx->u.aes.key_len = key_len; in ccp_aes_setkey() 61 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_setkey() 62 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_setkey() 75 if (!ctx->u.aes.key_len) in ccp_aes_crypt() 101 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_crypt() 128 ctx->u.aes.key_len = 0; in ccp_aes_cra_init() 152 unsigned int key_len) in ccp_aes_rfc3686_setkey() argument 156 if (key_len < CTR_RFC3686_NONCE_SIZE) in ccp_aes_rfc3686_setkey() [all …]
|
D | ccp-crypto-aes-galois.c | 30 unsigned int key_len) in ccp_aes_gcm_setkey() argument 34 switch (key_len) { in ccp_aes_gcm_setkey() 50 ctx->u.aes.key_len = key_len; in ccp_aes_gcm_setkey() 52 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_gcm_setkey() 53 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_gcm_setkey() 87 if (!ctx->u.aes.key_len) in ccp_aes_gcm_crypt() 125 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_gcm_crypt() 155 ctx->u.aes.key_len = 0; in ccp_aes_gcm_cra_init()
|
D | ccp-crypto-des3.c | 37 unsigned int key_len) in ccp_des3_setkey() argument 53 ctx->u.des3.key_len = key_len; in ccp_des3_setkey() 55 memcpy(ctx->u.des3.key, key, key_len); in ccp_des3_setkey() 56 sg_init_one(&ctx->u.des3.key_sg, ctx->u.des3.key, key_len); in ccp_des3_setkey() 69 if (!ctx->u.des3.key_len) in ccp_des3_crypt() 96 rctx->cmd.u.des3.key_len = ctx->u.des3.key_len; in ccp_des3_crypt() 123 ctx->u.des3.key_len = 0; in ccp_des3_cra_init()
|
D | ccp-crypto-aes-cmac.c | 69 if (!ctx->u.aes.key_len) in ccp_do_cmac_update() 163 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_do_cmac_update() 257 unsigned int key_len) in ccp_aes_cmac_setkey() argument 268 switch (key_len) { in ccp_aes_cmac_setkey() 285 ctx->u.aes.key_len = 0; in ccp_aes_cmac_setkey() 288 ret = aes_expandkey(&aes, key, key_len); in ccp_aes_cmac_setkey() 329 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_cmac_setkey() 330 ctx->u.aes.key_len = key_len; in ccp_aes_cmac_setkey() 331 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_cmac_setkey() 342 ctx->u.aes.key_len = 0; in ccp_aes_cmac_cra_init()
|
D | ccp-crypto-sha.c | 160 rctx->cmd.u.sha.opad = ctx->u.sha.key_len ? in ccp_do_sha_update() 162 rctx->cmd.u.sha.opad_len = ctx->u.sha.key_len ? in ccp_do_sha_update() 195 if (ctx->u.sha.key_len) { in ccp_sha_init() 271 unsigned int key_len) in ccp_sha_setkey() argument 283 ctx->u.sha.key_len = 0; in ccp_sha_setkey() 290 if (key_len > block_size) { in ccp_sha_setkey() 294 ret = crypto_shash_digest(sdesc, key, key_len, in ccp_sha_setkey() 301 key_len = digest_size; in ccp_sha_setkey() 303 memcpy(ctx->u.sha.key, key, key_len); in ccp_sha_setkey() 314 ctx->u.sha.key_len = key_len; in ccp_sha_setkey() [all …]
|
/Linux-v5.4/arch/arm64/crypto/ |
D | aes-ce-glue.c | 75 unsigned int key_len) in ce_aes_expandkey() argument 84 u32 kwords = key_len / sizeof(u32); in ce_aes_expandkey() 88 if (key_len != AES_KEYSIZE_128 && in ce_aes_expandkey() 89 key_len != AES_KEYSIZE_192 && in ce_aes_expandkey() 90 key_len != AES_KEYSIZE_256) in ce_aes_expandkey() 93 ctx->key_length = key_len; in ce_aes_expandkey() 107 if (key_len == AES_KEYSIZE_192) { in ce_aes_expandkey() 112 } else if (key_len == AES_KEYSIZE_256) { in ce_aes_expandkey() 143 unsigned int key_len) in ce_aes_setkey() argument 148 ret = ce_aes_expandkey(ctx, in_key, key_len); in ce_aes_setkey()
|
D | aes-neonbs-glue.c | 78 unsigned int key_len) in aesbs_setkey() argument 84 err = aes_expandkey(&rk, in_key, key_len); in aesbs_setkey() 88 ctx->rounds = 6 + key_len / 4; in aesbs_setkey() 137 unsigned int key_len) in aesbs_cbc_setkey() argument 143 err = aes_expandkey(&rk, in_key, key_len); in aesbs_cbc_setkey() 147 ctx->key.rounds = 6 + key_len / 4; in aesbs_cbc_setkey() 210 unsigned int key_len) in aesbs_ctr_setkey_sync() argument 215 err = aes_expandkey(&ctx->fallback, in_key, key_len); in aesbs_ctr_setkey_sync() 219 ctx->key.rounds = 6 + key_len / 4; in aesbs_ctr_setkey_sync() 270 unsigned int key_len) in aesbs_xts_setkey() argument [all …]
|
/Linux-v5.4/net/wireless/ |
D | lib80211_crypt_wep.c | 33 u8 key_len; member 77 klen = 3 + wep->key_len; in lib80211_wep_build_iv() 124 memcpy(key + 3, wep->key, wep->key_len); in lib80211_wep_encrypt() 128 klen = 3 + wep->key_len; in lib80211_wep_encrypt() 169 klen = 3 + wep->key_len; in lib80211_wep_decrypt() 172 memcpy(key + 3, wep->key, wep->key_len); in lib80211_wep_decrypt() 206 wep->key_len = len; in lib80211_wep_set_key() 215 if (len < wep->key_len) in lib80211_wep_get_key() 218 memcpy(key, wep->key, wep->key_len); in lib80211_wep_get_key() 220 return wep->key_len; in lib80211_wep_get_key() [all …]
|
/Linux-v5.4/drivers/crypto/nx/ |
D | nx-aes-ctr.c | 24 unsigned int key_len) in ctr_aes_nx_set_key() argument 31 switch (key_len) { in ctr_aes_nx_set_key() 49 memcpy(csbcpb->cpb.aes_ctr.key, in_key, key_len); in ctr_aes_nx_set_key() 56 unsigned int key_len) in ctr3686_aes_nx_set_key() argument 60 if (key_len < CTR_RFC3686_NONCE_SIZE) in ctr3686_aes_nx_set_key() 64 in_key + key_len - CTR_RFC3686_NONCE_SIZE, in ctr3686_aes_nx_set_key() 67 key_len -= CTR_RFC3686_NONCE_SIZE; in ctr3686_aes_nx_set_key() 69 return ctr_aes_nx_set_key(tfm, in_key, key_len); in ctr3686_aes_nx_set_key()
|
/Linux-v5.4/drivers/crypto/bcm/ |
D | spu2.c | 1000 flow_log(" key: %d\n", cipher_parms->key_len); in spu2_create_request() 1001 flow_dump(" key: ", cipher_parms->key_buf, cipher_parms->key_len); in spu2_create_request() 1007 flow_log(" authkey: %d\n", hash_parms->key_len); in spu2_create_request() 1008 flow_dump(" authkey: ", hash_parms->key_buf, hash_parms->key_len); in spu2_create_request() 1034 hash_parms->key_len = cipher_parms->key_len; in spu2_create_request() 1036 cipher_parms->key_len); in spu2_create_request() 1037 cipher_parms->key_len = 0; in spu2_create_request() 1072 hash_parms->key_len, cipher_parms->key_len, in spu2_create_request() 1079 spu2_fmd_ctrl2_write(fmd, cipher_offset, hash_parms->key_len, 0, in spu2_create_request() 1080 cipher_parms->key_len, cipher_parms->iv_len); in spu2_create_request() [all …]
|
D | spu.c | 653 flow_log(" key: %d\n", cipher_parms->key_len); in spum_create_request() 654 flow_dump(" key: ", cipher_parms->key_buf, cipher_parms->key_len); in spum_create_request() 660 flow_log(" authkey: %d\n", hash_parms->key_len); in spum_create_request() 661 flow_dump(" authkey: ", hash_parms->key_buf, hash_parms->key_len); in spum_create_request() 709 if (hash_parms->key_len) { in spum_create_request() 710 memcpy(ptr, hash_parms->key_buf, hash_parms->key_len); in spum_create_request() 711 ptr += hash_parms->key_len; in spum_create_request() 712 buf_len += hash_parms->key_len; in spum_create_request() 713 sctx_words += hash_parms->key_len / 4; in spum_create_request() 743 if (cipher_parms->key_len) { in spum_create_request() [all …]
|
/Linux-v5.4/drivers/staging/rtl8192u/ieee80211/ |
D | ieee80211_crypt_wep.c | 29 u8 key_len; member 102 klen = 3 + wep->key_len; in prism2_wep_encrypt() 124 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_encrypt() 183 klen = 3 + wep->key_len; in prism2_wep_decrypt() 186 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_decrypt() 233 wep->key_len = len; in prism2_wep_set_key() 243 if (len < wep->key_len) in prism2_wep_get_key() 246 memcpy(key, wep->key, wep->key_len); in prism2_wep_get_key() 248 return wep->key_len; in prism2_wep_get_key() 257 wep->key_idx, wep->key_len); in prism2_wep_print_stats()
|
/Linux-v5.4/drivers/staging/rtl8192e/ |
D | rtllib_crypt_wep.c | 24 u8 key_len; member 109 klen = 3 + wep->key_len; in prism2_wep_encrypt() 131 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_encrypt() 189 klen = 3 + wep->key_len; in prism2_wep_decrypt() 192 memcpy(key + 3, wep->key, wep->key_len); in prism2_wep_decrypt() 236 wep->key_len = len; in prism2_wep_set_key() 246 if (len < wep->key_len) in prism2_wep_get_key() 249 memcpy(key, wep->key, wep->key_len); in prism2_wep_get_key() 251 return wep->key_len; in prism2_wep_get_key() 259 seq_printf(m, "key[%d] alg=WEP len=%d\n", wep->key_idx, wep->key_len); in prism2_wep_print_stats()
|
/Linux-v5.4/lib/crypto/ |
D | aes.c | 186 unsigned int key_len) in aes_expandkey() argument 188 u32 kwords = key_len / sizeof(u32); in aes_expandkey() 192 err = aes_check_keylen(key_len); in aes_expandkey() 196 ctx->key_length = key_len; in aes_expandkey() 210 if (key_len == AES_KEYSIZE_192) { in aes_expandkey() 215 } else if (key_len == AES_KEYSIZE_256) { in aes_expandkey() 231 ctx->key_dec[0] = ctx->key_enc[key_len + 24]; in aes_expandkey() 232 ctx->key_dec[1] = ctx->key_enc[key_len + 25]; in aes_expandkey() 233 ctx->key_dec[2] = ctx->key_enc[key_len + 26]; in aes_expandkey() 234 ctx->key_dec[3] = ctx->key_enc[key_len + 27]; in aes_expandkey() [all …]
|
/Linux-v5.4/arch/arm/crypto/ |
D | aes-neonbs-glue.c | 67 unsigned int key_len) in aesbs_setkey() argument 73 err = aes_expandkey(&rk, in_key, key_len); in aesbs_setkey() 77 ctx->rounds = 6 + key_len / 4; in aesbs_setkey() 126 unsigned int key_len) in aesbs_cbc_setkey() argument 132 err = aes_expandkey(&rk, in_key, key_len); in aesbs_cbc_setkey() 136 ctx->key.rounds = 6 + key_len / 4; in aesbs_cbc_setkey() 142 return crypto_cipher_setkey(ctx->enc_tfm, in_key, key_len); in aesbs_cbc_setkey() 202 unsigned int key_len) in aesbs_ctr_setkey_sync() argument 207 err = aes_expandkey(&ctx->fallback, in_key, key_len); in aesbs_ctr_setkey_sync() 211 ctx->key.rounds = 6 + key_len / 4; in aesbs_ctr_setkey_sync() [all …]
|
/Linux-v5.4/net/mac80211/ |
D | fils_aead.c | 66 static int aes_siv_encrypt(const u8 *key, size_t key_len, in aes_siv_encrypt() argument 79 key_len /= 2; /* S2V key || CTR key */ in aes_siv_encrypt() 91 res = crypto_shash_setkey(tfm, key, key_len); in aes_siv_encrypt() 122 res = crypto_skcipher_setkey(tfm2, key + key_len, key_len); in aes_siv_encrypt() 144 static int aes_siv_decrypt(const u8 *key, size_t key_len, in aes_siv_decrypt() argument 159 key_len /= 2; /* S2V key || CTR key */ in aes_siv_decrypt() 179 res = crypto_skcipher_setkey(tfm2, key + key_len, key_len); in aes_siv_decrypt() 206 res = crypto_shash_setkey(tfm, key, key_len); in aes_siv_decrypt()
|
/Linux-v5.4/arch/powerpc/crypto/ |
D | aes-spe-glue.c | 73 unsigned int key_len); 90 unsigned int key_len) in ppc_aes_setkey() argument 94 if (key_len != AES_KEYSIZE_128 && in ppc_aes_setkey() 95 key_len != AES_KEYSIZE_192 && in ppc_aes_setkey() 96 key_len != AES_KEYSIZE_256) { in ppc_aes_setkey() 101 switch (key_len) { in ppc_aes_setkey() 116 ppc_generate_decrypt_key(ctx->key_dec, ctx->key_enc, key_len); in ppc_aes_setkey() 122 unsigned int key_len) in ppc_xts_setkey() argument 127 err = xts_check_key(tfm, in_key, key_len); in ppc_xts_setkey() 131 key_len >>= 1; in ppc_xts_setkey() [all …]
|
/Linux-v5.4/drivers/net/ethernet/netronome/nfp/ |
D | nfp_net_debugdump.c | 199 u32 tl_len, key_len; in nfp_calc_hwinfo_field_sz() local 203 key_len = strnlen(spec->data, tl_len); in nfp_calc_hwinfo_field_sz() 204 if (key_len == tl_len) in nfp_calc_hwinfo_field_sz() 211 return sizeof(struct nfp_dump_tl) + ALIGN8(key_len + strlen(value) + 2); in nfp_calc_hwinfo_field_sz() 234 u32 tl_len, key_len; in nfp_calc_rtsym_dump_sz() local 238 key_len = strnlen(spec_rtsym->rtsym, tl_len); in nfp_calc_rtsym_dump_sz() 239 if (key_len == tl_len) in nfp_calc_rtsym_dump_sz() 246 return ALIGN8(offsetof(struct nfp_dump_rtsym, rtsym) + key_len + 1) + in nfp_calc_rtsym_dump_sz() 415 u32 tl_len, key_len, val_len; in nfp_dump_hwinfo_field() local 421 key_len = strnlen(spec->data, tl_len); in nfp_dump_hwinfo_field() [all …]
|
/Linux-v5.4/crypto/ |
D | aes_generic.c | 1136 unsigned int key_len) in crypto_aes_set_key() argument 1142 ret = aes_expandkey(ctx, in_key, key_len); in crypto_aes_set_key() 1187 const int key_len = ctx->key_length; in crypto_aes_encrypt() local 1194 if (key_len > 24) { in crypto_aes_encrypt() 1199 if (key_len > 16) { in crypto_aes_encrypt() 1256 const int key_len = ctx->key_length; in crypto_aes_decrypt() local 1264 if (key_len > 24) { in crypto_aes_decrypt() 1269 if (key_len > 16) { in crypto_aes_decrypt()
|
/Linux-v5.4/drivers/net/wireless/intersil/orinoco/ |
D | wext.c | 31 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 …]
|