1. 17 11月, 2019 13 次提交
  2. 01 11月, 2019 2 次提交
    • E
      crypto: skcipher - rename the crypto_blkcipher module and kconfig option · b95bba5d
      Eric Biggers 提交于
      Now that the blkcipher algorithm type has been removed in favor of
      skcipher, rename the crypto_blkcipher kernel module to crypto_skcipher,
      and rename the config options accordingly:
      
      	CONFIG_CRYPTO_BLKCIPHER => CONFIG_CRYPTO_SKCIPHER
      	CONFIG_CRYPTO_BLKCIPHER2 => CONFIG_CRYPTO_SKCIPHER2
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b95bba5d
    • D
      crypto: blake2b - add blake2b generic implementation · 91d68933
      David Sterba 提交于
      The patch brings support of several BLAKE2 variants (2b with various
      digest lengths).  The keyed digest is supported, using tfm->setkey call.
      The in-tree user will be btrfs (for checksumming), we're going to use
      the BLAKE2b-256 variant.
      
      The code is reference implementation taken from the official sources and
      modified in terms of kernel coding style (whitespace, comments, uintXX_t
      -> uXX types, removed unused prototypes and #ifdefs, removed testing
      code, changed secure_zero_memory -> memzero_explicit, used own helpers
      for unaligned reads/writes and rotations).
      
      Further changes removed sanity checks of key length or output size,
      these values are verified in the crypto API callbacks or hardcoded in
      shash_alg and not exposed to users.
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      91d68933
  3. 25 10月, 2019 1 次提交
    • E
      crypto: powerpc - convert SPE AES algorithms to skcipher API · 7f725f41
      Eric Biggers 提交于
      Convert the glue code for the PowerPC SPE implementations of AES-ECB,
      AES-CBC, AES-CTR, and AES-XTS from the deprecated "blkcipher" API to the
      "skcipher" API.  This is needed in order for the blkcipher API to be
      removed.
      
      Tested with:
      
      	export ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu-
      	make mpc85xx_defconfig
      	cat >> .config << EOF
      	# CONFIG_MODULES is not set
      	# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
      	CONFIG_DEBUG_KERNEL=y
      	CONFIG_CRYPTO_MANAGER_EXTRA_TESTS=y
      	CONFIG_CRYPTO_AES=y
      	CONFIG_CRYPTO_CBC=y
      	CONFIG_CRYPTO_CTR=y
      	CONFIG_CRYPTO_ECB=y
      	CONFIG_CRYPTO_XTS=y
      	CONFIG_CRYPTO_AES_PPC_SPE=y
      	EOF
      	make olddefconfig
      	make -j32
      	qemu-system-ppc -M mpc8544ds -cpu e500 -nographic \
      		-kernel arch/powerpc/boot/zImage \
      		-append cryptomgr.fuzz_iterations=1000
      
      Note that xts-ppc-spe still fails the comparison tests due to the lack
      of ciphertext stealing support.  This is not addressed by this patch.
      
      This patch also cleans up the code by making ->encrypt() and ->decrypt()
      call a common function for each of ECB, CBC, and XTS, and by using a
      clearer way to compute the length to process at each step.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7f725f41
  4. 23 10月, 2019 3 次提交
  5. 10 10月, 2019 1 次提交
  6. 04 9月, 2019 1 次提交
  7. 22 8月, 2019 3 次提交
  8. 15 8月, 2019 1 次提交
  9. 02 8月, 2019 1 次提交
  10. 27 7月, 2019 1 次提交
  11. 26 7月, 2019 7 次提交
  12. 20 6月, 2019 1 次提交
  13. 06 6月, 2019 1 次提交
    • N
      crypto: xxhash - Implement xxhash support · 67882e76
      Nikolay Borisov 提交于
      xxhash is currently implemented as a self-contained module in /lib.
      This patch enables that module to be used as part of the generic kernel
      crypto framework. It adds a simple wrapper to the 64bit version.
      
      I've also added test vectors (with help from Nick Terrell). The upstream
      xxhash code is tested by running hashing operation on random 222 byte
      data with seed values of 0 and a prime number. The upstream test
      suite can be found at https://github.com/Cyan4973/xxHash/blob/cf46e0c/xxhsum.c#L664
      
      Essentially hashing is run on data of length 0,1,14,222 with the
      aforementioned seed values 0 and prime 2654435761. The particular random
      222 byte string was provided to me by Nick Terrell by reading
      /dev/random and the checksums were calculated by the upstream xxsum
      utility with the following bash script:
      
      dd if=/dev/random of=TEST_VECTOR bs=1 count=222
      
      for a in 0 1; do
      	for l in 0 1 14 222; do
      		for s in 0 2654435761; do
      			echo algo $a length $l seed $s;
      			head -c $l TEST_VECTOR | ~/projects/kernel/xxHash/xxhsum -H$a -s$s
      		done
      	done
      done
      
      This produces output as follows:
      
      algo 0 length 0 seed 0
      02cc5d05  stdin
      algo 0 length 0 seed 2654435761
      02cc5d05  stdin
      algo 0 length 1 seed 0
      25201171  stdin
      algo 0 length 1 seed 2654435761
      25201171  stdin
      algo 0 length 14 seed 0
      c1d95975  stdin
      algo 0 length 14 seed 2654435761
      c1d95975  stdin
      algo 0 length 222 seed 0
      b38662a6  stdin
      algo 0 length 222 seed 2654435761
      b38662a6  stdin
      algo 1 length 0 seed 0
      ef46db3751d8e999  stdin
      algo 1 length 0 seed 2654435761
      ac75fda2929b17ef  stdin
      algo 1 length 1 seed 0
      27c3f04c2881203a  stdin
      algo 1 length 1 seed 2654435761
      4a15ed26415dfe4d  stdin
      algo 1 length 14 seed 0
      3d33dc700231dfad  stdin
      algo 1 length 14 seed 2654435761
      ea5f7ddef9a64f80  stdin
      algo 1 length 222 seed 0
      5f3d3c08ec2bef34  stdin
      algo 1 length 222 seed 2654435761
      6a9df59664c7ed62  stdin
      
      algo 1 is xx64 variant, algo 0 is the 32 bit variant which is currently
      not hooked up.
      Signed-off-by: NNikolay Borisov <nborisov@suse.com>
      Reviewed-by: NEric Biggers <ebiggers@kernel.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      67882e76
  14. 30 5月, 2019 4 次提交