23 #include <crypto/aes.h>
25 #include <linux/module.h>
26 #include <linux/types.h>
61 struct xcbc_state *sctx = shash_desc_ctx(desc);
68 memset(sctx, 0,
sizeof *sctx);
78 nx_ctx->
op.outlen = (nx_ctx->
out_sg - out_sg) *
sizeof(
struct nx_sg);
83 static int nx_xcbc_update(
struct shash_desc *desc,
87 struct xcbc_state *sctx = shash_desc_ctx(desc);
91 u32 to_process, leftover;
127 sctx->
count, nx_ctx->
ap->sglen);
129 to_process - sctx->
count,
131 nx_ctx->
op.inlen = (nx_ctx->
in_sg - in_sg) *
132 sizeof(
struct nx_sg);
136 nx_ctx->
op.inlen = (nx_ctx->
in_sg - in_sg) *
137 sizeof(
struct nx_sg);
142 if (!nx_ctx->
op.inlen || !nx_ctx->
op.outlen) {
156 sctx->
count = leftover;
166 struct xcbc_state *sctx = shash_desc_ctx(desc);
169 struct nx_sg *in_sg, *out_sg;
172 if (
NX_CPB_FDM(csbcpb) & NX_FDM_CONTINUATION) {
177 }
else if (sctx->
count == 0) {
182 u8 data[] = { 0x75, 0xf0, 0x25, 0x1d, 0x52, 0x8a, 0xc0, 0x1c,
183 0x45, 0x73, 0xdf, 0xd5, 0x84, 0xd7, 0x9f, 0x29 };
184 memcpy(out, data,
sizeof(data));
193 sctx->
count, nx_ctx->
ap->sglen);
197 nx_ctx->
op.inlen = (nx_ctx->
in_sg - in_sg) *
sizeof(
struct nx_sg);
198 nx_ctx->
op.outlen = (nx_ctx->
out_sg - out_sg) *
sizeof(
struct nx_sg);
200 if (!nx_ctx->
op.outlen) {
219 .init = nx_xcbc_init,
220 .update = nx_xcbc_update,
221 .final = nx_xcbc_final,
222 .setkey = nx_xcbc_set_key,
226 .cra_name =
"xcbc(aes)",
227 .cra_driver_name =
"xcbc-aes-nx",