Lines Matching refs:xts_ctx

535 	struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm);  in xts_fallback_setkey()  local
538 xts_ctx->fallback->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in xts_fallback_setkey()
539 xts_ctx->fallback->base.crt_flags |= (tfm->crt_flags & in xts_fallback_setkey()
542 ret = crypto_blkcipher_setkey(xts_ctx->fallback, key, len); in xts_fallback_setkey()
545 tfm->crt_flags |= (xts_ctx->fallback->base.crt_flags & in xts_fallback_setkey()
555 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_decrypt() local
560 desc->tfm = xts_ctx->fallback; in xts_fallback_decrypt()
572 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_encrypt() local
577 desc->tfm = xts_ctx->fallback; in xts_fallback_encrypt()
588 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_aes_set_key() local
593 xts_ctx->enc = KM_XTS_128_ENCRYPT; in xts_aes_set_key()
594 xts_ctx->dec = KM_XTS_128_DECRYPT; in xts_aes_set_key()
595 memcpy(xts_ctx->key + 16, in_key, 16); in xts_aes_set_key()
596 memcpy(xts_ctx->pcc_key + 16, in_key + 16, 16); in xts_aes_set_key()
599 xts_ctx->enc = 0; in xts_aes_set_key()
600 xts_ctx->dec = 0; in xts_aes_set_key()
604 xts_ctx->enc = KM_XTS_256_ENCRYPT; in xts_aes_set_key()
605 xts_ctx->dec = KM_XTS_256_DECRYPT; in xts_aes_set_key()
606 memcpy(xts_ctx->key, in_key, 32); in xts_aes_set_key()
607 memcpy(xts_ctx->pcc_key, in_key + 32, 32); in xts_aes_set_key()
613 xts_ctx->key_len = key_len; in xts_aes_set_key()
618 struct s390_xts_ctx *xts_ctx, in xts_aes_crypt() argument
621 unsigned int offset = (xts_ctx->key_len >> 1) & 0x10; in xts_aes_crypt()
639 memcpy(pcc_param.key, xts_ctx->pcc_key, 32); in xts_aes_crypt()
644 memcpy(xts_param.key, xts_ctx->key, 32); in xts_aes_crypt()
667 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_encrypt() local
670 if (unlikely(xts_ctx->key_len == 48)) in xts_aes_encrypt()
674 return xts_aes_crypt(desc, xts_ctx->enc, xts_ctx, &walk); in xts_aes_encrypt()
681 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_decrypt() local
684 if (unlikely(xts_ctx->key_len == 48)) in xts_aes_decrypt()
688 return xts_aes_crypt(desc, xts_ctx->dec, xts_ctx, &walk); in xts_aes_decrypt()
694 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_init() local
696 xts_ctx->fallback = crypto_alloc_blkcipher(name, 0, in xts_fallback_init()
699 if (IS_ERR(xts_ctx->fallback)) { in xts_fallback_init()
702 return PTR_ERR(xts_ctx->fallback); in xts_fallback_init()
709 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_exit() local
711 crypto_free_blkcipher(xts_ctx->fallback); in xts_fallback_exit()
712 xts_ctx->fallback = NULL; in xts_fallback_exit()