1. 20 6月, 2019 2 次提交
    • H
      crypto: caam - update IV using HW support · 334d37c9
      Horia Geantă 提交于
      Modify drivers to perform skcipher IV update using the crypto engine,
      instead of performing the operation in SW.
      
      Besides being more efficient, this also fixes IV update for CTR mode.
      
      Output HW S/G table is appended with an entry pointing to the same
      IV buffer used as input (which is now mapped BIDIRECTIONAL).
      
      AS (Algorithm State) parameter of the OPERATION command is changed
      from INIFINAL to INIT in descriptors used by ctr(aes), cbc(aes).
      This is needed since in case FINAL bit is set, HW skips IV updating
      in the Context Register for the last data block.
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      334d37c9
    • H
      crypto: caam - use len instead of nents for bulding HW S/G table · 059d73ee
      Horia Geantă 提交于
      Currently, conversion of SW S/G table into HW S/G layout relies on
      nents returned by sg_nents_for_len(sg, len).
      However this leaves the possibility of HW S/G referencing more data
      then needed: since buffer length in HW S/G entries is filled using
      sg_dma_len(sg), the last entry in HW S/G table might have a length
      that is bigger than needed for the crypto request.
      
      This way of S/G table conversion is fine, unless after converting a table
      more entries have to be appended to the HW S/G table.
      In this case, crypto engine would access data from the S/G entry having
      the incorrect length, instead of advancing in the S/G table.
      This situation doesn't exist, but the upcoming implementation of
      IV update for skcipher algorithms needs to add a S/G entry after
      req->dst S/G (corresponding to output IV).
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      059d73ee
  2. 13 6月, 2019 6 次提交
  3. 06 6月, 2019 20 次提交
  4. 30 5月, 2019 12 次提交