Lines Matching refs:ctx

42 	u8 ctx[];  member
58 u8 ctx[]; member
65 struct xcbc_tfm_ctx *ctx = crypto_shash_ctx(parent); in crypto_xcbc_digest_setkey() local
67 u8 *consts = PTR_ALIGN(&ctx->ctx[0], alignmask + 1); in crypto_xcbc_digest_setkey()
71 if ((err = crypto_cipher_setkey(ctx->child, inkey, keylen))) in crypto_xcbc_digest_setkey()
74 crypto_cipher_encrypt_one(ctx->child, consts, (u8 *)ks + bs); in crypto_xcbc_digest_setkey()
75 crypto_cipher_encrypt_one(ctx->child, consts + bs, (u8 *)ks + bs * 2); in crypto_xcbc_digest_setkey()
76 crypto_cipher_encrypt_one(ctx->child, key1, (u8 *)ks); in crypto_xcbc_digest_setkey()
78 return crypto_cipher_setkey(ctx->child, key1, bs); in crypto_xcbc_digest_setkey()
85 struct xcbc_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_xcbc_digest_init() local
87 u8 *prev = PTR_ALIGN(&ctx->ctx[0], alignmask + 1) + bs; in crypto_xcbc_digest_init()
89 ctx->len = 0; in crypto_xcbc_digest_init()
101 struct xcbc_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_xcbc_digest_update() local
104 u8 *odds = PTR_ALIGN(&ctx->ctx[0], alignmask + 1); in crypto_xcbc_digest_update()
108 if ((ctx->len + len) <= bs) { in crypto_xcbc_digest_update()
109 memcpy(odds + ctx->len, p, len); in crypto_xcbc_digest_update()
110 ctx->len += len; in crypto_xcbc_digest_update()
115 memcpy(odds + ctx->len, p, bs - ctx->len); in crypto_xcbc_digest_update()
116 len -= bs - ctx->len; in crypto_xcbc_digest_update()
117 p += bs - ctx->len; in crypto_xcbc_digest_update()
123 ctx->len = 0; in crypto_xcbc_digest_update()
136 ctx->len = len; in crypto_xcbc_digest_update()
147 struct xcbc_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_xcbc_digest_final() local
150 u8 *consts = PTR_ALIGN(&tctx->ctx[0], alignmask + 1); in crypto_xcbc_digest_final()
151 u8 *odds = PTR_ALIGN(&ctx->ctx[0], alignmask + 1); in crypto_xcbc_digest_final()
155 if (ctx->len != bs) { in crypto_xcbc_digest_final()
157 u8 *p = odds + ctx->len; in crypto_xcbc_digest_final()
162 rlen = bs - ctx->len -1; in crypto_xcbc_digest_final()
182 struct xcbc_tfm_ctx *ctx = crypto_tfm_ctx(tfm); in xcbc_init_tfm() local
188 ctx->child = cipher; in xcbc_init_tfm()
195 struct xcbc_tfm_ctx *ctx = crypto_tfm_ctx(tfm); in xcbc_exit_tfm() local
196 crypto_free_cipher(ctx->child); in xcbc_exit_tfm()