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_resume_and_get(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);
206 op->byte_count, areq->nbytes, op->mode,
207 op->len, op->hash[0]);
209 if (unlikely(!areq->nbytes) && !(op->flags & SS_HASH_FINAL))
213 if (unlikely(areq->nbytes > UINT_MAX - op->len)) {
218 if (op->len + areq->nbytes < 64 && !(op->flags & SS_HASH_FINAL)) {
219 /* linearize data to op->buf */
221 op->buf + op->len, areq->nbytes, 0);
222 op->len += copied;
232 if (op->byte_count) {
235 writel(op->hash[i], ss->base + SS_IV0 + i * 4);
238 writel(op->mode | SS_ENABLED | ivmode, ss->base + SS_CTL);
240 if (!(op->flags & SS_HASH_UPDATE))
244 if (!(op->flags & SS_HASH_FINAL)) {
245 end = ((areq->nbytes + op->len) / 64) * 64 - op->len;
258 end = ((areq->nbytes + op->len) / 4) * 4 - op->len;
261 /* TODO if SGlen % 4 and !op->len then DMA */
268 if (i == 1 && !op->len && areq->nbytes)
283 if (op->len || (mi.length - in_i) < 4) {
289 while (op->len < 64 && i < end) {
291 in_r = min(end - i, 64 - op->len);
293 memcpy(op->buf + op->len, mi.addr + in_i, in_r);
294 op->len += in_r;
302 if (op->len > 3 && !(op->len % 4)) {
304 writesl(ss->base + SS_RXFIFO, op->buf,
305 op->len / 4);
306 op->byte_count += op->len;
307 op->len = 0;
317 op->byte_count += todo * 4;
334 * store the remaining bytes in op->buf
337 while (i < areq->nbytes && in_i < mi.length && op->len < 64) {
339 in_r = min(areq->nbytes - i, 64 - op->len);
341 memcpy(op->buf + op->len, mi.addr + in_i, in_r);
342 op->len += in_r;
359 if (op->flags & SS_HASH_FINAL)
362 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL);
386 op->hash[i] = readl(ss->base + SS_MD0 + i * 4);
409 if (op->len) {
410 nwait = op->len / 4;
412 writesl(ss->base + SS_RXFIFO, op->buf, nwait);
413 op->byte_count += 4 * nwait;
416 nbw = op->len - 4 * nwait;
418 wb = le32_to_cpup((__le32 *)(op->buf + nwait * 4));
421 op->byte_count += nbw;
435 fill = 64 - (op->byte_count % 64);
445 if (op->mode == SS_OP_SHA1) {
447 *bits = cpu_to_be64(op->byte_count << 3);
451 *bits = cpu_to_le64(op->byte_count << 3);
457 writel(op->mode | SS_ENABLED | SS_DATA_END, ss->base + SS_CTL);
487 if (op->mode == SS_OP_SHA1) {
510 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
512 op->flags = SS_HASH_FINAL;
518 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
520 op->flags = SS_HASH_UPDATE;
527 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
529 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL;
537 struct sun4i_req_ctx *op = ahash_request_ctx(areq);
543 op->flags = SS_HASH_UPDATE | SS_HASH_FINAL;