]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: nx - Fixing SHA update bug
authorLeonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>
Thu, 23 Apr 2015 20:41:43 +0000 (17:41 -0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 26 Apr 2015 06:33:19 +0000 (14:33 +0800)
commitccb32279bec575bac9b09b2296fee64caba4247c
tree4bffed8c0ee49a629ae7805334a2e56a52fec4c8
parenta2ed0bfdaec636ce892b2091680f575a8ccf6933
crypto: nx - Fixing SHA update bug

Bug happens when a data size less than SHA block size is passed.
Since first attempt will be saved in buffer, second round attempt
get into two step to calculate op.inlen and op.outlen. The issue
resides in this step. A  wrong value of op.inlen and outlen was being
calculated.

This patch fix this eliminate the nx_sha_build_sg_list, that is
useless in SHA's algorithm context. Instead we call nx_build_sg_list
directly and pass a previous calculated max_sg_len to it.

Signed-off-by: Leonidas S. Barbosa <leosilva@linux.vnet.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/nx/nx-sha256.c
drivers/crypto/nx/nx-sha512.c
drivers/crypto/nx/nx.c
drivers/crypto/nx/nx.h