1. 10 10月, 2019 1 次提交
  2. 04 9月, 2019 1 次提交
  3. 22 8月, 2019 3 次提交
  4. 15 8月, 2019 1 次提交
  5. 02 8月, 2019 1 次提交
  6. 27 7月, 2019 1 次提交
  7. 26 7月, 2019 7 次提交
  8. 20 6月, 2019 1 次提交
  9. 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
  10. 30 5月, 2019 5 次提交
  11. 25 4月, 2019 1 次提交
  12. 18 4月, 2019 3 次提交
    • V
      crypto: ecrdsa - add EC-RDSA (GOST 34.10) algorithm · 0d7a7864
      Vitaly Chikunov 提交于
      Add Elliptic Curve Russian Digital Signature Algorithm (GOST R
      34.10-2012, RFC 7091, ISO/IEC 14888-3) is one of the Russian (and since
      2018 the CIS countries) cryptographic standard algorithms (called GOST
      algorithms). Only signature verification is supported, with intent to be
      used in the IMA.
      
      Summary of the changes:
      
      * crypto/Kconfig:
        - EC-RDSA is added into Public-key cryptography section.
      
      * crypto/Makefile:
        - ecrdsa objects are added.
      
      * crypto/asymmetric_keys/x509_cert_parser.c:
        - Recognize EC-RDSA and Streebog OIDs.
      
      * include/linux/oid_registry.h:
        - EC-RDSA OIDs are added to the enum. Also, a two currently not
          implemented curve OIDs are added for possible extension later (to
          not change numbering and grouping).
      
      * crypto/ecc.c:
        - Kenneth MacKay copyright date is updated to 2014, because
          vli_mmod_slow, ecc_point_add, ecc_point_mult_shamir are based on his
          code from micro-ecc.
        - Functions needed for ecrdsa are EXPORT_SYMBOL'ed.
        - New functions:
          vli_is_negative - helper to determine sign of vli;
          vli_from_be64 - unpack big-endian array into vli (used for
            a signature);
          vli_from_le64 - unpack little-endian array into vli (used for
            a public key);
          vli_uadd, vli_usub - add/sub u64 value to/from vli (used for
            increment/decrement);
          mul_64_64 - optimized to use __int128 where appropriate, this speeds
            up point multiplication (and as a consequence signature
            verification) by the factor of 1.5-2;
          vli_umult - multiply vli by a small value (speeds up point
            multiplication by another factor of 1.5-2, depending on vli sizes);
          vli_mmod_special - module reduction for some form of Pseudo-Mersenne
            primes (used for the curves A);
          vli_mmod_special2 - module reduction for another form of
            Pseudo-Mersenne primes (used for the curves B);
          vli_mmod_barrett - module reduction using pre-computed value (used
            for the curve C);
          vli_mmod_slow - more general module reduction which is much slower
           (used when the modulus is subgroup order);
          vli_mod_mult_slow - modular multiplication;
          ecc_point_add - add two points;
          ecc_point_mult_shamir - add two points multiplied by scalars in one
            combined multiplication (this gives speed up by another factor 2 in
            compare to two separate multiplications).
          ecc_is_pubkey_valid_partial - additional samity check is added.
        - Updated vli_mmod_fast with non-strict heuristic to call optimal
            module reduction function depending on the prime value;
        - All computations for the previously defined (two NIST) curves should
          not unaffected.
      
      * crypto/ecc.h:
        - Newly exported functions are documented.
      
      * crypto/ecrdsa_defs.h
        - Five curves are defined.
      
      * crypto/ecrdsa.c:
        - Signature verification is implemented.
      
      * crypto/ecrdsa_params.asn1, crypto/ecrdsa_pub_key.asn1:
        - Templates for BER decoder for EC-RDSA parameters and public key.
      
      Cc: linux-integrity@vger.kernel.org
      Signed-off-by: NVitaly Chikunov <vt@altlinux.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      0d7a7864
    • V
      crypto: ecc - make ecc into separate module · 4a2289da
      Vitaly Chikunov 提交于
      ecc.c have algorithms that could be used togeter by ecdh and ecrdsa.
      Make it separate module. Add CRYPTO_ECC into Kconfig. EXPORT_SYMBOL and
      document to what seems appropriate. Move structs ecc_point and ecc_curve
      from ecc_curve_defs.h into ecc.h.
      
      No code changes.
      Signed-off-by: NVitaly Chikunov <vt@altlinux.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      4a2289da
    • V
      crypto: Kconfig - create Public-key cryptography section · 3d6228a5
      Vitaly Chikunov 提交于
      Group RSA, DH, and ECDH into Public-key cryptography config section.
      Signed-off-by: NVitaly Chikunov <vt@altlinux.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3d6228a5
  13. 28 3月, 2019 1 次提交
  14. 22 3月, 2019 6 次提交
  15. 08 2月, 2019 1 次提交
    • E
      crypto: testmgr - introduce CONFIG_CRYPTO_MANAGER_EXTRA_TESTS · 5b2706a4
      Eric Biggers 提交于
      To achieve more comprehensive crypto test coverage, I'd like to add fuzz
      tests that use random data layouts and request flags.
      
      To be most effective these tests should be part of testmgr, so they
      automatically run on every algorithm registered with the crypto API.
      However, they will take much longer to run than the current tests and
      therefore will only really be intended to be run by developers, whereas
      the current tests have a wider audience.
      
      Therefore, add a new kconfig option CONFIG_CRYPTO_MANAGER_EXTRA_TESTS
      that can be set by developers to enable these extra, expensive tests.
      
      Similar to the regular tests, also add a module parameter
      cryptomgr.noextratests to support disabling the tests.
      
      Finally, another module parameter cryptomgr.fuzz_iterations is added to
      control how many iterations the fuzz tests do.  Note: for now setting
      this to 0 will be equivalent to cryptomgr.noextratests=1.  But I opted
      for separate parameters to provide more flexibility to add other types
      of tests under the "extra tests" category in the future.
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5b2706a4
  16. 11 1月, 2019 1 次提交
  17. 21 12月, 2018 1 次提交
  18. 13 12月, 2018 4 次提交