Lines Matching full:aes
3 * AMD Cryptographic Coprocessor (CCP) AES crypto API support
16 #include <crypto/aes.h>
31 if (ctx->u.aes.mode != CCP_AES_MODE_ECB) in ccp_aes_complete()
45 ctx->u.aes.type = CCP_AES_TYPE_128; in ccp_aes_setkey()
48 ctx->u.aes.type = CCP_AES_TYPE_192; in ccp_aes_setkey()
51 ctx->u.aes.type = CCP_AES_TYPE_256; in ccp_aes_setkey()
56 ctx->u.aes.mode = alg->mode; in ccp_aes_setkey()
57 ctx->u.aes.key_len = key_len; in ccp_aes_setkey()
59 memcpy(ctx->u.aes.key, key, key_len); in ccp_aes_setkey()
60 sg_init_one(&ctx->u.aes.key_sg, ctx->u.aes.key, key_len); in ccp_aes_setkey()
73 if (!ctx->u.aes.key_len) in ccp_aes_crypt()
76 if (((ctx->u.aes.mode == CCP_AES_MODE_ECB) || in ccp_aes_crypt()
77 (ctx->u.aes.mode == CCP_AES_MODE_CBC)) && in ccp_aes_crypt()
81 if (ctx->u.aes.mode != CCP_AES_MODE_ECB) { in ccp_aes_crypt()
94 rctx->cmd.u.aes.type = ctx->u.aes.type; in ccp_aes_crypt()
95 rctx->cmd.u.aes.mode = ctx->u.aes.mode; in ccp_aes_crypt()
96 rctx->cmd.u.aes.action = in ccp_aes_crypt()
98 rctx->cmd.u.aes.key = &ctx->u.aes.key_sg; in ccp_aes_crypt()
99 rctx->cmd.u.aes.key_len = ctx->u.aes.key_len; in ccp_aes_crypt()
100 rctx->cmd.u.aes.iv = iv_sg; in ccp_aes_crypt()
101 rctx->cmd.u.aes.iv_len = iv_len; in ccp_aes_crypt()
102 rctx->cmd.u.aes.src = req->src; in ccp_aes_crypt()
103 rctx->cmd.u.aes.src_len = req->cryptlen; in ccp_aes_crypt()
104 rctx->cmd.u.aes.dst = req->dst; in ccp_aes_crypt()
124 ctx->u.aes.key_len = 0; in ccp_aes_init_tfm()
152 memcpy(ctx->u.aes.nonce, key + key_len, CTR_RFC3686_NONCE_SIZE); in ccp_aes_rfc3686_setkey()
166 memcpy(iv, ctx->u.aes.nonce, CTR_RFC3686_NONCE_SIZE); in ccp_aes_rfc3686_crypt()
196 ctx->u.aes.key_len = 0; in ccp_aes_rfc3686_init_tfm()
253 .name = "ecb(aes)",
254 .driver_name = "ecb-aes-ccp",
262 .name = "cbc(aes)",
263 .driver_name = "cbc-aes-ccp",
271 .name = "cfb(aes)",
272 .driver_name = "cfb-aes-ccp",
280 .name = "ofb(aes)",
281 .driver_name = "ofb-aes-ccp",
289 .name = "ctr(aes)",
290 .driver_name = "ctr-aes-ccp",
298 .name = "rfc3686(ctr(aes))",
299 .driver_name = "rfc3686-ctr-aes-ccp",