1. 28 May, 2021 18 commits
    • Thara Gopinath's avatar
      MAINTAINERS: Add maintainer for Qualcomm crypto drivers · abf790a9
      Thara Gopinath authored
      There is no maintainer for Qualcomm crypto drivers and we are seeing more
      development in this area. Add myself as the maintainer so that I can help
      in reviewing the changes submitted to these drivers.
      Signed-off-by: default avatarThara Gopinath <thara.gopinath@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      abf790a9
    • Thara Gopinath's avatar
      crypto: qce: skcipher: Fix incorrect sg count for dma transfers · 1339a7c3
      Thara Gopinath authored
      Use the sg count returned by dma_map_sg to call into
      dmaengine_prep_slave_sg rather than using the original sg count. dma_map_sg
      can merge consecutive sglist entries, thus making the original sg count
      wrong. This is a fix for memory coruption issues observed while testing
      encryption/decryption of large messages using libkcapi framework.
      
      Patch has been tested further by running full suite of tcrypt.ko tests
      including fuzz tests.
      Signed-off-by: default avatarThara Gopinath <thara.gopinath@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      1339a7c3
    • Stephan Müller's avatar
      crypto: DRBG - switch to HMAC SHA512 DRBG as default DRBG · 9b7b9468
      Stephan Müller authored
      The default DRBG is the one that has the highest priority. The priority
      is defined based on the order of the list drbg_cores[] where the highest
      priority is given to the last entry by drbg_fill_array.
      
      With this patch the default DRBG is switched from HMAC SHA256 to HMAC
      SHA512 to support compliance with SP800-90B and SP800-90C (current
      draft).
      
      The user of the crypto API is completely unaffected by the change.
      Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
      Acked-by: default avatarsimo Sorce <simo@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      9b7b9468
    • YueHaibing's avatar
      hwrng: core - Use DEVICE_ATTR_<RW|RO> macro · 98f481f2
      YueHaibing authored
      Use DEVICE_ATTR_RW()/DEVICE_ATTR_RO() helper instead of
      plain DEVICE_ATTR, which makes the code a bit shorter and
      easier to read.
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      98f481f2
    • Ard Biesheuvel's avatar
      crypto: tcrypt - enable tests for xxhash and blake2 · aa22cd7f
      Ard Biesheuvel authored
      Fill some of the recently freed up slots in tcrypt with xxhash64 and
      blake2b/blake2s, so we can easily benchmark their kernel implementations
      from user space.
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      aa22cd7f
    • Lee Jones's avatar
      crypto: ccp: ccp-dev: Fix a little doc-rot · 01df08b9
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/crypto/ccp/ccp-dev.c:476: warning: Function parameter or member 'sp' not described in 'ccp_alloc_struct'
       drivers/crypto/ccp/ccp-dev.c:476: warning: Excess function parameter 'dev' description in 'ccp_alloc_struct'
       drivers/crypto/ccp/ccp-dev.c:476: warning: Function parameter or member 'sp' not described in 'ccp_alloc_struct'
       drivers/crypto/ccp/ccp-dev.c:476: warning: Excess function parameter 'dev' description in 'ccp_alloc_struct'
      
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Cc: John Allen <john.allen@amd.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Gary R Hook <gary.hook@amd.com>
      Cc: linux-crypto@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      01df08b9
    • Lee Jones's avatar
      crypto: nx: nx-aes-gcm: Kernel-doc formatting should not be used for headers · c215b513
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'tfm' not described in 'gcm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'in_key' not described in 'gcm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-gcm.c:26: warning: Function parameter or member 'key_len' not described in 'gcm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-gcm.c:26: warning: expecting prototype for Nest Accelerators driver(). Prototype was for gcm_aes_nx_set_key() instead
       drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'tfm' not described in 'ecb_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'in_key' not described in 'ecb_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ecb.c:24: warning: Function parameter or member 'key_len' not described in 'ecb_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ecb.c:24: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ecb_aes_nx_set_key() instead
       drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'tfm' not described in 'ccm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'in_key' not described in 'ccm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ccm.c:26: warning: Function parameter or member 'key_len' not described in 'ccm_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ccm.c:26: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ccm_aes_nx_set_key() instead
       drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'tfm' not described in 'ctr_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'in_key' not described in 'ctr_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ctr.c:25: warning: Function parameter or member 'key_len' not described in 'ctr_aes_nx_set_key'
       drivers/crypto/nx/nx-aes-ctr.c:25: warning: expecting prototype for Nest Accelerators driver(). Prototype was for ctr_aes_nx_set_key() instead
       drivers/crypto/nx/nx-aes-xcbc.c:22: warning: cannot understand function prototype: 'struct xcbc_state '
       drivers/crypto/nx/nx-sha256.c:21: warning: Function parameter or member 'tfm' not described in 'nx_crypto_ctx_sha256_init'
       drivers/crypto/nx/nx-sha256.c:21: warning: expecting prototype for SHA(). Prototype was for nx_crypto_ctx_sha256_init() instead
       drivers/crypto/nx/nx-sha512.c:20: warning: Function parameter or member 'tfm' not described in 'nx_crypto_ctx_sha512_init'
       drivers/crypto/nx/nx-sha512.c:20: warning: expecting prototype for SHA(). Prototype was for nx_crypto_ctx_sha512_init() instead
       drivers/crypto/nx/nx-842-pseries.c:280: warning: Function parameter or member 'wmem' not described in 'nx842_pseries_compress'
       drivers/crypto/nx/nx-842-pseries.c:280: warning: Excess function parameter 'wrkmem' description in 'nx842_pseries_compress'
       drivers/crypto/nx/nx-842-pseries.c:410: warning: Function parameter or member 'wmem' not described in 'nx842_pseries_decompress'
       drivers/crypto/nx/nx-842-pseries.c:410: warning: Excess function parameter 'wrkmem' description in 'nx842_pseries_decompress'
       drivers/crypto/nx/nx-842-pseries.c:523: warning: Function parameter or member 'devdata' not described in 'nx842_OF_set_defaults'
       drivers/crypto/nx/nx-842-pseries.c:548: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_status'
       drivers/crypto/nx/nx-842-pseries.c:582: warning: Function parameter or member 'devdata' not described in 'nx842_OF_upd_maxsglen'
       drivers/crypto/nx/nx-842-pseries.c:582: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_maxsglen'
       drivers/crypto/nx/nx-842-pseries.c:630: warning: Function parameter or member 'devdata' not described in 'nx842_OF_upd_maxsyncop'
       drivers/crypto/nx/nx-842-pseries.c:630: warning: Function parameter or member 'prop' not described in 'nx842_OF_upd_maxsyncop'
       drivers/crypto/nx/nx-842-pseries.c:692: warning: Cannot understand  *
       drivers/crypto/nx/nx-842-pseries.c:825: warning: Function parameter or member 'data' not described in 'nx842_OF_notifier'
       drivers/crypto/nx/nx-842-pseries.c:825: warning: Excess function parameter 'update' description in 'nx842_OF_notifier'
      
      Cc: Haren Myneni <haren@us.ibm.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Robert Jennings <rcj@linux.vnet.ibm.com>
      Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
      Cc: linux-crypto@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c215b513
    • Lee Jones's avatar
      crypto: cavium: Fix a bunch of kernel-doc related issues · c4d7d318
      Lee Jones authored
      Fixes the following W=1 kernel build warning(s):
      
       drivers/crypto/cavium/nitrox/nitrox_main.c:41: warning: cannot understand function prototype: 'const struct pci_device_id nitrox_pci_tbl[] = '
       drivers/crypto/cavium/nitrox/nitrox_main.c:73: warning: Function parameter or member 'ndev' not described in 'write_to_ucd_unit'
       drivers/crypto/cavium/nitrox/nitrox_main.c:73: warning: Function parameter or member 'ucode_size' not described in 'write_to_ucd_unit'
       drivers/crypto/cavium/nitrox/nitrox_main.c:73: warning: Function parameter or member 'ucode_data' not described in 'write_to_ucd_unit'
       drivers/crypto/cavium/nitrox/nitrox_main.c:73: warning: Function parameter or member 'block_num' not described in 'write_to_ucd_unit'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:46: warning: Function parameter or member 'index' not described in 'incr_index'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:46: warning: Function parameter or member 'count' not described in 'incr_index'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:46: warning: Function parameter or member 'max' not described in 'incr_index'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:46: warning: expecting prototype for Response codes from SE microcode(). Prototype was for incr_index() instead
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:287: warning: Function parameter or member 'cmdq' not described in 'post_se_instr'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:381: warning: Function parameter or member 'callback' not described in 'nitrox_process_se_request'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:381: warning: Function parameter or member 'cb_arg' not described in 'nitrox_process_se_request'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:381: warning: expecting prototype for nitrox_se_request(). Prototype was for nitrox_process_se_request() instead
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:535: warning: Function parameter or member 'cmdq' not described in 'process_response_list'
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:535: warning: expecting prototype for process_request_list(). Prototype was for process_response_list() instead
       drivers/crypto/cavium/nitrox/nitrox_reqmgr.c:584: warning: Function parameter or member 'data' not described in 'pkt_slc_resp_tasklet'
       drivers/crypto/cavium/nitrox/nitrox_mbx.c:14: warning: cannot understand function prototype: 'enum mbx_msg_type '
       drivers/crypto/cavium/nitrox/nitrox_mbx.c:24: warning: cannot understand function prototype: 'enum mbx_msg_opcode '
       drivers/crypto/cavium/nitrox/nitrox_skcipher.c:26: warning: cannot understand function prototype: 'const struct nitrox_cipher flexi_cipher_table[] = '
       drivers/crypto/cavium/cpt/cptpf_main.c:411: warning: Function parameter or member 'cpt' not described in 'cpt_unload_microcode'
       drivers/crypto/cavium/cpt/cptpf_main.c:411: warning: expecting prototype for Ensure all cores are disengaged from all groups by(). Prototype was for cpt_unload_microcode() instead
       drivers/crypto/cavium/cpt/cptvf_reqmanager.c:17: warning: Function parameter or member 'q' not described in 'get_free_pending_entry'
       drivers/crypto/cavium/cpt/cptvf_reqmanager.c:17: warning: Function parameter or member 'qlen' not described in 'get_free_pending_entry'
      
      Cc: George Cherian <gcherian@marvell.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: linux-crypto@vger.kernel.org
      Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c4d7d318
    • Shaokun Zhang's avatar
      hwrng: core - remove redundant initialization of variable err · cb028f16
      Shaokun Zhang authored
      'err' will be assigned later and cleanup the redundant initialization.
      
      Cc: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: default avatarShaokun Zhang <zhangshaokun@hisilicon.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      cb028f16
    • Wei Yongjun's avatar
      crypto: qce - Fix some error handling path · 5c0ecc2e
      Wei Yongjun authored
      Fix to return negative error code from the error handling
      cases instead of 0.
      
      Fixes: 9363efb4 ("crypto: qce - Add support for AEAD algorithms")
      Reported-by: default avatarHulk Robot <hulkci@huawei.com>
      Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5c0ecc2e
    • Hui Tang's avatar
      crypto: khazad,wp512 - remove leading spaces before tabs · 30836548
      Hui Tang authored
      There are a few leading spaces before tabs and remove it by running the
      following commard:
      
      	$ find . -name '*.c' | xargs sed -r -i 's/^[ ]+\t/\t/'
      
      At the same time, fix two warning by running checkpatch.pl:
      	WARNING: suspect code indent for conditional statements (16, 16)
      	WARNING: braces {} are not necessary for single statement blocks
      Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      30836548
    • Zhen Lei's avatar
      crypto: header - Fix spelling errors · 155f7d32
      Zhen Lei authored
      Fix some spelling mistakes in comments:
      cipherntext ==> ciphertext
      syncronise ==> synchronise
      feeded ==> fed
      Signed-off-by: default avatarZhen Lei <thunder.leizhen@huawei.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      155f7d32
    • Juerg Haefliger's avatar
      hwrng: Kconfig - Remove leading spaces · 11e0ca8f
      Juerg Haefliger authored
      Remove leading spaces before tabs in Kconfig file(s) by running the
      following command:
      
        $ find drivers/char/hw_random -name 'Kconfig*' | x\
          args sed -r -i 's/^[ ]+\t/\t/'
      Signed-off-by: default avatarJuerg Haefliger <juergh@canonical.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      11e0ca8f
    • Jack Xu's avatar
      crypto: qat - remove unused macro in FW loader · 9afe77cf
      Jack Xu authored
      Remove the unused macro ICP_DH895XCC_PESRAM_BAR_SIZE in the firmware
      loader.
      
      This is to fix the following warning when compiling the driver using the
      clang compiler with CC=clang W=2:
      
          drivers/crypto/qat/qat_common/qat_uclo.c:345:9: warning: macro is not used [-Wunused-macros]
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Co-developed-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Signed-off-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      9afe77cf
    • Jack Xu's avatar
      crypto: qat - check return code of qat_hal_rd_rel_reg() · 96b57229
      Jack Xu authored
      Check the return code of the function qat_hal_rd_rel_reg() and return it
      to the caller.
      
      This is to fix the following warning when compiling the driver with
      clang scan-build:
      
          drivers/crypto/qat/qat_common/qat_hal.c:1436:2: warning: 6th function call argument is an uninitialized value
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Co-developed-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Signed-off-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      96b57229
    • Jack Xu's avatar
      crypto: qat - report an error if MMP file size is too large · 78b4267a
      Jack Xu authored
      Change the return status to error if MMP file size is too large so the
      driver load fails early if a large MMP firmware is loaded.
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Co-developed-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Signed-off-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      78b4267a
    • Jack Xu's avatar
      crypto: qat - check MMP size before writing to the SRAM · b9f7c36d
      Jack Xu authored
      Change "sram_visible" to "mmp_sram_size" and compare it with the MMP
      size to prevent an overly large MMP file being written to SRAM.
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Co-developed-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Signed-off-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      b9f7c36d
    • Jack Xu's avatar
      crypto: qat - return error when failing to map FW · fc9818e6
      Jack Xu authored
      Save the return value of qat_uclo_map_auth_fw() function so that the
      function qat_uclo_wr_mimage() could return the correct value.
      This way, the procedure of adf_gen2_ae_fw_load() function could stop
      and exit properly by checking the return value of qat_uclo_wr_mimage().
      Signed-off-by: default avatarJack Xu <jack.xu@intel.com>
      Co-developed-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Signed-off-by: default avatarZhehui Xiang <zhehui.xiang@intel.com>
      Reviewed-by: default avatarGiovanni Cabiddu <giovanni.cabiddu@intel.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      fc9818e6
  2. 23 May, 2021 11 commits
  3. 21 May, 2021 11 commits