Lines Matching refs:desc

383 	struct encryptor_desc *desc = data;  in encryptor()  local
384 struct xdr_buf *outbuf = desc->outbuf; in encryptor()
386 crypto_sync_skcipher_reqtfm(desc->req); in encryptor()
388 int thislen = desc->fraglen + sg->length; in encryptor()
394 BUG_ON(desc->fragno > 3); in encryptor()
396 page_pos = desc->pos - outbuf->head[0].iov_len; in encryptor()
400 in_page = desc->pages[i]; in encryptor()
404 sg_set_page(&desc->infrags[desc->fragno], in_page, sg->length, in encryptor()
406 sg_set_page(&desc->outfrags[desc->fragno], sg_page(sg), sg->length, in encryptor()
408 desc->fragno++; in encryptor()
409 desc->fraglen += sg->length; in encryptor()
410 desc->pos += sg->length; in encryptor()
418 sg_mark_end(&desc->infrags[desc->fragno - 1]); in encryptor()
419 sg_mark_end(&desc->outfrags[desc->fragno - 1]); in encryptor()
421 skcipher_request_set_crypt(desc->req, desc->infrags, desc->outfrags, in encryptor()
422 thislen, desc->iv); in encryptor()
424 ret = crypto_skcipher_encrypt(desc->req); in encryptor()
428 sg_init_table(desc->infrags, 4); in encryptor()
429 sg_init_table(desc->outfrags, 4); in encryptor()
432 sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen, in encryptor()
434 desc->infrags[0] = desc->outfrags[0]; in encryptor()
435 sg_assign_page(&desc->infrags[0], in_page); in encryptor()
436 desc->fragno = 1; in encryptor()
437 desc->fraglen = fraglen; in encryptor()
439 desc->fragno = 0; in encryptor()
440 desc->fraglen = 0; in encryptor()
450 struct encryptor_desc desc; in gss_encrypt_xdr_buf() local
458 memset(desc.iv, 0, sizeof(desc.iv)); in gss_encrypt_xdr_buf()
459 desc.req = req; in gss_encrypt_xdr_buf()
460 desc.pos = offset; in gss_encrypt_xdr_buf()
461 desc.outbuf = buf; in gss_encrypt_xdr_buf()
462 desc.pages = pages; in gss_encrypt_xdr_buf()
463 desc.fragno = 0; in gss_encrypt_xdr_buf()
464 desc.fraglen = 0; in gss_encrypt_xdr_buf()
466 sg_init_table(desc.infrags, 4); in gss_encrypt_xdr_buf()
467 sg_init_table(desc.outfrags, 4); in gss_encrypt_xdr_buf()
469 ret = xdr_process_buf(buf, offset, buf->len - offset, encryptor, &desc); in gss_encrypt_xdr_buf()
485 struct decryptor_desc *desc = data; in decryptor() local
486 int thislen = desc->fraglen + sg->length; in decryptor()
488 crypto_sync_skcipher_reqtfm(desc->req); in decryptor()
493 BUG_ON(desc->fragno > 3); in decryptor()
494 sg_set_page(&desc->frags[desc->fragno], sg_page(sg), sg->length, in decryptor()
496 desc->fragno++; in decryptor()
497 desc->fraglen += sg->length; in decryptor()
505 sg_mark_end(&desc->frags[desc->fragno - 1]); in decryptor()
507 skcipher_request_set_crypt(desc->req, desc->frags, desc->frags, in decryptor()
508 thislen, desc->iv); in decryptor()
510 ret = crypto_skcipher_decrypt(desc->req); in decryptor()
514 sg_init_table(desc->frags, 4); in decryptor()
517 sg_set_page(&desc->frags[0], sg_page(sg), fraglen, in decryptor()
519 desc->fragno = 1; in decryptor()
520 desc->fraglen = fraglen; in decryptor()
522 desc->fragno = 0; in decryptor()
523 desc->fraglen = 0; in decryptor()
533 struct decryptor_desc desc; in gss_decrypt_xdr_buf() local
542 memset(desc.iv, 0, sizeof(desc.iv)); in gss_decrypt_xdr_buf()
543 desc.req = req; in gss_decrypt_xdr_buf()
544 desc.fragno = 0; in gss_decrypt_xdr_buf()
545 desc.fraglen = 0; in gss_decrypt_xdr_buf()
547 sg_init_table(desc.frags, 4); in gss_decrypt_xdr_buf()
549 ret = xdr_process_buf(buf, offset, buf->len - offset, decryptor, &desc); in gss_decrypt_xdr_buf()
681 struct encryptor_desc desc; in krb5_cbc_cts_encrypt() local
691 memset(desc.iv, 0, sizeof(desc.iv)); in krb5_cbc_cts_encrypt()
697 desc.pos = offset; in krb5_cbc_cts_encrypt()
698 desc.fragno = 0; in krb5_cbc_cts_encrypt()
699 desc.fraglen = 0; in krb5_cbc_cts_encrypt()
700 desc.pages = pages; in krb5_cbc_cts_encrypt()
701 desc.outbuf = buf; in krb5_cbc_cts_encrypt()
702 desc.req = req; in krb5_cbc_cts_encrypt()
707 sg_init_table(desc.infrags, 4); in krb5_cbc_cts_encrypt()
708 sg_init_table(desc.outfrags, 4); in krb5_cbc_cts_encrypt()
710 err = xdr_process_buf(buf, offset, cbcbytes, encryptor, &desc); in krb5_cbc_cts_encrypt()
718 desc.iv, pages, 1); in krb5_cbc_cts_encrypt()
723 memcpy(iv, desc.iv, ivsize); in krb5_cbc_cts_encrypt()
745 struct decryptor_desc desc; in krb5_cbc_cts_decrypt() local
754 memset(desc.iv, 0, sizeof(desc.iv)); in krb5_cbc_cts_decrypt()
760 desc.fragno = 0; in krb5_cbc_cts_decrypt()
761 desc.fraglen = 0; in krb5_cbc_cts_decrypt()
762 desc.req = req; in krb5_cbc_cts_decrypt()
767 sg_init_table(desc.frags, 4); in krb5_cbc_cts_decrypt()
769 err = xdr_process_buf(buf, 0, cbcbytes, decryptor, &desc); in krb5_cbc_cts_decrypt()
776 return gss_krb5_cts_crypt(cts_tfm, buf, cbcbytes, desc.iv, NULL, 0); in krb5_cbc_cts_decrypt()