Lines Matching refs:ctx

75 	struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);  in crypto4xx_encrypt()  local
77 ctx->direction = DIR_OUTBOUND; in crypto4xx_encrypt()
78 ctx->hash_final = 0; in crypto4xx_encrypt()
79 ctx->is_hash = 0; in crypto4xx_encrypt()
80 ctx->pd_ctl = 0x1; in crypto4xx_encrypt()
82 return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, in crypto4xx_encrypt()
84 get_dynamic_sa_iv_size(ctx)); in crypto4xx_encrypt()
89 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_decrypt() local
91 ctx->direction = DIR_INBOUND; in crypto4xx_decrypt()
92 ctx->hash_final = 0; in crypto4xx_decrypt()
93 ctx->is_hash = 0; in crypto4xx_decrypt()
94 ctx->pd_ctl = 1; in crypto4xx_decrypt()
96 return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, in crypto4xx_decrypt()
98 get_dynamic_sa_iv_size(ctx)); in crypto4xx_decrypt()
111 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); in crypto4xx_setkey_aes() local
123 if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) in crypto4xx_setkey_aes()
124 crypto4xx_free_sa(ctx); in crypto4xx_setkey_aes()
126 rc = crypto4xx_alloc_sa(ctx, SA_AES128_LEN + (keylen-16) / 4); in crypto4xx_setkey_aes()
130 if (ctx->state_record_dma_addr == 0) { in crypto4xx_setkey_aes()
131 rc = crypto4xx_alloc_state_record(ctx); in crypto4xx_setkey_aes()
133 crypto4xx_free_sa(ctx); in crypto4xx_setkey_aes()
138 sa = (struct dynamic_sa_ctl *) ctx->sa_in; in crypto4xx_setkey_aes()
139 ctx->hash_final = 0; in crypto4xx_setkey_aes()
153 crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), in crypto4xx_setkey_aes()
157 ctx->is_hash = 0; in crypto4xx_setkey_aes()
158 ctx->direction = DIR_INBOUND; in crypto4xx_setkey_aes()
159 memcpy(ctx->sa_in + get_dynamic_sa_offset_state_ptr_field(ctx), in crypto4xx_setkey_aes()
160 (void *)&ctx->state_record_dma_addr, 4); in crypto4xx_setkey_aes()
161 ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); in crypto4xx_setkey_aes()
163 memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); in crypto4xx_setkey_aes()
164 sa = (struct dynamic_sa_ctl *) ctx->sa_out; in crypto4xx_setkey_aes()
187 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); in crypto4xx_hash_alg_init() local
192 ctx->dev = my_alg->dev; in crypto4xx_hash_alg_init()
193 ctx->is_hash = 1; in crypto4xx_hash_alg_init()
194 ctx->hash_final = 0; in crypto4xx_hash_alg_init()
197 if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) in crypto4xx_hash_alg_init()
198 crypto4xx_free_sa(ctx); in crypto4xx_hash_alg_init()
200 rc = crypto4xx_alloc_sa(ctx, sa_len); in crypto4xx_hash_alg_init()
204 if (ctx->state_record_dma_addr == 0) { in crypto4xx_hash_alg_init()
205 crypto4xx_alloc_state_record(ctx); in crypto4xx_hash_alg_init()
206 if (!ctx->state_record_dma_addr) { in crypto4xx_hash_alg_init()
207 crypto4xx_free_sa(ctx); in crypto4xx_hash_alg_init()
214 sa = (struct dynamic_sa_ctl *) ctx->sa_in; in crypto4xx_hash_alg_init()
225 ctx->direction = DIR_INBOUND; in crypto4xx_hash_alg_init()
227 sa_in = (struct dynamic_sa_hash160 *) ctx->sa_in; in crypto4xx_hash_alg_init()
231 sa_in->state_ptr = ctx->state_record_dma_addr; in crypto4xx_hash_alg_init()
232 ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(ctx); in crypto4xx_hash_alg_init()
239 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_hash_init() local
243 sa = (struct dynamic_sa_ctl *) ctx->sa_in; in crypto4xx_hash_init()
248 ctx->is_hash = 1; in crypto4xx_hash_init()
249 ctx->direction = DIR_INBOUND; in crypto4xx_hash_init()
256 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_hash_update() local
258 ctx->is_hash = 1; in crypto4xx_hash_update()
259 ctx->hash_final = 0; in crypto4xx_hash_update()
260 ctx->pd_ctl = 0x11; in crypto4xx_hash_update()
261 ctx->direction = DIR_INBOUND; in crypto4xx_hash_update()
263 return crypto4xx_build_pd(&req->base, ctx, req->src, in crypto4xx_hash_update()
275 struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); in crypto4xx_hash_digest() local
277 ctx->hash_final = 1; in crypto4xx_hash_digest()
278 ctx->pd_ctl = 0x11; in crypto4xx_hash_digest()
279 ctx->direction = DIR_INBOUND; in crypto4xx_hash_digest()
281 return crypto4xx_build_pd(&req->base, ctx, req->src, in crypto4xx_hash_digest()