Lines Matching refs:ctx
35 u8 ctx[]; member
51 u8 ctx[]; member
58 struct cmac_tfm_ctx *ctx = crypto_shash_ctx(parent); in crypto_cmac_digest_setkey() local
60 __be64 *consts = PTR_ALIGN((void *)ctx->ctx, alignmask + 1); in crypto_cmac_digest_setkey()
65 err = crypto_cipher_setkey(ctx->child, inkey, keylen); in crypto_cmac_digest_setkey()
71 crypto_cipher_encrypt_one(ctx->child, (u8 *)consts, (u8 *)consts); in crypto_cmac_digest_setkey()
111 struct cmac_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_cmac_digest_init() local
113 u8 *prev = PTR_ALIGN((void *)ctx->ctx, alignmask + 1) + bs; in crypto_cmac_digest_init()
115 ctx->len = 0; in crypto_cmac_digest_init()
127 struct cmac_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_cmac_digest_update() local
130 u8 *odds = PTR_ALIGN((void *)ctx->ctx, alignmask + 1); in crypto_cmac_digest_update()
134 if ((ctx->len + len) <= bs) { in crypto_cmac_digest_update()
135 memcpy(odds + ctx->len, p, len); in crypto_cmac_digest_update()
136 ctx->len += len; in crypto_cmac_digest_update()
141 memcpy(odds + ctx->len, p, bs - ctx->len); in crypto_cmac_digest_update()
142 len -= bs - ctx->len; in crypto_cmac_digest_update()
143 p += bs - ctx->len; in crypto_cmac_digest_update()
149 ctx->len = 0; in crypto_cmac_digest_update()
162 ctx->len = len; in crypto_cmac_digest_update()
173 struct cmac_desc_ctx *ctx = shash_desc_ctx(pdesc); in crypto_cmac_digest_final() local
176 u8 *consts = PTR_ALIGN((void *)tctx->ctx, alignmask + 1); in crypto_cmac_digest_final()
177 u8 *odds = PTR_ALIGN((void *)ctx->ctx, alignmask + 1); in crypto_cmac_digest_final()
181 if (ctx->len != bs) { in crypto_cmac_digest_final()
183 u8 *p = odds + ctx->len; in crypto_cmac_digest_final()
188 rlen = bs - ctx->len - 1; in crypto_cmac_digest_final()
208 struct cmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); in cmac_init_tfm() local
214 ctx->child = cipher; in cmac_init_tfm()
221 struct cmac_tfm_ctx *ctx = crypto_tfm_ctx(tfm); in cmac_exit_tfm() local
222 crypto_free_cipher(ctx->child); in cmac_exit_tfm()