Lines Matching refs:ctx

49 		memcpy(req->result, rctx->ctx, digest_size);  in ccp_sha_complete()
61 struct ccp_ctx *ctx = crypto_ahash_ctx(tfm); in ccp_do_sha_update() local
94 sg_init_one(&rctx->ctx_sg, rctx->ctx, sizeof(rctx->ctx)); in ccp_do_sha_update()
128 rctx->cmd.u.sha.ctx = &rctx->ctx_sg; in ccp_do_sha_update()
129 rctx->cmd.u.sha.ctx_len = sizeof(rctx->ctx); in ccp_do_sha_update()
132 rctx->cmd.u.sha.opad = ctx->u.sha.key_len ? in ccp_do_sha_update()
133 &ctx->u.sha.opad_sg : NULL; in ccp_do_sha_update()
134 rctx->cmd.u.sha.opad_len = ctx->u.sha.key_len ? in ccp_do_sha_update()
135 ctx->u.sha.opad_count : 0; in ccp_do_sha_update()
150 struct ccp_ctx *ctx = crypto_ahash_ctx(tfm); in ccp_sha_init() local
162 if (ctx->u.sha.key_len) { in ccp_sha_init()
164 memcpy(rctx->buf, ctx->u.sha.ipad, block_size); in ccp_sha_init()
208 memcpy(state.ctx, rctx->ctx, sizeof(state.ctx)); in ccp_sha_export()
230 memcpy(rctx->ctx, state.ctx, sizeof(rctx->ctx)); in ccp_sha_import()
240 struct ccp_ctx *ctx = crypto_tfm_ctx(crypto_ahash_tfm(tfm)); in ccp_sha_setkey() local
241 struct crypto_shash *shash = ctx->u.sha.hmac_tfm; in ccp_sha_setkey()
250 ctx->u.sha.key_len = 0; in ccp_sha_setkey()
255 memset(ctx->u.sha.key, 0, sizeof(ctx->u.sha.key)); in ccp_sha_setkey()
264 ctx->u.sha.key); in ccp_sha_setkey()
272 memcpy(ctx->u.sha.key, key, key_len); in ccp_sha_setkey()
276 ctx->u.sha.ipad[i] = ctx->u.sha.key[i] ^ 0x36; in ccp_sha_setkey()
277 ctx->u.sha.opad[i] = ctx->u.sha.key[i] ^ 0x5c; in ccp_sha_setkey()
280 sg_init_one(&ctx->u.sha.opad_sg, ctx->u.sha.opad, block_size); in ccp_sha_setkey()
281 ctx->u.sha.opad_count = block_size; in ccp_sha_setkey()
283 ctx->u.sha.key_len = key_len; in ccp_sha_setkey()
290 struct ccp_ctx *ctx = crypto_tfm_ctx(tfm); in ccp_sha_cra_init() local
293 ctx->complete = ccp_sha_complete; in ccp_sha_cra_init()
294 ctx->u.sha.key_len = 0; in ccp_sha_cra_init()
307 struct ccp_ctx *ctx = crypto_tfm_ctx(tfm); in ccp_hmac_sha_cra_init() local
318 ctx->u.sha.hmac_tfm = hmac_tfm; in ccp_hmac_sha_cra_init()
325 struct ccp_ctx *ctx = crypto_tfm_ctx(tfm); in ccp_hmac_sha_cra_exit() local
327 if (ctx->u.sha.hmac_tfm) in ccp_hmac_sha_cra_exit()
328 crypto_free_shash(ctx->u.sha.hmac_tfm); in ccp_hmac_sha_cra_exit()