Lines Matching refs:op

20 	struct sun4i_tfm_ctx *op = crypto_tfm_ctx(tfm);  in sun4i_hash_crainit()  local
25 memset(op, 0, sizeof(struct sun4i_tfm_ctx)); in sun4i_hash_crainit()
28 op->ss = algt->ss; in sun4i_hash_crainit()
30 err = pm_runtime_resume_and_get(op->ss->dev); in sun4i_hash_crainit()
41 struct sun4i_tfm_ctx *op = crypto_tfm_ctx(tfm); in sun4i_hash_craexit() local
43 pm_runtime_put(op->ss->dev); in sun4i_hash_craexit()
49 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_init() local
54 memset(op, 0, sizeof(struct sun4i_req_ctx)); in sun4i_hash_init()
57 op->mode = algt->mode; in sun4i_hash_init()
64 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_export_md5() local
68 octx->byte_count = op->byte_count + op->len; in sun4i_hash_export_md5()
70 memcpy(octx->block, op->buf, op->len); in sun4i_hash_export_md5()
72 if (op->byte_count) { in sun4i_hash_export_md5()
74 octx->hash[i] = op->hash[i]; in sun4i_hash_export_md5()
87 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_import_md5() local
93 op->byte_count = ictx->byte_count & ~0x3F; in sun4i_hash_import_md5()
94 op->len = ictx->byte_count & 0x3F; in sun4i_hash_import_md5()
96 memcpy(op->buf, ictx->block, op->len); in sun4i_hash_import_md5()
99 op->hash[i] = ictx->hash[i]; in sun4i_hash_import_md5()
106 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_export_sha1() local
110 octx->count = op->byte_count + op->len; in sun4i_hash_export_sha1()
112 memcpy(octx->buffer, op->buf, op->len); in sun4i_hash_export_sha1()
114 if (op->byte_count) { in sun4i_hash_export_sha1()
116 octx->state[i] = op->hash[i]; in sun4i_hash_export_sha1()
130 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_import_sha1() local
136 op->byte_count = ictx->count & ~0x3F; in sun4i_hash_import_sha1()
137 op->len = ictx->count & 0x3F; in sun4i_hash_import_sha1()
139 memcpy(op->buf, ictx->buffer, op->len); in sun4i_hash_import_sha1()
142 op->hash[i] = ictx->state[i]; in sun4i_hash_import_sha1()
192 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash() local
206 op->byte_count, areq->nbytes, op->mode, in sun4i_hash()
207 op->len, op->hash[0]); in sun4i_hash()
209 if (unlikely(!areq->nbytes) && !(op->flags & SS_HASH_FINAL)) in sun4i_hash()
213 if (unlikely(areq->nbytes > UINT_MAX - op->len)) { in sun4i_hash()
218 if (op->len + areq->nbytes < 64 && !(op->flags & SS_HASH_FINAL)) { in sun4i_hash()
221 op->buf + op->len, areq->nbytes, 0); in sun4i_hash()
222 op->len += copied; in sun4i_hash()
232 if (op->byte_count) { in sun4i_hash()
235 writel(op->hash[i], ss->base + SS_IV0 + i * 4); in sun4i_hash()
238 writel(op->mode | SS_ENABLED | ivmode, ss->base + SS_CTL); in sun4i_hash()
240 if (!(op->flags & SS_HASH_UPDATE)) in sun4i_hash()
244 if (!(op->flags & SS_HASH_FINAL)) { in sun4i_hash()
245 end = ((areq->nbytes + op->len) / 64) * 64 - op->len; in sun4i_hash()
258 end = ((areq->nbytes + op->len) / 4) * 4 - op->len; in sun4i_hash()
268 if (i == 1 && !op->len && areq->nbytes) in sun4i_hash()
283 if (op->len || (mi.length - in_i) < 4) { in sun4i_hash()
289 while (op->len < 64 && i < end) { in sun4i_hash()
291 in_r = min(end - i, 64 - op->len); in sun4i_hash()
293 memcpy(op->buf + op->len, mi.addr + in_i, in_r); in sun4i_hash()
294 op->len += in_r; in sun4i_hash()
302 if (op->len > 3 && !(op->len % 4)) { in sun4i_hash()
304 writesl(ss->base + SS_RXFIFO, op->buf, in sun4i_hash()
305 op->len / 4); in sun4i_hash()
306 op->byte_count += op->len; in sun4i_hash()
307 op->len = 0; in sun4i_hash()
317 op->byte_count += todo * 4; in sun4i_hash()
337 while (i < areq->nbytes && in_i < mi.length && op->len < 64) { in sun4i_hash()
339 in_r = min(areq->nbytes - i, 64 - op->len); in sun4i_hash()
341 memcpy(op->buf + op->len, mi.addr + in_i, in_r); in sun4i_hash()
342 op->len += in_r; in sun4i_hash()
359 if (op->flags & SS_HASH_FINAL) in sun4i_hash()
362 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
386 op->hash[i] = readl(ss->base + SS_MD0 + i * 4); in sun4i_hash()
409 if (op->len) { in sun4i_hash()
410 nwait = op->len / 4; in sun4i_hash()
412 writesl(ss->base + SS_RXFIFO, op->buf, nwait); in sun4i_hash()
413 op->byte_count += 4 * nwait; in sun4i_hash()
416 nbw = op->len - 4 * nwait; in sun4i_hash()
418 wb = le32_to_cpup((__le32 *)(op->buf + nwait * 4)); in sun4i_hash()
421 op->byte_count += nbw; in sun4i_hash()
435 fill = 64 - (op->byte_count % 64); in sun4i_hash()
445 if (op->mode == SS_OP_SHA1) { in sun4i_hash()
447 *bits = cpu_to_be64(op->byte_count << 3); in sun4i_hash()
451 *bits = cpu_to_le64(op->byte_count << 3); in sun4i_hash()
457 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
487 if (op->mode == SS_OP_SHA1) { in sun4i_hash()
510 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_final() local
512 op->flags = SS_HASH_FINAL; in sun4i_hash_final()
518 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_update() local
520 op->flags = SS_HASH_UPDATE; in sun4i_hash_update()
527 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_finup() local
529 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL; in sun4i_hash_finup()
537 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_digest() local
543 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL; in sun4i_hash_digest()