• H
    crypto: caam/qi2 - fix chacha20 data size error · 3a5a9e1e
    Horia Geantă 提交于
    HW generates a Data Size error for chacha20 requests that are not
    a multiple of 64B, since algorithm state (AS) does not have
    the FINAL bit set.
    
    Since updating req->iv (for chaining) is not required,
    modify skcipher descriptors to set the FINAL bit for chacha20.
    
    [Note that for skcipher decryption we know that ctx1_iv_off is 0,
    which allows for an optimization by not checking algorithm type,
    since append_dec_op1() sets FINAL bit for all algorithms except AES.]
    
    Also drop the descriptor operations that save the IV.
    However, in order to keep code logic simple, things like
    S/G tables generation etc. are not touched.
    
    Cc: <stable@vger.kernel.org> # v5.3+
    Fixes: 334d37c9 ("crypto: caam - update IV using HW support")
    Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
    Tested-by: NValentin Ciocoi Radulescu <valentin.ciocoi@nxp.com>
    Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
    3a5a9e1e
caamalg_desc.c 54.2 KB