• Home
  • Raw
  • Download

Lines Matching refs:op

23 	struct sun4i_tfm_ctx *op = crypto_tfm_ctx(tfm);  in sun4i_hash_crainit()  local
27 memset(op, 0, sizeof(struct sun4i_tfm_ctx)); in sun4i_hash_crainit()
30 op->ss = algt->ss; in sun4i_hash_crainit()
40 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_init() local
45 memset(op, 0, sizeof(struct sun4i_req_ctx)); in sun4i_hash_init()
48 op->mode = algt->mode; in sun4i_hash_init()
55 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_export_md5() local
59 octx->byte_count = op->byte_count + op->len; in sun4i_hash_export_md5()
61 memcpy(octx->block, op->buf, op->len); in sun4i_hash_export_md5()
63 if (op->byte_count) { in sun4i_hash_export_md5()
65 octx->hash[i] = op->hash[i]; in sun4i_hash_export_md5()
78 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_import_md5() local
84 op->byte_count = ictx->byte_count & ~0x3F; in sun4i_hash_import_md5()
85 op->len = ictx->byte_count & 0x3F; in sun4i_hash_import_md5()
87 memcpy(op->buf, ictx->block, op->len); in sun4i_hash_import_md5()
90 op->hash[i] = ictx->hash[i]; in sun4i_hash_import_md5()
97 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_export_sha1() local
101 octx->count = op->byte_count + op->len; in sun4i_hash_export_sha1()
103 memcpy(octx->buffer, op->buf, op->len); in sun4i_hash_export_sha1()
105 if (op->byte_count) { in sun4i_hash_export_sha1()
107 octx->state[i] = op->hash[i]; in sun4i_hash_export_sha1()
121 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_import_sha1() local
127 op->byte_count = ictx->count & ~0x3F; in sun4i_hash_import_sha1()
128 op->len = ictx->count & 0x3F; in sun4i_hash_import_sha1()
130 memcpy(op->buf, ictx->buffer, op->len); in sun4i_hash_import_sha1()
133 op->hash[i] = ictx->state[i]; in sun4i_hash_import_sha1()
183 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash() local
195 op->byte_count, areq->nbytes, op->mode, in sun4i_hash()
196 op->len, op->hash[0]); in sun4i_hash()
198 if (unlikely(!areq->nbytes) && !(op->flags & SS_HASH_FINAL)) in sun4i_hash()
202 if (unlikely(areq->nbytes > UINT_MAX - op->len)) { in sun4i_hash()
207 if (op->len + areq->nbytes < 64 && !(op->flags & SS_HASH_FINAL)) { in sun4i_hash()
210 op->buf + op->len, areq->nbytes, 0); in sun4i_hash()
211 op->len += copied; in sun4i_hash()
221 if (op->byte_count) { in sun4i_hash()
224 writel(op->hash[i], ss->base + SS_IV0 + i * 4); in sun4i_hash()
227 writel(op->mode | SS_ENABLED | ivmode, ss->base + SS_CTL); in sun4i_hash()
229 if (!(op->flags & SS_HASH_UPDATE)) in sun4i_hash()
233 if (!(op->flags & SS_HASH_FINAL)) { in sun4i_hash()
234 end = ((areq->nbytes + op->len) / 64) * 64 - op->len; in sun4i_hash()
247 end = ((areq->nbytes + op->len) / 4) * 4 - op->len; in sun4i_hash()
257 if (i == 1 && !op->len && areq->nbytes) in sun4i_hash()
272 if (op->len || (mi.length - in_i) < 4) { in sun4i_hash()
278 while (op->len < 64 && i < end) { in sun4i_hash()
280 in_r = min(end - i, 64 - op->len); in sun4i_hash()
282 memcpy(op->buf + op->len, mi.addr + in_i, in_r); in sun4i_hash()
283 op->len += in_r; in sun4i_hash()
291 if (op->len > 3 && !(op->len % 4)) { in sun4i_hash()
293 writesl(ss->base + SS_RXFIFO, op->buf, in sun4i_hash()
294 op->len / 4); in sun4i_hash()
295 op->byte_count += op->len; in sun4i_hash()
296 op->len = 0; in sun4i_hash()
306 op->byte_count += todo * 4; in sun4i_hash()
326 while (i < areq->nbytes && in_i < mi.length && op->len < 64) { in sun4i_hash()
328 in_r = min(areq->nbytes - i, 64 - op->len); in sun4i_hash()
330 memcpy(op->buf + op->len, mi.addr + in_i, in_r); in sun4i_hash()
331 op->len += in_r; in sun4i_hash()
348 if (op->flags & SS_HASH_FINAL) in sun4i_hash()
351 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
375 op->hash[i] = readl(ss->base + SS_MD0 + i * 4); in sun4i_hash()
394 if (op->len) { in sun4i_hash()
395 nwait = op->len / 4; in sun4i_hash()
397 writesl(ss->base + SS_RXFIFO, op->buf, nwait); in sun4i_hash()
398 op->byte_count += 4 * nwait; in sun4i_hash()
401 nbw = op->len - 4 * nwait; in sun4i_hash()
403 wb = cpu_to_le32(*(u32 *)(op->buf + nwait * 4)); in sun4i_hash()
406 op->byte_count += nbw; in sun4i_hash()
420 fill = 64 - (op->byte_count % 64); in sun4i_hash()
430 if (op->mode == SS_OP_SHA1) { in sun4i_hash()
432 *bits = cpu_to_be64(op->byte_count << 3); in sun4i_hash()
436 *bits = cpu_to_le64(op->byte_count << 3); in sun4i_hash()
442 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL); in sun4i_hash()
472 if (op->mode == SS_OP_SHA1) { in sun4i_hash()
492 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_final() local
494 op->flags = SS_HASH_FINAL; in sun4i_hash_final()
500 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_update() local
502 op->flags = SS_HASH_UPDATE; in sun4i_hash_update()
509 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_finup() local
511 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL; in sun4i_hash_finup()
519 struct sun4i_req_ctx *op = ahash_request_ctx(areq); in sun4i_hash_digest() local
525 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL; in sun4i_hash_digest()