Lines Matching refs:kcaop

53 static int get_userbuf_tls(struct csession *ses, struct kernel_crypt_auth_op *kcaop,  in get_userbuf_tls()  argument
57 struct crypt_auth_op *caop = &kcaop->caop; in get_userbuf_tls()
69 if (kcaop->dst_len == 0) { in get_userbuf_tls()
74 pagecount = PAGECOUNT(caop->dst, kcaop->dst_len); in get_userbuf_tls()
83 rc = __cryptodev_get_userbuf(caop->dst, kcaop->dst_len, 1, pagecount, in get_userbuf_tls()
84 ses->pages, ses->sg, kcaop->task, kcaop->mm); in get_userbuf_tls()
104 static int get_userbuf_srtp(struct csession *ses, struct kernel_crypt_auth_op *kcaop, in get_userbuf_srtp() argument
109 struct crypt_auth_op *caop = &kcaop->caop; in get_userbuf_srtp()
126 if (unlikely(kcaop->dst_len == 0 || caop->auth_len == 0)) { in get_userbuf_srtp()
150 ses->pages, ses->sg, kcaop->task, kcaop->mm); in get_userbuf_srtp()
213 static int fill_kcaop_from_caop(struct kernel_crypt_auth_op *kcaop, struct fcrypt *fcr) in fill_kcaop_from_caop() argument
215 struct crypt_auth_op *caop = &kcaop->caop; in fill_kcaop_from_caop()
237 kcaop->ivlen = caop->iv ? ses_ptr->cdata.ivsize : 0; in fill_kcaop_from_caop()
238 kcaop->dst_len = cryptodev_get_dst_len(caop, ses_ptr); in fill_kcaop_from_caop()
239 kcaop->task = current; in fill_kcaop_from_caop()
240 kcaop->mm = current->mm; in fill_kcaop_from_caop()
243 ret = copy_from_user(kcaop->iv, caop->iv, kcaop->ivlen); in fill_kcaop_from_caop()
246 kcaop->ivlen, ret, caop->iv); in fill_kcaop_from_caop()
260 static int fill_caop_from_kcaop(struct kernel_crypt_auth_op *kcaop, struct fcrypt *fcr) in fill_caop_from_kcaop() argument
264 kcaop->caop.len = kcaop->dst_len; in fill_caop_from_kcaop()
266 if (kcaop->ivlen && kcaop->caop.flags & COP_FLAG_WRITE_IV) { in fill_caop_from_kcaop()
267 ret = copy_to_user(kcaop->caop.iv, in fill_caop_from_kcaop()
268 kcaop->iv, kcaop->ivlen); in fill_caop_from_kcaop()
278 int cryptodev_kcaop_from_user(struct kernel_crypt_auth_op *kcaop, in cryptodev_kcaop_from_user() argument
281 if (unlikely(copy_from_user(&kcaop->caop, arg, sizeof(kcaop->caop)))) { in cryptodev_kcaop_from_user()
286 return fill_kcaop_from_caop(kcaop, fcr); in cryptodev_kcaop_from_user()
289 int cryptodev_kcaop_to_user(struct kernel_crypt_auth_op *kcaop, in cryptodev_kcaop_to_user() argument
294 ret = fill_caop_from_kcaop(kcaop, fcr); in cryptodev_kcaop_to_user()
300 if (unlikely(copy_to_user(arg, &kcaop->caop, sizeof(kcaop->caop)))) { in cryptodev_kcaop_to_user()
346 int compat_kcaop_from_user(struct kernel_crypt_auth_op *kcaop, in compat_kcaop_from_user() argument
358 compat_to_crypt_auth_op(&compat_auth_cop, &kcaop->caop); in compat_kcaop_from_user()
360 return fill_kcaop_from_caop(kcaop, fcr); in compat_kcaop_from_user()
363 int compat_kcaop_to_user(struct kernel_crypt_auth_op *kcaop, in compat_kcaop_to_user() argument
369 ret = fill_caop_from_kcaop(kcaop, fcr); in compat_kcaop_to_user()
375 crypt_auth_op_to_compat(&kcaop->caop, &compat_auth_cop); in compat_kcaop_to_user()
437 tls_auth_n_crypt(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop, in tls_auth_n_crypt() argument
442 struct crypt_auth_op *caop = &kcaop->caop; in tls_auth_n_crypt()
551 kcaop->dst_len = len; in tls_auth_n_crypt()
559 srtp_auth_n_crypt(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop, in srtp_auth_n_crypt() argument
564 struct crypt_auth_op *caop = &kcaop->caop; in srtp_auth_n_crypt()
640 kcaop->dst_len = len; in srtp_auth_n_crypt()
644 static int rk_auth_n_crypt(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop, in rk_auth_n_crypt() argument
650 struct crypt_auth_op *caop = &kcaop->caop; in rk_auth_n_crypt()
687 auth_n_crypt(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop, in auth_n_crypt() argument
693 struct crypt_auth_op *caop = &kcaop->caop; in auth_n_crypt()
716 kcaop->dst_len = len + caop->tag_len; in auth_n_crypt()
726 kcaop->dst_len = len - caop->tag_len; in auth_n_crypt()
733 static int crypto_auth_zc_srtp(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop) in crypto_auth_zc_srtp() argument
736 struct crypt_auth_op *caop = &kcaop->caop; in crypto_auth_zc_srtp()
745 ret = get_userbuf_srtp(ses_ptr, kcaop, &auth_sg, &dst_sg); in crypto_auth_zc_srtp()
751 ret = srtp_auth_n_crypt(ses_ptr, kcaop, auth_sg, caop->auth_len, in crypto_auth_zc_srtp()
759 static int crypto_auth_zc_tls(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop) in crypto_auth_zc_tls() argument
761 struct crypt_auth_op *caop = &kcaop->caop; in crypto_auth_zc_tls()
791 ret = get_userbuf_tls(ses_ptr, kcaop, &dst_sg); in crypto_auth_zc_tls()
797 ret = tls_auth_n_crypt(ses_ptr, kcaop, auth_sg, caop->auth_len, in crypto_auth_zc_tls()
806 static int crypto_auth_zc_aead(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop) in crypto_auth_zc_aead() argument
810 struct crypt_auth_op *caop = &kcaop->caop; in crypto_auth_zc_aead()
839 ret = cryptodev_get_userbuf(ses_ptr, caop->src, caop->len, caop->dst, kcaop->dst_len, in crypto_auth_zc_aead()
840 kcaop->task, kcaop->mm, &src_sg, &dst_sg); in crypto_auth_zc_aead()
860 ret = auth_n_crypt(ses_ptr, kcaop, auth_sg, caop->auth_len, in crypto_auth_zc_aead()
886 ret = auth_n_crypt(ses_ptr, kcaop, NULL, caop->auth_len, in crypto_auth_zc_aead()
918 static int crypto_auth_zc_rk(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop) in crypto_auth_zc_rk() argument
924 struct crypt_auth_op *caop = &kcaop->caop; in crypto_auth_zc_rk()
941 caop->dst, kcaop->dst_len, in crypto_auth_zc_rk()
942 kcaop->task, kcaop->mm, &src_sg, &dst_sg); in crypto_auth_zc_rk()
1006 ret = rk_auth_n_crypt(ses_ptr, kcaop, NULL, caop->auth_len, in crypto_auth_zc_rk()
1009 ret = rk_auth_n_crypt(ses_ptr, kcaop, NULL, caop->auth_len, in crypto_auth_zc_rk()
1013 if (unlikely(copy_to_user(kcaop->caop.tag, tag_buf, caop->tag_len))) { in crypto_auth_zc_rk()
1033 __crypto_auth_run_zc(struct csession *ses_ptr, struct kernel_crypt_auth_op *kcaop) in __crypto_auth_run_zc() argument
1035 struct crypt_auth_op *caop = &kcaop->caop; in __crypto_auth_run_zc()
1039 ret = crypto_auth_zc_srtp(ses_ptr, kcaop); in __crypto_auth_run_zc()
1042 ret = crypto_auth_zc_tls(ses_ptr, kcaop); in __crypto_auth_run_zc()
1045 ret = crypto_auth_zc_rk(ses_ptr, kcaop); in __crypto_auth_run_zc()
1047 ret = crypto_auth_zc_aead(ses_ptr, kcaop); in __crypto_auth_run_zc()
1056 int crypto_auth_run(struct fcrypt *fcr, struct kernel_crypt_auth_op *kcaop) in crypto_auth_run() argument
1059 struct crypt_auth_op *caop = &kcaop->caop; in crypto_auth_run()
1089 cryptodev_cipher_set_iv(&ses_ptr->cdata, kcaop->iv, in crypto_auth_run()
1090 min(ses_ptr->cdata.ivsize, kcaop->ivlen)); in crypto_auth_run()
1092 ret = __crypto_auth_run_zc(ses_ptr, kcaop); in crypto_auth_run()
1100 cryptodev_cipher_get_iv(&ses_ptr->cdata, kcaop->iv, in crypto_auth_run()
1101 min(ses_ptr->cdata.ivsize, kcaop->ivlen)); in crypto_auth_run()