/fs/smb/server/ |
D | crypto_ctx.c | 34 crypto_free_shash(shash->tfm); in free_shash() 41 struct crypto_aead *tfm = NULL; in alloc_aead() local 45 tfm = crypto_alloc_aead("gcm(aes)", 0, 0); in alloc_aead() 48 tfm = crypto_alloc_aead("ccm(aes)", 0, 0); in alloc_aead() 55 if (IS_ERR(tfm)) { in alloc_aead() 56 pr_err("Failed to alloc encrypt aead : %ld\n", PTR_ERR(tfm)); in alloc_aead() 60 return tfm; in alloc_aead() 65 struct crypto_shash *tfm = NULL; in alloc_shash_desc() local 70 tfm = crypto_alloc_shash("hmac(md5)", 0, 0); in alloc_shash_desc() 73 tfm = crypto_alloc_shash("hmac(sha256)", 0, 0); in alloc_shash_desc() [all …]
|
D | crypto_ctx.h | 45 #define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm) 47 ((c)->desc[CRYPTO_SHASH_HMACSHA256]->tfm) 48 #define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm) 49 #define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm) 50 #define CRYPTO_SHA512_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA512]->tfm)
|
D | auth.c | 1115 struct crypto_aead *tfm; in ksmbd_crypt_message() local 1140 tfm = CRYPTO_GCM(ctx); in ksmbd_crypt_message() 1142 tfm = CRYPTO_CCM(ctx); in ksmbd_crypt_message() 1146 rc = crypto_aead_setkey(tfm, key, SMB3_GCM256_CRYPTKEY_SIZE); in ksmbd_crypt_message() 1148 rc = crypto_aead_setkey(tfm, key, SMB3_GCM128_CRYPTKEY_SIZE); in ksmbd_crypt_message() 1154 rc = crypto_aead_setauthsize(tfm, SMB2_SIGNATURE_SIZE); in ksmbd_crypt_message() 1160 req = aead_request_alloc(tfm, GFP_KERNEL); in ksmbd_crypt_message() 1178 iv_len = crypto_aead_ivsize(tfm); in ksmbd_crypt_message()
|
/fs/verity/ |
D | hash_algs.c | 47 struct crypto_ahash *tfm; in fsverity_get_hash_alg() local 58 if (likely(smp_load_acquire(&alg->tfm) != NULL)) in fsverity_get_hash_alg() 63 if (alg->tfm != NULL) in fsverity_get_hash_alg() 70 tfm = crypto_alloc_ahash(alg->name, 0, 0); in fsverity_get_hash_alg() 71 if (IS_ERR(tfm)) { in fsverity_get_hash_alg() 72 if (PTR_ERR(tfm) == -ENOENT) { in fsverity_get_hash_alg() 81 alg->name, PTR_ERR(tfm)); in fsverity_get_hash_alg() 82 alg = ERR_CAST(tfm); in fsverity_get_hash_alg() 87 if (WARN_ON(alg->digest_size != crypto_ahash_digestsize(tfm))) in fsverity_get_hash_alg() 89 if (WARN_ON(alg->block_size != crypto_ahash_blocksize(tfm))) in fsverity_get_hash_alg() [all …]
|
D | fsverity_private.h | 26 struct crypto_ahash *tfm; /* hash tfm, allocated on demand */ member
|
/fs/crypto/ |
D | keysetup.c | 103 struct crypto_skcipher *tfm; in fscrypt_allocate_skcipher() local 106 tfm = crypto_alloc_skcipher(mode->cipher_str, 0, 0); in fscrypt_allocate_skcipher() 107 if (IS_ERR(tfm)) { in fscrypt_allocate_skcipher() 108 if (PTR_ERR(tfm) == -ENOENT) { in fscrypt_allocate_skcipher() 115 mode->cipher_str, PTR_ERR(tfm)); in fscrypt_allocate_skcipher() 116 return tfm; in fscrypt_allocate_skcipher() 126 mode->friendly_name, crypto_skcipher_driver_name(tfm)); in fscrypt_allocate_skcipher() 128 if (WARN_ON_ONCE(crypto_skcipher_ivsize(tfm) != mode->ivsize)) { in fscrypt_allocate_skcipher() 132 crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS); in fscrypt_allocate_skcipher() 133 err = crypto_skcipher_setkey(tfm, raw_key, mode->keysize); in fscrypt_allocate_skcipher() [all …]
|
D | keysetup_v1.c | 55 struct crypto_skcipher *tfm = crypto_alloc_skcipher("ecb(aes)", 0, 0); in derive_key_aes() local 57 if (IS_ERR(tfm)) { in derive_key_aes() 58 res = PTR_ERR(tfm); in derive_key_aes() 59 tfm = NULL; in derive_key_aes() 62 crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS); in derive_key_aes() 63 req = skcipher_request_alloc(tfm, GFP_KERNEL); in derive_key_aes() 71 res = crypto_skcipher_setkey(tfm, nonce, FSCRYPT_FILE_NONCE_SIZE); in derive_key_aes() 82 crypto_free_skcipher(tfm); in derive_key_aes()
|
D | fname.c | 104 struct crypto_skcipher *tfm = ci->ci_enc_key.tfm; in fscrypt_fname_encrypt() local 122 req = skcipher_request_alloc(tfm, GFP_NOFS); in fscrypt_fname_encrypt() 161 struct crypto_skcipher *tfm = ci->ci_enc_key.tfm; in fname_decrypt() local 166 req = skcipher_request_alloc(tfm, GFP_NOFS); in fname_decrypt()
|
D | crypto.c | 111 struct crypto_skcipher *tfm = ci->ci_enc_key.tfm; in fscrypt_crypt_data_unit() local 121 req = skcipher_request_alloc(tfm, gfp_flags); in fscrypt_crypt_data_unit()
|
D | fscrypt_private.h | 227 struct crypto_skcipher *tfm; member 437 return smp_load_acquire(&prep_key->tfm) != NULL; in fscrypt_is_key_prepared() 483 return smp_load_acquire(&prep_key->tfm) != NULL; in fscrypt_is_key_prepared()
|
D | hkdf.c | 133 desc->tfm = hkdf->hmac_tfm; in fscrypt_hkdf_expand()
|
/fs/ubifs/ |
D | auth.c | 73 hash_desc->tfm = c->hash_tfm; in ubifs_prepare_auth_node() 91 struct crypto_shash *tfm) in ubifs_get_desc() argument 99 desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(tfm), GFP_KERNEL); in ubifs_get_desc() 103 desc->tfm = tfm; in ubifs_get_desc() 398 shash->tfm = c->hmac_tfm; in ubifs_node_calc_hmac() 481 state = kmalloc(crypto_shash_descsize(src->tfm), GFP_NOFS); in __ubifs_shash_copy_state() 518 shash->tfm = c->hmac_tfm; in ubifs_hmac_wkm()
|
D | replay.c | 569 hash_desc->tfm = c->hash_tfm; in authenticate_sleb_hash()
|
/fs/smb/client/ |
D | smb2transport.c | 260 rc = crypto_shash_setkey(shash->tfm, ses->auth_key.response, in smb2_calc_signature() 329 rc = crypto_shash_setkey(server->secmech.hmacsha256->tfm, in generate_key() 581 rc = crypto_shash_setkey(shash->tfm, key, SMB2_CMACAES_SIZE); in smb3_calc_signature() 907 struct crypto_aead *tfm; in smb3_crypto_aead_allocate() local 912 tfm = crypto_alloc_aead("gcm(aes)", 0, 0); in smb3_crypto_aead_allocate() 914 tfm = crypto_alloc_aead("ccm(aes)", 0, 0); in smb3_crypto_aead_allocate() 915 if (IS_ERR(tfm)) { in smb3_crypto_aead_allocate() 918 return PTR_ERR(tfm); in smb3_crypto_aead_allocate() 920 server->secmech.enc = tfm; in smb3_crypto_aead_allocate() 926 tfm = crypto_alloc_aead("gcm(aes)", 0, 0); in smb3_crypto_aead_allocate() [all …]
|
D | cifsencrypt.c | 422 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5->tfm, nt_hash, in calc_ntlmv2_hash() 525 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5->tfm, in CalcNTLMv2_response() 649 rc = crypto_shash_setkey(ses->server->secmech.hmacmd5->tfm, in setup_ntlmv2_rsp()
|
D | misc.c | 1118 (*sdesc)->tfm = alg; in cifs_alloc_hash() 1134 if ((*sdesc)->tfm) { in cifs_free_hash() 1135 crypto_free_shash((*sdesc)->tfm); in cifs_free_hash() 1136 (*sdesc)->tfm = NULL; in cifs_free_hash()
|
D | smb2ops.c | 4352 static void *smb2_aead_req_alloc(struct crypto_aead *tfm, const struct smb_rqst *rqst, in smb2_aead_req_alloc() argument 4357 unsigned int req_size = sizeof(**req) + crypto_aead_reqsize(tfm); in smb2_aead_req_alloc() 4358 unsigned int iv_size = crypto_aead_ivsize(tfm); in smb2_aead_req_alloc() 4365 len += crypto_aead_alignmask(tfm) & ~(crypto_tfm_ctx_alignment() - 1); in smb2_aead_req_alloc() 4375 *iv = (u8 *)PTR_ALIGN(p, crypto_aead_alignmask(tfm) + 1); in smb2_aead_req_alloc() 4383 static void *smb2_get_aead_req(struct crypto_aead *tfm, const struct smb_rqst *rqst, in smb2_get_aead_req() argument 4394 p = smb2_aead_req_alloc(tfm, rqst, num_rqst, sig, iv, req, sgl, &num_sgs); in smb2_get_aead_req() 4477 struct crypto_aead *tfm; in crypt_message() local 4494 tfm = enc ? server->secmech.enc : server->secmech.dec; in crypt_message() 4498 rc = crypto_aead_setkey(tfm, key, SMB3_GCM256_CRYPTKEY_SIZE); in crypt_message() [all …]
|
/fs/ecryptfs/ |
D | crypto.c | 156 struct crypto_shash *tfm; in ecryptfs_init_crypt_stat() local 159 tfm = crypto_alloc_shash(ECRYPTFS_DEFAULT_HASH, 0, 0); in ecryptfs_init_crypt_stat() 160 if (IS_ERR(tfm)) { in ecryptfs_init_crypt_stat() 161 rc = PTR_ERR(tfm); in ecryptfs_init_crypt_stat() 173 crypt_stat->hash_tfm = tfm; in ecryptfs_init_crypt_stat() 189 crypto_free_skcipher(crypt_stat->tfm); in ecryptfs_destroy_crypt_stat() 309 req = skcipher_request_alloc(crypt_stat->tfm, GFP_NOFS); in crypt_scatterlist() 321 rc = crypto_skcipher_setkey(crypt_stat->tfm, crypt_stat->key, in crypt_scatterlist() 565 if (crypt_stat->tfm) { in ecryptfs_init_crypt_ctx() 573 crypt_stat->tfm = crypto_alloc_skcipher(full_alg_name, 0, 0); in ecryptfs_init_crypt_ctx() [all …]
|
D | keystore.c | 758 s->hash_desc->tfm = s->hash_tfm; in ecryptfs_write_tag_70_packet() 1652 struct crypto_skcipher *tfm; in decrypt_passphrase_encrypted_session_key() local 1664 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&tfm, &tfm_mutex, in decrypt_passphrase_encrypted_session_key() 1695 req = skcipher_request_alloc(tfm, GFP_KERNEL); in decrypt_passphrase_encrypted_session_key() 1700 crypto_skcipher_driver_name(tfm)); in decrypt_passphrase_encrypted_session_key() 1708 tfm, auth_tok->token.password.session_key_encryption_key, in decrypt_passphrase_encrypted_session_key() 2190 struct crypto_skcipher *tfm; in write_tag_3_packet() local 2197 rc = ecryptfs_get_tfm_and_mutex_for_cipher_name(&tfm, &tfm_mutex, in write_tag_3_packet() 2208 crypto_skcipher_max_keysize(tfm)); in write_tag_3_packet() 2210 crypto_skcipher_max_keysize(tfm); in write_tag_3_packet() [all …]
|
D | ecryptfs_kernel.h | 239 struct crypto_skcipher *tfm; member 647 int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_skcipher **tfm,
|
/fs/pstore/ |
D | platform.c | 93 static struct crypto_comp *tfm; variable 276 ret = crypto_comp_compress(tfm, in, inlen, out, &outlen); in pstore_compress() 296 if (!psinfo || tfm) in allocate_buf_for_compression() 327 tfm = ctx; in allocate_buf_for_compression() 336 if (IS_ENABLED(CONFIG_PSTORE_COMPRESS) && tfm) { in free_buf_for_compression() 337 crypto_free_comp(tfm); in free_buf_for_compression() 338 tfm = NULL; in free_buf_for_compression() 705 ret = crypto_comp_decompress(tfm, record->buf, record->size, in decompress_record()
|
/fs/nfsd/ |
D | nfs4recover.c | 112 struct crypto_shash *tfm; in nfs4_make_rec_clidname() local 117 tfm = crypto_alloc_shash("md5", 0, 0); in nfs4_make_rec_clidname() 118 if (IS_ERR(tfm)) { in nfs4_make_rec_clidname() 119 status = PTR_ERR(tfm); in nfs4_make_rec_clidname() 123 cksum.len = crypto_shash_digestsize(tfm); in nfs4_make_rec_clidname() 130 status = crypto_shash_tfm_digest(tfm, clname->data, clname->len, in nfs4_make_rec_clidname() 140 crypto_free_shash(tfm); in nfs4_make_rec_clidname() 1140 struct crypto_shash *tfm = cn->cn_tfm; in nfsd4_cld_create_v2() local 1164 cksum.len = crypto_shash_digestsize(tfm); in nfsd4_cld_create_v2() 1170 ret = crypto_shash_tfm_digest(tfm, principal, strlen(principal), in nfsd4_cld_create_v2() [all …]
|
/fs/incfs/ |
D | integrity.c | 218 desc->tfm = alg->shash; in incfs_calc_digest()
|
D | verity.c | 137 d->tfm = alg->shash; in incfs_compute_file_digest()
|
/fs/btrfs/ |
D | file-item.c | 677 shash->tfm = fs_info->csum_shash; in btrfs_csum_one_bio()
|