Home | History | Annotate | Download | only in opencrypto

Lines Matching refs:ctx

52 	aesxcbc_ctx *ctx;
55 ctx = vctx;
56 memset(ctx, 0, sizeof(*ctx));
60 ctx->r_nr = aes_setenckey128(&r_ks, key);
63 ctx->r_nr = aes_setenckey192(&r_ks, key);
66 ctx->r_nr = aes_setenckey256(&r_ks, key);
69 aes_enc(&r_ks, k1seed, k1, ctx->r_nr);
70 aes_enc(&r_ks, k2seed, ctx->k2, ctx->r_nr);
71 aes_enc(&r_ks, k3seed, ctx->k3, ctx->r_nr);
72 aes_setenckey128(&ctx->r_k1s, k1);
84 aesxcbc_ctx *ctx;
88 ctx = vctx;
91 if (ctx->buflen == sizeof(ctx->buf)) {
92 for (i = 0; i < sizeof(ctx->e); i++)
93 ctx->buf[i] ^= ctx->e[i];
94 aes_enc(&ctx->r_k1s, ctx->buf, ctx->e, ctx->r_nr);
95 ctx->buflen = 0;
97 if (ctx->buflen + len < sizeof(ctx->buf)) {
98 memcpy(ctx->buf + ctx->buflen, addr, len);
99 ctx->buflen += len;
102 if (ctx->buflen && ctx->buflen + len > sizeof(ctx->buf)) {
103 memcpy(ctx->buf + ctx->buflen, addr,
104 sizeof(ctx->buf) - ctx->buflen);
105 for (i = 0; i < sizeof(ctx->e); i++)
106 ctx->buf[i] ^= ctx->e[i];
107 aes_enc(&ctx->r_k1s, ctx->buf, ctx->e, ctx->r_nr);
108 addr += sizeof(ctx->buf) - ctx->buflen;
109 ctx->buflen = 0;
115 buf[i] ^= ctx->e[i];
116 aes_enc(&ctx->r_k1s, buf, ctx->e, ctx->r_nr);
120 memcpy(ctx->buf + ctx->buflen, addr, ep - addr);
121 ctx->buflen += ep - addr;
130 aesxcbc_ctx *ctx;
133 ctx = vctx;
135 if (ctx->buflen == sizeof(ctx->buf)) {
136 for (i = 0; i < sizeof(ctx->buf); i++) {
137 ctx->buf[i] ^= ctx->e[i];
138 ctx->buf[i] ^= ctx->k2[i];
140 aes_enc(&ctx->r_k1s, ctx->buf, digest, ctx->r_nr);
142 for (i = ctx->buflen; i < sizeof(ctx->buf); i++)
143 ctx->buf[i] = (i == ctx->buflen) ? 0x80 : 0x00;
144 for (i = 0; i < sizeof(ctx->buf); i++) {
145 ctx->buf[i] ^= ctx->e[i];
146 ctx->buf[i] ^= ctx->k3[i];
148 aes_enc(&ctx->r_k1s, ctx->buf, digest, ctx->r_nr);