Lines Matching defs:tfm
64 static inline enum cc_key_type cc_key_type(struct crypto_tfm *tfm)
66 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
151 static int cc_cipher_init(struct crypto_tfm *tfm)
153 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
155 container_of(tfm->__crt_alg, struct cc_crypto_alg,
162 crypto_tfm_alg_name(tfm));
169 const char *name = crypto_tfm_alg_name(tfm);
171 /* Alloc hash tfm for essiv */
174 dev_err(dev, "Error allocating hash tfm for ESSIV.\n");
179 /* Alloc fallabck tfm or essiv when key size != 256 bit */
195 crypto_skcipher_set_reqsize(__crypto_skcipher_cast(tfm),
229 static void cc_cipher_exit(struct crypto_tfm *tfm)
231 struct crypto_alg *alg = tfm->__crt_alg;
236 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
240 crypto_tfm_ctx(tfm), crypto_tfm_alg_name(tfm));
243 /* Free hash tfm for essiv */
301 struct crypto_tfm *tfm = crypto_skcipher_tfm(sktfm);
302 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
307 ctx_p, crypto_tfm_alg_name(tfm), keylen);
401 struct crypto_tfm *tfm = crypto_skcipher_tfm(sktfm);
402 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
405 container_of(tfm->__crt_alg, struct cc_crypto_alg,
410 ctx_p, crypto_tfm_alg_name(tfm), keylen);
424 unsigned int flags = crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_MASK;
460 xts_check_key(tfm, key, keylen)) {
507 static void cc_setup_readiv_desc(struct crypto_tfm *tfm,
512 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
563 static void cc_setup_state_desc(struct crypto_tfm *tfm,
569 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
607 static void cc_setup_xex_state_desc(struct crypto_tfm *tfm,
613 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
641 if (cc_key_type(tfm) == CC_HW_PROTECTED_KEY) {
685 static void cc_setup_key_desc(struct crypto_tfm *tfm,
690 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
710 if (cc_key_type(tfm) == CC_POLICY_PROTECTED_KEY) {
717 if (cc_key_type(tfm) == CC_HW_PROTECTED_KEY) {
750 if (cc_key_type(tfm) == CC_HW_PROTECTED_KEY) {
767 static void cc_setup_mlli_desc(struct crypto_tfm *tfm,
773 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
794 static void cc_setup_flow_desc(struct crypto_tfm *tfm,
800 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
878 struct crypto_tfm *tfm = crypto_skcipher_tfm(sk_tfm);
885 struct cc_cipher_ctx *ctx_p = crypto_tfm_ctx(tfm);
956 cc_setup_state_desc(tfm, req_ctx, ivsize, nbytes, desc, &seq_len);
958 cc_setup_mlli_desc(tfm, req_ctx, dst, src, nbytes, req, desc, &seq_len);
960 cc_setup_key_desc(tfm, req_ctx, nbytes, desc, &seq_len);
962 cc_setup_xex_state_desc(tfm, req_ctx, ivsize, nbytes, desc, &seq_len);
964 cc_setup_flow_desc(tfm, req_ctx, dst, src, nbytes, desc, &seq_len);
966 cc_setup_readiv_desc(tfm, req_ctx, ivsize, desc, &seq_len);