• Home
  • Raw
  • Download

Lines Matching refs:tsgl

529 static int init_test_sglist(struct test_sglist *tsgl)  in init_test_sglist()  argument
531 return __testmgr_alloc_buf(tsgl->bufs, 1 /* two pages per buffer */); in init_test_sglist()
534 static void destroy_test_sglist(struct test_sglist *tsgl) in destroy_test_sglist() argument
536 return __testmgr_free_buf(tsgl->bufs, 1 /* two pages per buffer */); in destroy_test_sglist()
557 static int build_test_sglist(struct test_sglist *tsgl, in build_test_sglist() argument
572 BUILD_BUG_ON(ARRAY_SIZE(partitions) != ARRAY_SIZE(tsgl->sgl)); in build_test_sglist()
577 tsgl->nents = 0; in build_test_sglist()
585 partitions[tsgl->nents].div = &divs[i]; in build_test_sglist()
586 partitions[tsgl->nents].length = len_this_sg; in build_test_sglist()
587 tsgl->nents++; in build_test_sglist()
591 if (tsgl->nents == 0) { in build_test_sglist()
592 partitions[tsgl->nents].div = &divs[0]; in build_test_sglist()
593 partitions[tsgl->nents].length = 0; in build_test_sglist()
594 tsgl->nents++; in build_test_sglist()
596 partitions[tsgl->nents - 1].length += len_remaining; in build_test_sglist()
599 sg_init_table(tsgl->sgl, tsgl->nents); in build_test_sglist()
600 for (i = 0; i < tsgl->nents; i++) { in build_test_sglist()
614 addr = &tsgl->bufs[i][offset]; in build_test_sglist()
615 sg_set_buf(&tsgl->sgl[i], addr, partitions[i].length); in build_test_sglist()
635 sg_mark_end(&tsgl->sgl[tsgl->nents - 1]); in build_test_sglist()
636 tsgl->sgl_ptr = tsgl->sgl; in build_test_sglist()
637 memcpy(tsgl->sgl_saved, tsgl->sgl, tsgl->nents * sizeof(tsgl->sgl[0])); in build_test_sglist()
652 static int verify_correct_output(const struct test_sglist *tsgl, in verify_correct_output() argument
660 for (i = 0; i < tsgl->nents; i++) { in verify_correct_output()
661 struct scatterlist *sg = &tsgl->sgl_ptr[i]; in verify_correct_output()
690 static bool is_test_sglist_corrupted(const struct test_sglist *tsgl) in is_test_sglist_corrupted() argument
694 for (i = 0; i < tsgl->nents; i++) { in is_test_sglist_corrupted()
695 if (tsgl->sgl[i].page_link != tsgl->sgl_saved[i].page_link) in is_test_sglist_corrupted()
697 if (tsgl->sgl[i].offset != tsgl->sgl_saved[i].offset) in is_test_sglist_corrupted()
699 if (tsgl->sgl[i].length != tsgl->sgl_saved[i].length) in is_test_sglist_corrupted()
1125 static int build_hash_sglist(struct test_sglist *tsgl, in build_hash_sglist() argument
1137 return build_test_sglist(tsgl, cfg->src_divs, alignmask, vec->psize, in build_hash_sglist()
1176 struct test_sglist *tsgl, in test_shash_vec_cfg() argument
1209 err = build_hash_sglist(tsgl, vec, cfg, alignmask, divs); in test_shash_vec_cfg()
1224 if (tsgl->nents != 1) in test_shash_vec_cfg()
1228 err = crypto_shash_digest(desc, sg_virt(&tsgl->sgl[0]), in test_shash_vec_cfg()
1229 tsgl->sgl[0].length, result); in test_shash_vec_cfg()
1259 for (i = 0; i < tsgl->nents; i++) { in test_shash_vec_cfg()
1260 if (i + 1 == tsgl->nents && in test_shash_vec_cfg()
1264 err = crypto_shash_finup(desc, sg_virt(&tsgl->sgl[i]), in test_shash_vec_cfg()
1265 tsgl->sgl[i].length, result); in test_shash_vec_cfg()
1276 err = crypto_shash_update(desc, sg_virt(&tsgl->sgl[i]), in test_shash_vec_cfg()
1277 tsgl->sgl[i].length); in test_shash_vec_cfg()
1360 struct test_sglist *tsgl, in test_ahash_vec_cfg() argument
1397 err = build_hash_sglist(tsgl, vec, cfg, alignmask, divs); in test_ahash_vec_cfg()
1414 ahash_request_set_crypt(req, tsgl->sgl, result, vec->psize); in test_ahash_vec_cfg()
1444 for (i = 0; i < tsgl->nents; i++) { in test_ahash_vec_cfg()
1488 pending_sgl = &tsgl->sgl[i]; in test_ahash_vec_cfg()
1489 pending_len += tsgl->sgl[i].length; in test_ahash_vec_cfg()
1527 struct test_sglist *tsgl, in test_hash_vec_cfg() argument
1539 err = test_shash_vec_cfg(vec, vec_name, cfg, desc, tsgl, in test_hash_vec_cfg()
1545 return test_ahash_vec_cfg(vec, vec_name, cfg, req, tsgl, hashstate); in test_hash_vec_cfg()
1550 struct test_sglist *tsgl, u8 *hashstate) in test_hash_vec() argument
1561 req, desc, tsgl, hashstate); in test_hash_vec()
1575 req, desc, tsgl, hashstate); in test_hash_vec()
1635 struct test_sglist *tsgl, in test_hash_vs_generic_impl() argument
1731 req, desc, tsgl, hashstate); in test_hash_vs_generic_impl()
1751 struct test_sglist *tsgl, in test_hash_vs_generic_impl() argument
1800 struct test_sglist *tsgl = NULL; in __alg_test_hash() local
1835 tsgl = kmalloc(sizeof(*tsgl), GFP_KERNEL); in __alg_test_hash()
1836 if (!tsgl || init_test_sglist(tsgl) != 0) { in __alg_test_hash()
1839 kfree(tsgl); in __alg_test_hash()
1840 tsgl = NULL; in __alg_test_hash()
1857 err = test_hash_vec(&vecs[i], i, req, desc, tsgl, hashstate); in __alg_test_hash()
1863 desc, tsgl, hashstate); in __alg_test_hash()
1866 if (tsgl) { in __alg_test_hash()
1867 destroy_test_sglist(tsgl); in __alg_test_hash()
1868 kfree(tsgl); in __alg_test_hash()