Lines Matching defs:desc
63 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
80 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, length);
97 struct blkcipher_desc desc = { .tfm = tfm, .info = local_iv };
113 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, length);
122 struct hash_desc *desc = data;
124 return crypto_hash_update(desc, sg, sg->length);
155 struct hash_desc desc;
188 desc.tfm = md5;
189 desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
191 err = crypto_hash_init(&desc);
195 err = crypto_hash_update(&desc, sg, 4);
200 err = crypto_hash_update(&desc, sg, hdrlen);
204 checksummer, &desc);
207 err = crypto_hash_final(&desc, checksumdata);
211 desc.tfm = hmac_md5;
212 desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
214 err = crypto_hash_init(&desc);
222 err = crypto_hash_digest(&desc, sg, crypto_hash_digestsize(md5),
245 struct hash_desc desc;
262 desc.tfm = crypto_alloc_hash(kctx->gk5e->cksum_name, 0, CRYPTO_ALG_ASYNC);
263 if (IS_ERR(desc.tfm))
265 desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
267 checksumlen = crypto_hash_digestsize(desc.tfm);
270 err = crypto_hash_setkey(desc.tfm, cksumkey,
276 err = crypto_hash_init(&desc);
280 err = crypto_hash_update(&desc, sg, hdrlen);
284 checksummer, &desc);
287 err = crypto_hash_final(&desc, checksumdata);
310 crypto_free_hash(desc.tfm);
326 struct hash_desc desc;
343 desc.tfm = crypto_alloc_hash(kctx->gk5e->cksum_name, 0,
345 if (IS_ERR(desc.tfm))
347 checksumlen = crypto_hash_digestsize(desc.tfm);
348 desc.flags = CRYPTO_TFM_REQ_MAY_SLEEP;
350 err = crypto_hash_setkey(desc.tfm, cksumkey, kctx->gk5e->keylength);
354 err = crypto_hash_init(&desc);
358 checksummer, &desc);
363 err = crypto_hash_update(&desc, sg, hdrlen);
367 err = crypto_hash_final(&desc, checksumdata);
384 crypto_free_hash(desc.tfm);
390 struct blkcipher_desc desc;
403 struct encryptor_desc *desc = data;
404 struct xdr_buf *outbuf = desc->outbuf;
406 int thislen = desc->fraglen + sg->length;
412 BUG_ON(desc->fragno > 3);
414 page_pos = desc->pos - outbuf->head[0].iov_len;
418 in_page = desc->pages[i];
422 sg_set_page(&desc->infrags[desc->fragno], in_page, sg->length,
424 sg_set_page(&desc->outfrags[desc->fragno], sg_page(sg), sg->length,
426 desc->fragno++;
427 desc->fraglen += sg->length;
428 desc->pos += sg->length;
430 fraglen = thislen & (crypto_blkcipher_blocksize(desc->desc.tfm) - 1);
436 sg_mark_end(&desc->infrags[desc->fragno - 1]);
437 sg_mark_end(&desc->outfrags[desc->fragno - 1]);
439 ret = crypto_blkcipher_encrypt_iv(&desc->desc, desc->outfrags,
440 desc->infrags, thislen);
444 sg_init_table(desc->infrags, 4);
445 sg_init_table(desc->outfrags, 4);
448 sg_set_page(&desc->outfrags[0], sg_page(sg), fraglen,
450 desc->infrags[0] = desc->outfrags[0];
451 sg_assign_page(&desc->infrags[0], in_page);
452 desc->fragno = 1;
453 desc->fraglen = fraglen;
455 desc->fragno = 0;
456 desc->fraglen = 0;
466 struct encryptor_desc desc;
470 memset(desc.iv, 0, sizeof(desc.iv));
471 desc.desc.tfm = tfm;
472 desc.desc.info = desc.iv;
473 desc.desc.flags = 0;
474 desc.pos = offset;
475 desc.outbuf = buf;
476 desc.pages = pages;
477 desc.fragno = 0;
478 desc.fraglen = 0;
480 sg_init_table(desc.infrags, 4);
481 sg_init_table(desc.outfrags, 4);
483 ret = xdr_process_buf(buf, offset, buf->len - offset, encryptor, &desc);
489 struct blkcipher_desc desc;
498 struct decryptor_desc *desc = data;
499 int thislen = desc->fraglen + sg->length;
504 BUG_ON(desc->fragno > 3);
505 sg_set_page(&desc->frags[desc->fragno], sg_page(sg), sg->length,
507 desc->fragno++;
508 desc->fraglen += sg->length;
510 fraglen = thislen & (crypto_blkcipher_blocksize(desc->desc.tfm) - 1);
516 sg_mark_end(&desc->frags[desc->fragno - 1]);
518 ret = crypto_blkcipher_decrypt_iv(&desc->desc, desc->frags,
519 desc->frags, thislen);
523 sg_init_table(desc->frags, 4);
526 sg_set_page(&desc->frags[0], sg_page(sg), fraglen,
528 desc->fragno = 1;
529 desc->fraglen = fraglen;
531 desc->fragno = 0;
532 desc->fraglen = 0;
541 struct decryptor_desc desc;
546 memset(desc.iv, 0, sizeof(desc.iv));
547 desc.desc.tfm = tfm;
548 desc.desc.info = desc.iv;
549 desc.desc.flags = 0;
550 desc.fragno = 0;
551 desc.fraglen = 0;
553 sg_init_table(desc.frags, 4);
555 return xdr_process_buf(buf, offset, buf->len - offset, decryptor, &desc);
602 struct blkcipher_desc desc = { .tfm = cipher, .info = iv };
626 ret = crypto_blkcipher_encrypt_iv(&desc, sg, sg, len);
628 ret = crypto_blkcipher_decrypt_iv(&desc, sg, sg, len);
651 struct encryptor_desc desc;
721 memset(desc.iv, 0, sizeof(desc.iv));
724 desc.pos = offset + GSS_KRB5_TOK_HDR_LEN;
725 desc.fragno = 0;
726 desc.fraglen = 0;
727 desc.pages = pages;
728 desc.outbuf = buf;
729 desc.desc.info = desc.iv;
730 desc.desc.flags = 0;
731 desc.desc.tfm = aux_cipher;
733 sg_init_table(desc.infrags, 4);
734 sg_init_table(desc.outfrags, 4);
737 cbcbytes, encryptor, &desc);
745 desc.iv, pages, 1);
773 struct decryptor_desc desc;
801 memset(desc.iv, 0, sizeof(desc.iv));
804 desc.fragno = 0;
805 desc.fraglen = 0;
806 desc.desc.info = desc.iv;
807 desc.desc.flags = 0;
808 desc.desc.tfm = aux_cipher;
810 sg_init_table(desc.frags, 4);
812 ret = xdr_process_buf(&subbuf, 0, cbcbytes, decryptor, &desc);
818 ret = gss_krb5_cts_crypt(cipher, &subbuf, cbcbytes, desc.iv, NULL, 0);
859 struct hash_desc desc;
874 desc.tfm = hmac;
875 desc.flags = 0;
877 err = crypto_hash_init(&desc);
889 err = crypto_hash_digest(&desc, sg, 4, Kseq);
900 err = crypto_hash_digest(&desc, sg, 8, Kseq);
925 struct hash_desc desc;
941 desc.tfm = hmac;
942 desc.flags = 0;
944 err = crypto_hash_init(&desc);
959 err = crypto_hash_digest(&desc, sg, 4, Kcrypt);
975 err = crypto_hash_digest(&desc, sg, 4, Kcrypt);