Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 468577ab authored by Herbert Xu's avatar Herbert Xu
Browse files

[CRYPTO] scatterwalk: Use generic scatterlist chaining



This patch converts the crypto scatterwalk code to use the generic
scatterlist chaining rather the version specific to crypto.

Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 102d49d3
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -21,7 +21,6 @@
#include <linux/scatterlist.h>
#include <linux/scatterlist.h>


#include "internal.h"
#include "internal.h"
#include "scatterwalk.h"


static int init(struct hash_desc *desc)
static int init(struct hash_desc *desc)
{
{
@@ -77,7 +76,7 @@ static int update2(struct hash_desc *desc,


		if (!nbytes)
		if (!nbytes)
			break;
			break;
		sg = scatterwalk_sg_next(sg);
		sg = sg_next(sg);
	}
	}


	return 0;
	return 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -160,7 +160,7 @@ static int hmac_digest(struct hash_desc *pdesc, struct scatterlist *sg,


	sg_init_table(sg1, 2);
	sg_init_table(sg1, 2);
	sg_set_buf(sg1, ipad, bs);
	sg_set_buf(sg1, ipad, bs);
	sg_set_page(&sg1[1], (void *) sg, 0, 0);
	sg_chain(sg1, 2, sg);


	sg_init_table(sg2, 1);
	sg_init_table(sg2, 1);
	sg_set_buf(sg2, opad, bs + ds);
	sg_set_buf(sg2, opad, bs + ds);
+1 −1
Original line number Original line Diff line number Diff line
@@ -62,7 +62,7 @@ static void scatterwalk_pagedone(struct scatter_walk *walk, int out,
		walk->offset += PAGE_SIZE - 1;
		walk->offset += PAGE_SIZE - 1;
		walk->offset &= PAGE_MASK;
		walk->offset &= PAGE_MASK;
		if (walk->offset >= walk->sg->offset + walk->sg->length)
		if (walk->offset >= walk->sg->offset + walk->sg->length)
			scatterwalk_start(walk, scatterwalk_sg_next(walk->sg));
			scatterwalk_start(walk, sg_next(walk->sg));
	}
	}
}
}


+0 −5
Original line number Original line Diff line number Diff line
@@ -20,11 +20,6 @@


#include "internal.h"
#include "internal.h"


static inline struct scatterlist *scatterwalk_sg_next(struct scatterlist *sg)
{
	return (++sg)->length ? sg : (void *) sg_page(sg);
}

static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
static inline unsigned long scatterwalk_samebuf(struct scatter_walk *walk_in,
						struct scatter_walk *walk_out)
						struct scatter_walk *walk_out)
{
{