crypto: omap-sham - add support functions for sg based data handling
authorTero Kristo <t-kristo@ti.com>
Mon, 19 Sep 2016 15:22:15 +0000 (18:22 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 22 Sep 2016 10:32:50 +0000 (18:32 +0800)
commitf19de1bc67a042d00175139d1540cdb6ac97ed50
tree1b241a1721ae915d7bdf1327851139ca62777bcc
parent8addf571aeb7ef096201315737543b4c5303300a
crypto: omap-sham - add support functions for sg based data handling

Currently omap-sham uses a huge internal buffer for caching data, and
pushing this out to the DMA as large chunks. This, unfortunately,
doesn't work too well with the export/import functionality required
for ahash algorithms, and must be changed towards more scatterlist
centric approach.

This patch adds support functions for (mostly) scatterlist based data
handling. omap_sham_prepare_request() prepares a scatterlist for DMA
transfer to SHA crypto accelerator. This requires checking the data /
offset / length alignment of the data, splitting the data to SHA block
size granularity, and adding any remaining data back to the buffer.
With this patch, the code doesn't actually go live yet, the support code
will be taken properly into use with additional patches that modify the
SHA driver functionality itself.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/omap-sham.c