Lines Matching refs:op

20 	struct sun4i_tfm_ctx *op = crypto_tfm_ctx(tfm);
25 memset(op, 0, sizeof(struct sun4i_tfm_ctx));
28 op->ss = algt->ss;
30 err = pm_runtime_get_sync(op->ss->dev);
41 struct sun4i_tfm_ctx *op = crypto_tfm_ctx(tfm);
43 pm_runtime_put(op->ss->dev);
49 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
54 memset(op, 0, sizeof(struct sun4i_req_ctx));
57 op->mode = algt->mode;
64 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
68 octx->byte_count = op->byte_count + op->len;
70 memcpy(octx->block, op->buf, op->len);
72 if (op->byte_count) {
74 octx->hash[i] = op->hash[i];
87 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
93 op->byte_count = ictx->byte_count & ~0x3F;
94 op->len = ictx->byte_count & 0x3F;
96 memcpy(op->buf, ictx->block, op->len);
99 op->hash[i] = ictx->hash[i];
106 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
110 octx->count = op->byte_count + op->len;
112 memcpy(octx->buffer, op->buf, op->len);
114 if (op->byte_count) {
116 octx->state[i] = op->hash[i];
130 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
136 op->byte_count = ictx->count & ~0x3F;
137 op->len = ictx->count & 0x3F;
139 memcpy(op->buf, ictx->buffer, op->len);
142 op->hash[i] = ictx->state[i];
161 * The extra bytes will go to a temporary buffer op->buf storing op->len bytes
164 * if op->len + areq->nbytes < 64
165 * => all data will be written to wait buffer (op->buf) and end=0
166 * if not, write all data from op->buf to the device and position end to
170 * update1 60o => op->len=60
173 * so write all data from op->buf and one word of SGs
174 * write remaining data in op->buf
175 * final state op->len=56
192 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
204 op->byte_count, areq->nbytes, op->mode,
205 op->len, op->hash[0]);
207 if (unlikely(!areq->nbytes) && !(op->flags & SS_HASH_FINAL))
211 if (unlikely(areq->nbytes > UINT_MAX - op->len)) {
216 if (op->len + areq->nbytes < 64 && !(op->flags & SS_HASH_FINAL)) {
217 /* linearize data to op->buf */
219 op->buf + op->len, areq->nbytes, 0);
220 op->len += copied;
230 if (op->byte_count) {
233 writel(op->hash[i], ss->base + SS_IV0 + i * 4);
236 writel(op->mode | SS_ENABLED | ivmode, ss->base + SS_CTL);
238 if (!(op->flags & SS_HASH_UPDATE))
242 if (!(op->flags & SS_HASH_FINAL)) {
243 end = ((areq->nbytes + op->len) / 64) * 64 - op->len;
256 end = ((areq->nbytes + op->len) / 4) * 4 - op->len;
259 /* TODO if SGlen % 4 and !op->len then DMA */
266 if (i == 1 && !op->len && areq->nbytes)
281 if (op->len || (mi.length - in_i) < 4) {
287 while (op->len < 64 && i < end) {
289 in_r = min(end - i, 64 - op->len);
291 memcpy(op->buf + op->len, mi.addr + in_i, in_r);
292 op->len += in_r;
300 if (op->len > 3 && !(op->len % 4)) {
302 writesl(ss->base + SS_RXFIFO, op->buf,
303 op->len / 4);
304 op->byte_count += op->len;
305 op->len = 0;
315 op->byte_count += todo * 4;
332 * store the remaining bytes in op->buf
335 while (i < areq->nbytes && in_i < mi.length && op->len < 64) {
337 in_r = min(areq->nbytes - i, 64 - op->len);
339 memcpy(op->buf + op->len, mi.addr + in_i, in_r);
340 op->len += in_r;
357 if (op->flags & SS_HASH_FINAL)
360 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL);
384 op->hash[i] = readl(ss->base + SS_MD0 + i * 4);
403 if (op->len) {
404 nwait = op->len / 4;
406 writesl(ss->base + SS_RXFIFO, op->buf, nwait);
407 op->byte_count += 4 * nwait;
410 nbw = op->len - 4 * nwait;
412 wb = le32_to_cpup((__le32 *)(op->buf + nwait * 4));
415 op->byte_count += nbw;
429 fill = 64 - (op->byte_count % 64);
439 if (op->mode == SS_OP_SHA1) {
441 *bits = cpu_to_be64(op->byte_count << 3);
445 *bits = cpu_to_le64(op->byte_count << 3);
451 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL);
481 if (op->mode == SS_OP_SHA1) {
504 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
506 op->flags = SS_HASH_FINAL;
512 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
514 op->flags = SS_HASH_UPDATE;
521 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
523 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL;
531 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
537 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL;