1. 22 4月, 2015 3 次提交
  2. 21 4月, 2015 3 次提交
    • H
      crypto: rng - Introduce crypto_rng_generate · ff030b09
      Herbert Xu 提交于
      This patch adds the new top-level function crypto_rng_generate
      which generates random numbers with additional input.  It also
      extends the mid-level rng_gen_random function to take additional
      data as input.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      ff030b09
    • H
      crypto: rng - Convert crypto_rng to new style crypto_type · d0e83059
      Herbert Xu 提交于
      This patch converts the top-level crypto_rng to the "new" style.
      It was the last algorithm type added before we switched over
      to the new way of doing things exemplified by shash.
      
      All users will automatically switch over to the new interface.
      
      Note that this patch does not touch the low-level interface to
      rng implementations.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      d0e83059
    • S
      crypto: drbg - replace spinlock with mutex · 76899a41
      Stephan Mueller 提交于
      The creation of a shadow copy is intended to only hold a short term
      lock. But the drawback is that parallel users have a very similar DRBG
      state which only differs by a high-resolution time stamp.
      
      The DRBG will now hold a long term lock. Therefore, the lock is changed
      to a mutex which implies that the DRBG can only be used in process
      context.
      
      The lock now guards the instantiation as well as the entire DRBG
      generation operation. Therefore, multiple callers are fully serialized
      when generating a random number.
      
      As the locking is changed to use a long-term lock to avoid such similar
      DRBG states, the entire creation and maintenance of a shadow copy can be
      removed.
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      76899a41
  3. 10 4月, 2015 6 次提交
  4. 03 4月, 2015 1 次提交
  5. 24 3月, 2015 1 次提交
  6. 09 3月, 2015 1 次提交
  7. 04 2月, 2015 1 次提交
    • A
      crypto: switch af_alg_make_sg() to iov_iter · 1d10eb2f
      Al Viro 提交于
      With that, all ->sendmsg() instances are converted to iov_iter primitives
      and are agnostic wrt the kind of iov_iter they are working with.
      So's the last remaining ->recvmsg() instance that wasn't kind-agnostic yet.
      All ->sendmsg() and ->recvmsg() advance ->msg_iter by the amount actually
      copied and none of them modifies the underlying iovec, etc.
      
      Cc: linux-crypto@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      1d10eb2f
  8. 26 1月, 2015 1 次提交
  9. 22 12月, 2014 1 次提交
  10. 05 12月, 2014 1 次提交
  11. 17 11月, 2014 1 次提交
  12. 13 11月, 2014 4 次提交
  13. 14 10月, 2014 1 次提交
    • B
      crypto: LLVMLinux: Add macro to remove use of VLAIS in crypto code · a0a77af1
      Behan Webster 提交于
      Add a macro which replaces the use of a Variable Length Array In Struct (VLAIS)
      with a C99 compliant equivalent. This macro instead allocates the appropriate
      amount of memory using an char array.
      
      The new code can be compiled with both gcc and clang.
      
      struct shash_desc contains a flexible array member member ctx declared with
      CRYPTO_MINALIGN_ATTR, so sizeof(struct shash_desc) aligns the beginning
      of the array declared after struct shash_desc with long long.
      
      No trailing padding is required because it is not a struct type that can
      be used in an array.
      
      The CRYPTO_MINALIGN_ATTR is required so that desc is aligned with long long
      as would be the case for a struct containing a member with
      CRYPTO_MINALIGN_ATTR.
      
      If you want to get to the ctx at the end of the shash_desc as before you can do
      so using shash_desc_ctx(shash)
      Signed-off-by: NBehan Webster <behanw@converseincode.com>
      Reviewed-by: NMark Charlebois <charlebm@gmail.com>
      Acked-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Cc: Michał Mirosław <mirqus@gmail.com>
      a0a77af1
  14. 06 10月, 2014 1 次提交
  15. 17 9月, 2014 1 次提交
    • D
      KEYS: Overhaul key identification when searching for asymmetric keys · 46963b77
      David Howells 提交于
      Make use of the new match string preparsing to overhaul key identification
      when searching for asymmetric keys.  The following changes are made:
      
       (1) Use the previously created asymmetric_key_id struct to hold the following
           key IDs derived from the X.509 certificate or PKCS#7 message:
      
      	id: serial number + issuer
      	skid: subjKeyId + subject
      	authority: authKeyId + issuer
      
       (2) Replace the hex fingerprint attached to key->type_data[1] with an
           asymmetric_key_ids struct containing the id and the skid (if present).
      
       (3) Make the asymmetric_type match data preparse select one of two searches:
      
           (a) An iterative search for the key ID given if prefixed with "id:".  The
           	 prefix is expected to be followed by a hex string giving the ID to
           	 search for.  The criterion key ID is checked against all key IDs
           	 recorded on the key.
      
           (b) A direct search if the key ID is not prefixed with "id:".  This will
           	 look for an exact match on the key description.
      
       (4) Make x509_request_asymmetric_key() take a key ID.  This is then converted
           into "id:<hex>" and passed into keyring_search() where match preparsing
           will turn it back into a binary ID.
      
       (5) X.509 certificate verification then takes the authority key ID and looks
           up a key that matches it to find the public key for the certificate
           signature.
      
       (6) PKCS#7 certificate verification then takes the id key ID and looks up a
           key that matches it to find the public key for the signed information
           block signature.
      
      Additional changes:
      
       (1) Multiple subjKeyId and authKeyId values on an X.509 certificate cause the
           cert to be rejected with -EBADMSG.
      
       (2) The 'fingerprint' ID is gone.  This was primarily intended to convey PGP
           public key fingerprints.  If PGP is supported in future, this should
           generate a key ID that carries the fingerprint.
      
       (3) Th ca_keyid= kernel command line option is now converted to a key ID and
           used to match the authority key ID.  Possibly this should only match the
           actual authKeyId part and not the issuer as well.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Acked-by: NVivek Goyal <vgoyal@redhat.com>
      46963b77
  16. 05 9月, 2014 1 次提交
  17. 26 8月, 2014 1 次提交
  18. 25 8月, 2014 2 次提交
  19. 01 8月, 2014 1 次提交
  20. 29 7月, 2014 1 次提交
  21. 08 7月, 2014 4 次提交
  22. 04 7月, 2014 1 次提交
  23. 20 6月, 2014 2 次提交
    • J
      crypto: des_3des - add x86-64 assembly implementation · 6574e6c6
      Jussi Kivilinna 提交于
      Patch adds x86_64 assembly implementation of Triple DES EDE cipher algorithm.
      Two assembly implementations are provided. First is regular 'one-block at
      time' encrypt/decrypt function. Second is 'three-blocks at time' function that
      gains performance increase on out-of-order CPUs.
      
      tcrypt test results:
      
      Intel Core i5-4570:
      
      des3_ede-asm vs des3_ede-generic:
      size    ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
      16B     1.21x   1.22x   1.27x   1.36x   1.25x   1.25x
      64B     1.98x   1.96x   1.23x   2.04x   2.01x   2.00x
      256B    2.34x   2.37x   1.21x   2.40x   2.38x   2.39x
      1024B   2.50x   2.47x   1.22x   2.51x   2.52x   2.51x
      8192B   2.51x   2.53x   1.21x   2.56x   2.54x   2.55x
      Signed-off-by: NJussi Kivilinna <jussi.kivilinna@iki.fi>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      6574e6c6
    • S
      crypto: drbg - header file for DRBG · 3e16f959
      Stephan Mueller 提交于
      The header file includes the definition of:
      
      * DRBG data structures with
              - struct drbg_state as main structure
              - struct drbg_core referencing the backend ciphers
              - struct drbg_state_ops callbach handlers for specific code
                supporting the Hash, HMAC, CTR DRBG implementations
              - struct drbg_conc defining a linked list for input data
              - struct drbg_test_data holding the test "entropy" data for CAVS
                testing and testmgr.c
              - struct drbg_gen allowing test data, additional information
                string and personalization string data to be funneled through
                the kernel crypto API -- the DRBG requires additional
                parameters when invoking the reset and random number
                generation requests than intended by the kernel crypto API
      
      * wrapper function to the kernel crypto API functions using struct
        drbg_gen to pass through all data needed for DRBG
      
      * wrapper functions to kernel crypto API functions usable for testing
        code to inject test_data into the DRBG as needed by CAVS testing and
        testmgr.c.
      
      * DRBG flags required for the operation of the DRBG and for selecting
        the particular DRBG type and backend cipher
      
      * getter functions for data from struct drbg_core
      Signed-off-by: NStephan Mueller <smueller@chronox.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3e16f959