• Tero Kristo's avatar
    crypto: omap-sham - add support functions for sg based data handling · f19de1bc
    Tero Kristo authored
    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: default avatarTero Kristo <t-kristo@ti.com>
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    f19de1bc
omap-sham.c 56.5 KB