Lines Matching refs:xts_ctx

534 	struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm);  in xts_fallback_setkey()  local
537 xts_ctx->fallback->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK; in xts_fallback_setkey()
538 xts_ctx->fallback->base.crt_flags |= (tfm->crt_flags & in xts_fallback_setkey()
541 ret = crypto_blkcipher_setkey(xts_ctx->fallback, key, len); in xts_fallback_setkey()
544 tfm->crt_flags |= (xts_ctx->fallback->base.crt_flags & in xts_fallback_setkey()
554 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_decrypt() local
559 desc->tfm = xts_ctx->fallback; in xts_fallback_decrypt()
571 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_fallback_encrypt() local
576 desc->tfm = xts_ctx->fallback; in xts_fallback_encrypt()
587 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_aes_set_key() local
592 xts_ctx->enc = KM_XTS_128_ENCRYPT; in xts_aes_set_key()
593 xts_ctx->dec = KM_XTS_128_DECRYPT; in xts_aes_set_key()
594 memcpy(xts_ctx->key + 16, in_key, 16); in xts_aes_set_key()
595 memcpy(xts_ctx->pcc_key + 16, in_key + 16, 16); in xts_aes_set_key()
598 xts_ctx->enc = 0; in xts_aes_set_key()
599 xts_ctx->dec = 0; in xts_aes_set_key()
603 xts_ctx->enc = KM_XTS_256_ENCRYPT; in xts_aes_set_key()
604 xts_ctx->dec = KM_XTS_256_DECRYPT; in xts_aes_set_key()
605 memcpy(xts_ctx->key, in_key, 32); in xts_aes_set_key()
606 memcpy(xts_ctx->pcc_key, in_key + 32, 32); in xts_aes_set_key()
612 xts_ctx->key_len = key_len; in xts_aes_set_key()
617 struct s390_xts_ctx *xts_ctx, in xts_aes_crypt() argument
620 unsigned int offset = (xts_ctx->key_len >> 1) & 0x10; in xts_aes_crypt()
638 memcpy(pcc_param.key, xts_ctx->pcc_key, 32); in xts_aes_crypt()
643 memcpy(xts_param.key, xts_ctx->key, 32); in xts_aes_crypt()
666 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_encrypt() local
669 if (unlikely(xts_ctx->key_len == 48)) in xts_aes_encrypt()
673 return xts_aes_crypt(desc, xts_ctx->enc, xts_ctx, &walk); in xts_aes_encrypt()
680 struct s390_xts_ctx *xts_ctx = crypto_blkcipher_ctx(desc->tfm); in xts_aes_decrypt() local
683 if (unlikely(xts_ctx->key_len == 48)) in xts_aes_decrypt()
687 return xts_aes_crypt(desc, xts_ctx->dec, xts_ctx, &walk); in xts_aes_decrypt()
693 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_init() local
695 xts_ctx->fallback = crypto_alloc_blkcipher(name, 0, in xts_fallback_init()
698 if (IS_ERR(xts_ctx->fallback)) { in xts_fallback_init()
701 return PTR_ERR(xts_ctx->fallback); in xts_fallback_init()
708 struct s390_xts_ctx *xts_ctx = crypto_tfm_ctx(tfm); in xts_fallback_exit() local
710 crypto_free_blkcipher(xts_ctx->fallback); in xts_fallback_exit()
711 xts_ctx->fallback = NULL; in xts_fallback_exit()