/linux/include/crypto/ |
A D | blake2s.h | 47 const void *key, size_t keylen) in __blake2s_init() argument 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 97 (!key && keylen))); in blake2s() 99 __blake2s_init(&state, outlen, key, keylen); in blake2s() [all …]
|
A D | xts.h | 12 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()
|
A D | blake2b.h | 44 const void *key, size_t keylen) in __blake2b_init() argument 46 state->h[0] = BLAKE2B_IV0 ^ (0x01010000 | keylen << 8 | outlen); in __blake2b_init() 60 if (keylen) { in __blake2b_init() 61 memcpy(state->buf, key, keylen); in __blake2b_init() 62 memset(&state->buf[keylen], 0, BLAKE2B_BLOCK_SIZE - keylen); in __blake2b_init()
|
/linux/drivers/staging/wlan-ng/ |
A D | p80211wep.c | 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() 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() 121 keylen += 3; /* add in IV bytes */ in wep_decrypt() 164 u32 i, j, k, crc, keylen; in wep_encrypt() local 174 keylen = wlandev->wep_keylens[keynum]; in wep_encrypt() 175 if (keylen <= 0) in wep_encrypt() [all …]
|
/linux/drivers/crypto/amcc/ |
A D | crypto4xx_alg.c | 123 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() 161 key, keylen); in crypto4xx_setkey_aes() 290 unsigned int keylen) in crypto4xx_sk_setup_fallback() argument 369 unsigned int keylen) in crypto4xx_aead_setup_fallback() argument 382 unsigned int keylen) in crypto4xx_setkey_aes_ccm() argument 498 switch (keylen) { in crypto4xx_aes_gcm_validate_keylen() 509 unsigned int keylen) in crypto4xx_compute_gcm_hash_key_sw() argument 567 key, keylen); in crypto4xx_setkey_aes_gcm() [all …]
|
/linux/fs/hfs/ |
A D | bfind.c | 58 u16 off, len, keylen; in __hfs_brec_find() local 70 if (keylen == 0) { in __hfs_brec_find() 89 if (keylen == 0) { in __hfs_brec_find() 98 fd->keylength = keylen; in __hfs_brec_find() 99 fd->entryoffset = off + keylen; in __hfs_brec_find() 100 fd->entrylength = len - keylen; in __hfs_brec_find() 179 u16 off, len, keylen; in hfs_brec_goto() local 225 if (keylen == 0) { in hfs_brec_goto() 230 fd->keylength = keylen; in hfs_brec_goto() 231 fd->entryoffset = off + keylen; in hfs_brec_goto() [all …]
|
/linux/fs/cachefiles/ |
A D | key.c | 33 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()
|
/linux/crypto/ |
A D | cipher.c | 21 unsigned int keylen) in setkey_unaligned() argument 29 absize = keylen + alignmask; in setkey_unaligned() 35 memcpy(alignbuffer, key, keylen); in setkey_unaligned() 36 ret = cia->cia_setkey(crypto_cipher_tfm(tfm), alignbuffer, keylen); in setkey_unaligned() 37 memset(alignbuffer, 0, keylen); in setkey_unaligned() 44 const u8 *key, unsigned int keylen) in crypto_cipher_setkey() argument 49 if (keylen < cia->cia_min_keysize || keylen > cia->cia_max_keysize) 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()
|
/linux/fs/hfsplus/ |
A D | bfind.c | 117 u16 off, len, keylen; in __hfs_brec_find() local 130 if (keylen == 0) { in __hfs_brec_find() 144 if (keylen == 0) { 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() 236 u16 off, len, keylen; in hfs_brec_goto() local 282 if (keylen == 0) { in hfs_brec_goto() 287 fd->keylength = keylen; in hfs_brec_goto() 288 fd->entryoffset = off + keylen; in hfs_brec_goto() [all …]
|
/linux/drivers/crypto/cavium/cpt/ |
A D | cptvf_algs.c | 233 u32 keylen) in cvm_xts_setkey() argument 244 ctx->key_len = keylen; in cvm_xts_setkey() 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 297 memcpy(ctx->enc_key, key, keylen); in cvm_setkey() 305 u32 keylen) in cvm_cbc_aes_setkey() argument 311 u32 keylen) in cvm_ecb_aes_setkey() argument 317 u32 keylen) in cvm_cfb_aes_setkey() argument 323 u32 keylen) in cvm_cbc_des3_setkey() argument [all …]
|
/linux/net/mac80211/ |
A D | wep.c | 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 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() 217 klen = 3 + key->conf.keylen; in ieee80211_wep_decrypt() 223 memcpy(rc4key + 3, key->conf.key, key->conf.keylen); in ieee80211_wep_decrypt() 277 tx->key->conf.keylen, in wep_encrypt_skb() [all …]
|
/linux/drivers/staging/wfx/ |
A D | key.c | 37 msg->key_length = key->keylen; in fill_wep_pair() 38 memcpy(msg->key_data, key->key, key->keylen); in fill_wep_pair() 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() 100 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_pair() 109 memcpy(msg->aes_key_data, key->key, key->keylen); in fill_ccmp_group() 121 WARN(key->keylen != sizeof(msg->wapi_key_data) in fill_sms4_pair() 136 WARN(key->keylen != sizeof(msg->wapi_key_data) in fill_sms4_group() [all …]
|
/linux/drivers/crypto/cavium/nitrox/ |
A D | nitrox_skcipher.c | 167 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() 345 ret = xts_check_key(tfm, key, keylen); in nitrox_aes_xts_setkey() 349 keylen /= 2; in nitrox_aes_xts_setkey() 351 aes_keylen = flexi_aes_keylen(keylen); in nitrox_aes_xts_setkey() 357 memcpy(fctx->auth.u.key2, (key + keylen), keylen); in nitrox_aes_xts_setkey() 370 if (keylen < CTR_RFC3686_NONCE_SIZE) in nitrox_aes_ctr_rfc3686_setkey() 378 keylen -= CTR_RFC3686_NONCE_SIZE; in nitrox_aes_ctr_rfc3686_setkey() [all …]
|
/linux/drivers/crypto/caam/ |
A D | key_gen.c | 45 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()
|
A D | caamhash_desc.c | 36 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()
|
A D | caamalg_desc.c | 69 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() 216 unsigned int enckeylen = cdata->keylen; in init_sh_desc_key_aead() 236 adata->keylen_pad, adata->keylen, in init_sh_desc_key_aead() 899 cdata->keylen), 4, FIFOLD_CLASS_CLASS1 | in cnstr_shdsc_rfc4106_encap() 981 cdata->keylen, CLASS_1 | in cnstr_shdsc_rfc4106_decap() 1008 cdata->keylen), 4, FIFOLD_CLASS_CLASS1 | in cnstr_shdsc_rfc4106_decap() 1092 cdata->keylen), 4, FIFOLD_CLASS_CLASS1 | in cnstr_shdsc_rfc4543_encap() 1175 cdata->keylen), 4, FIFOLD_CLASS_CLASS1 | in cnstr_shdsc_rfc4543_decap() [all …]
|
A D | caamalg_qi.c | 196 unsigned int keylen) in aead_setkey() argument 284 unsigned int keylen) in des3_aead_setkey() argument 305 ctx->cdata.keylen; in gcm_set_sh_desc() 375 ctx->cdata.keylen = keylen; in gcm_setkey() 408 ctx->cdata.keylen; in rfc4106_set_sh_desc() 481 ctx->cdata.keylen = keylen - 4; in rfc4106_setkey() 516 ctx->cdata.keylen; in rfc4543_set_sh_desc() 587 ctx->cdata.keylen = keylen - 4; in rfc4543_setkey() 632 ctx->cdata.keylen = keylen; in skcipher_setkey() 746 if (keylen != 2 * AES_KEYSIZE_128 && keylen != 2 * AES_KEYSIZE_256) in xts_skcipher_setkey() [all …]
|
/linux/drivers/crypto/allwinner/sun8i-ss/ |
A D | sun8i-ss-cipher.c | 117 op->keylen); in sun8i_ss_cipher() 125 rctx->keylen = op->keylen; in sun8i_ss_cipher() 379 unsigned int keylen) in sun8i_ss_aes_setkey() argument 384 switch (keylen) { in sun8i_ss_aes_setkey() 396 op->keylen = keylen; in sun8i_ss_aes_setkey() 397 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ss_aes_setkey() 408 unsigned int keylen) in sun8i_ss_des3_setkey() argument 413 if (unlikely(keylen != 3 * DES_KEY_SIZE)) { in sun8i_ss_des3_setkey() 414 dev_dbg(ss->dev, "Invalid keylen %u\n", keylen); in sun8i_ss_des3_setkey() 419 op->keylen = keylen; in sun8i_ss_des3_setkey() [all …]
|
/linux/arch/powerpc/platforms/powernv/ |
A D | opal-secvar.c | 74 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()
|
/linux/include/crypto/internal/ |
A D | blake2b.h | 69 unsigned int keylen; member 73 const u8 *key, unsigned int keylen) in crypto_blake2b_setkey() argument 77 if (keylen == 0 || keylen > BLAKE2B_KEY_SIZE) in crypto_blake2b_setkey() 80 memcpy(tctx->key, key, keylen); in crypto_blake2b_setkey() 81 tctx->keylen = keylen; in crypto_blake2b_setkey() 92 __blake2b_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2b_init()
|
A D | blake2s.h | 73 unsigned int keylen; member 77 const u8 *key, unsigned int keylen) in crypto_blake2s_setkey() argument 81 if (keylen == 0 || keylen > BLAKE2S_KEY_SIZE) in crypto_blake2s_setkey() 84 memcpy(tctx->key, key, keylen); in crypto_blake2s_setkey() 85 tctx->keylen = keylen; in crypto_blake2s_setkey() 96 __blake2s_init(state, outlen, tctx->key, tctx->keylen); in crypto_blake2s_init()
|
/linux/crypto/asymmetric_keys/ |
A D | public_key.c | 131 memcpy(key, pkey->key, pkey->keylen); in software_key_query() 132 ptr = key + pkey->keylen; in software_key_query() 138 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_query() 140 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_query() 202 memcpy(key, pkey->key, pkey->keylen); in software_key_eds_op() 203 ptr = key + pkey->keylen; in software_key_eds_op() 209 ret = crypto_akcipher_set_priv_key(tfm, key, pkey->keylen); in software_key_eds_op() 211 ret = crypto_akcipher_set_pub_key(tfm, key, pkey->keylen); in software_key_eds_op() 348 memcpy(key, pkey->key, pkey->keylen); in public_key_verify_signature() 349 ptr = key + pkey->keylen; in public_key_verify_signature() [all …]
|
/linux/drivers/s390/crypto/ |
A D | pkey_api.c | 426 if (keylen != sizeof(*t) + t->len) in pkey_nonccatok2pkey() 503 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_ccainttok2pkey() 789 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_keyblob2pkey2() 1056 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_keyblob2pkey3() 1126 if (!ukey || keylen < MINKEYBLOBSIZE || keylen > KEYBLOBBUFSIZE) in _copy_key_from_user() 1129 return memdup_user(ukey, keylen); in _copy_key_from_user() 1323 if (kgs.keylen < klen) { in pkey_unlocked_ioctl() 1332 kgs.keylen = klen; in pkey_unlocked_ioctl() 1365 if (kcs.keylen < klen) { in pkey_unlocked_ioctl() 1374 kcs.keylen = klen; in pkey_unlocked_ioctl() [all …]
|
/linux/fs/befs/ |
A D | btree.c | 117 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() 421 u16 keylen; in befs_btree_read() local 494 (int)keylen); in befs_btree_read() 496 if (bufsize < keylen + 1) { in befs_btree_read() 503 strlcpy(keybuf, keystart, keylen + 1); in befs_btree_read() 505 *keysize = keylen; in befs_btree_read() 508 cur_key, keylen, keybuf, *value); in befs_btree_read() 676 int index, u16 * keylen) in befs_bt_get_key() argument [all …]
|
/linux/lib/crypto/ |
A D | blake2s-selftest.c | 584 int keylen = (13 * i) % (BLAKE2S_KEY_SIZE + 1); in blake2s_selftest() local 586 blake2s(hash, buf, key + BLAKE2S_KEY_SIZE - keylen, outlen, i, in blake2s_selftest() 587 keylen); in blake2s_selftest() 593 if (!keylen) in blake2s_selftest() 597 key + BLAKE2S_KEY_SIZE - keylen, in blake2s_selftest() 598 keylen); in blake2s_selftest()
|