Lines Matching refs:crp
126 g_eli_auth_read_done(struct cryptop *crp) in g_eli_auth_read_done() argument
131 if (crp->crp_etype == EAGAIN) { in g_eli_auth_read_done()
132 if (g_eli_crypto_rerun(crp) == 0) in g_eli_auth_read_done()
135 bp = (struct bio *)crp->crp_opaque; in g_eli_auth_read_done()
138 if (crp->crp_etype == 0) { in g_eli_auth_read_done()
139 bp->bio_completed += crp->crp_payload_length; in g_eli_auth_read_done()
141 bp->bio_inbed, bp->bio_children, crp->crp_payload_length, (intmax_t)bp->bio_completed); in g_eli_auth_read_done()
156 rel_sec = ((crp->crp_buf.cb_buf + crp->crp_payload_start) - in g_eli_auth_read_done()
161 *errorp = crp->crp_etype; in g_eli_auth_read_done()
164 bp->bio_inbed, bp->bio_children, crp->crp_etype); in g_eli_auth_read_done()
166 bp->bio_error = crp->crp_etype == EBADMSG ? in g_eli_auth_read_done()
167 EINTEGRITY : crp->crp_etype; in g_eli_auth_read_done()
169 if (crp->crp_cipher_key != NULL) in g_eli_auth_read_done()
170 g_eli_key_drop(sc, __DECONST(void *, crp->crp_cipher_key)); in g_eli_auth_read_done()
171 crypto_freereq(crp); in g_eli_auth_read_done()
288 g_eli_auth_write_done(struct cryptop *crp) in g_eli_auth_write_done() argument
295 if (crp->crp_etype == EAGAIN) { in g_eli_auth_write_done()
296 if (g_eli_crypto_rerun(crp) == 0) in g_eli_auth_write_done()
299 bp = (struct bio *)crp->crp_opaque; in g_eli_auth_write_done()
301 if (crp->crp_etype == 0) { in g_eli_auth_write_done()
306 bp->bio_inbed, bp->bio_children, crp->crp_etype); in g_eli_auth_write_done()
308 bp->bio_error = crp->crp_etype; in g_eli_auth_write_done()
311 if (crp->crp_cipher_key != NULL) in g_eli_auth_write_done()
312 g_eli_key_drop(sc, __DECONST(void *, crp->crp_cipher_key)); in g_eli_auth_write_done()
313 crypto_freereq(crp); in g_eli_auth_write_done()
452 struct cryptop *crp; in g_eli_auth_run() local
515 crp = crypto_getreq(wr->w_sid, M_WAITOK); in g_eli_auth_run()
546 crypto_use_buf(crp, data, sc->sc_alen + data_secsize); in g_eli_auth_run()
547 crp->crp_opaque = (void *)bp; in g_eli_auth_run()
549 crp->crp_flags = CRYPTO_F_CBIFSYNC; in g_eli_auth_run()
551 crp->crp_callback = g_eli_auth_write_done; in g_eli_auth_run()
552 crp->crp_op = CRYPTO_OP_ENCRYPT | in g_eli_auth_run()
555 crp->crp_callback = g_eli_auth_read_done; in g_eli_auth_run()
556 crp->crp_op = CRYPTO_OP_DECRYPT | in g_eli_auth_run()
560 crp->crp_digest_start = 0; in g_eli_auth_run()
561 crp->crp_payload_start = sc->sc_alen; in g_eli_auth_run()
562 crp->crp_payload_length = data_secsize; in g_eli_auth_run()
564 crp->crp_cipher_key = g_eli_key_hold(sc, dstoff, in g_eli_auth_run()
568 crp->crp_flags |= CRYPTO_F_IV_SEPARATE; in g_eli_auth_run()
569 g_eli_crypto_ivgen(sc, dstoff, crp->crp_iv, in g_eli_auth_run()
570 sizeof(crp->crp_iv)); in g_eli_auth_run()
574 crp->crp_auth_key = authkey; in g_eli_auth_run()
577 TAILQ_INSERT_TAIL(&crpq, crp, crp_next); in g_eli_auth_run()
579 error = crypto_dispatch(crp); in g_eli_auth_run()