Lines Matching full:aes
3 * AMD Cryptographic Coprocessor (CCP) AES XTS crypto API support
15 #include <crypto/aes.h>
29 .name = "xts(aes)",
30 .drv_name = "xts-aes-ccp",
91 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey()
95 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_xts_setkey()
98 ctx->u.aes.key_len = key_len / 2; in ccp_aes_xts_setkey()
99 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_xts_setkey()
101 return crypto_skcipher_setkey(ctx->u.aes.tfm_skcipher, key, key_len); in ccp_aes_xts_setkey()
116 if (!ctx->u.aes.key_len) in ccp_aes_xts_crypt()
136 * only supports AES-128 operations; version 5 CCPs support both in ccp_aes_xts_crypt()
137 * AES-128 and -256 operations. in ccp_aes_xts_crypt()
142 (ctx->u.aes.key_len != AES_KEYSIZE_128)) in ccp_aes_xts_crypt()
144 if ((ctx->u.aes.key_len != AES_KEYSIZE_128) && in ccp_aes_xts_crypt()
145 (ctx->u.aes.key_len != AES_KEYSIZE_256)) in ccp_aes_xts_crypt()
152 ctx->u.aes.tfm_skcipher); in ccp_aes_xts_crypt()
174 rctx->cmd.u.xts.key = &ctx->u.aes.key_sg; in ccp_aes_xts_crypt()
175 rctx->cmd.u.xts.key_len = ctx->u.aes.key_len; in ccp_aes_xts_crypt()
203 ctx->u.aes.key_len = 0; in ccp_aes_xts_init_tfm()
205 fallback_tfm = crypto_alloc_skcipher("xts(aes)", 0, in ccp_aes_xts_init_tfm()
208 pr_warn("could not load fallback driver xts(aes)\n"); in ccp_aes_xts_init_tfm()
211 ctx->u.aes.tfm_skcipher = fallback_tfm; in ccp_aes_xts_init_tfm()
224 crypto_free_skcipher(ctx->u.aes.tfm_skcipher); in ccp_aes_xts_exit_tfm()