1. 25 5月, 2015 2 次提交
  2. 22 5月, 2015 12 次提交
    • H
      crypto: echainiv - Add encrypted chain IV generator · a10f554f
      Herbert Xu 提交于
      This patch adds a new AEAD IV generator echainiv.  It is intended
      to replace the existing skcipher IV generator eseqiv.
      
      If the underlying AEAD algorithm is using the old AEAD interface,
      then echainiv will simply use its IV generator.
      
      Otherwise, echainiv will encrypt a counter just like eseqiv but
      it'll first xor it against a previously stored IV similar to
      chainiv.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      a10f554f
    • H
      crypto: seqiv - Add seqniv · 3c08fee7
      Herbert Xu 提交于
      This patch adds a new IV generator seqniv which is identical to
      seqiv except that it skips the IV when authenticating.  This is
      intended to be used by algorithms such as rfc4106 that does the
      IV authentication implicitly.
      
      Note that the code used for seqniv is in fact identical to the
      compatibility case for seqiv.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      3c08fee7
    • H
      crypto: seqiv - Add support for new AEAD interface · 856e3f40
      Herbert Xu 提交于
      This patch converts the seqiv IV generator to work with the new
      AEAD interface where IV generators are just normal AEAD algorithms.
      
      Full backwards compatibility is paramount at this point since
      no users have yet switched over to the new interface.  Nor can
      they switch to the new interface until IV generation is fully
      supported by it.
      
      So this means we are adding two versions of seqiv alongside the
      existing one.  The first one is the one that will be used when
      the underlying AEAD algorithm has switched over to the new AEAD
      interface.  The second one handles the current case where the
      underlying AEAD algorithm still uses the old interface.
      
      Both versions export themselves through the new AEAD interface.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      856e3f40
    • H
      crypto: scatterwalk - Check for same address in map_and_copy · 74412fd5
      Herbert Xu 提交于
      This patch adds a check for in scatterwalk_map_and_copy to avoid
      copying from the same address to the same address.  This is going
      to be used for IV copying in AEAD IV generators.
      
      There is no provision for partial overlaps.
      
      This patch also uses the new scatterwalk_ffwd instead of doing
      it by hand in scatterwalk_map_and_copy.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      74412fd5
    • H
      crypto: gcm - Use default null skcipher · 17db8546
      Herbert Xu 提交于
      This patch makes gcm use the default null skcipher instead of
      allocating a new one for each tfm.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      17db8546
    • H
      crypto: null - Add default null skcipher · 33023463
      Herbert Xu 提交于
      This patch adds a default null skcipher for users such as gcm
      to perform copies on SG lists.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      33023463
    • H
      crypto: aead - Add support for new AEAD implementations · 63293c61
      Herbert Xu 提交于
      This patch adds the basic structure of the new AEAD type.  Unlike
      the current version, there is no longer any concept of geniv.  IV
      generation will still be carried out by wrappers but they will be
      normal AEAD algorithms that simply take the IPsec sequence number
      as the IV.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      63293c61
    • H
      crypto: aead - Rename aead_alg to old_aead_alg · 2d0f230f
      Herbert Xu 提交于
      This patch is the first step in the introduction of a new AEAD
      alg type.  Unlike normal conversions this patch only renames the
      existing aead_alg structure because there are external references
      to it.
      
      Those references will be removed after this patch.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2d0f230f
    • H
      crypto: aead - Add new interface with single SG list · 996d98d8
      Herbert Xu 提交于
      The primary user of AEAD, IPsec includes the IV in the AD in
      most cases, except where it is implicitly authenticated by the
      underlying algorithm.
      
      The way it is currently implemented is a hack because we pass
      the data in piecemeal and the underlying algorithms try to stitch
      them back up into one piece.
      
      This is why this patch is adding a new interface that allows a
      single SG list to be passed in that contains everything so the
      algorithm implementors do not have to stitch.
      
      The new interface accepts a single source SG list and a single
      destination SG list.  Both must be laid out as follows:
      
      	AD, skipped data, plain/cipher text, ICV
      
      The ICV is not present from the source during encryption and from
      the destination during decryption.
      
      For the top-level IPsec AEAD algorithm the plain/cipher text will
      contain the generated (or received) IV.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      996d98d8
    • H
      crypto: scatterwalk - Add scatterwalk_ffwd helper · fc42bcba
      Herbert Xu 提交于
      This patch adds the scatterwalk_ffwd helper which can create an
      SG list that starts in the middle of an existing SG list.  The
      new list may either be part of the existing list or be a chain
      that latches onto part of the existing list.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      fc42bcba
    • H
      crypto: pcrypt - Use crypto_grab_aead · 66d948e7
      Herbert Xu 提交于
      As AEAD has switched over to using frontend types, the function
      crypto_init_spawn must not be used since it does not specify a
      frontend type.  Otherwise it leads to a crash when the spawn is
      used.
      
      This patch fixes it by switching over to crypto_grab_aead instead.
      
      Fixes: 5d1d65f8 ("crypto: aead - Convert top level interface to new style")
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      66d948e7
    • H
      crypto: cryptd - Use crypto_grab_aead · 9b8c456e
      Herbert Xu 提交于
      As AEAD has switched over to using frontend types, the function
      crypto_init_spawn must not be used since it does not specify a
      frontend type.  Otherwise it leads to a crash when the spawn is
      used.
      
      This patch fixes it by switching over to crypto_grab_aead instead.
      
      Fixes: 5d1d65f8 ("crypto: aead - Convert top level interface to new style")
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      9b8c456e
  3. 18 5月, 2015 1 次提交
  4. 13 5月, 2015 12 次提交
  5. 11 5月, 2015 2 次提交
    • D
      crypto: 842 - change 842 alg to use software · 2062c5b6
      Dan Streetman 提交于
      Change the crypto 842 compression alg to use the software 842 compression
      and decompression library.  Add the crypto driver_name as "842-generic".
      Remove the fallback to LZO compression.
      
      Previously, this crypto compression alg attemped 842 compression using
      PowerPC hardware, and fell back to LZO compression and decompression if
      the 842 PowerPC hardware was unavailable or failed.  This should not
      fall back to any other compression method, however; users of this crypto
      compression alg can fallback if desired, and transparent fallback tricks
      callers into thinking they are getting 842 compression when they actually
      get LZO compression - the failure of the 842 hardware should not be
      transparent to the caller.
      
      The crypto compression alg for a hardware device also should not be located
      in crypto/ so this is now a software-only implementation that uses the 842
      software compression/decompression library.
      Signed-off-by: NDan Streetman <ddstreet@ieee.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2062c5b6
    • A
      crypto: testmgr - add test cases for CRC32 · ebb3472f
      Ard Biesheuvel 提交于
      This adds a couple of test cases for CRC32 (not CRC32c) to
      ensure that the generic and arch specific implementations
      are in sync.
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Acked-by: NSteve Capper <steve.capper@linaro.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      ebb3472f
  6. 01 5月, 2015 2 次提交
    • D
      crypto: testmgr - Wrap the LHS in expressions of the form !x == y · 09e21784
      David Howells 提交于
      In the test manager, there are a number of if-statements with expressions of
      the form !x == y that incur warnings with gcc-5 of the following form:
      
      ../crypto/testmgr.c: In function '__test_aead':
      ../crypto/testmgr.c:523:12: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
         if (!ret == template[i].fail) {
                  ^
      
      By converting the 'fail' member of struct aead_testvec and struct
      cipher_testvec to a bool, we can get rid of the warnings.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      09e21784
    • D
      crypto: pcomp - Constify (de)compression parameters · f94a3597
      David Howells 提交于
      In testmgr, struct pcomp_testvec takes a non-const 'params' field, which is
      pointed to a const deflate_comp_params or deflate_decomp_params object.  With
      gcc-5 this incurs the following warnings:
      
      In file included from ../crypto/testmgr.c:44:0:
      ../crypto/testmgr.h:28736:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28748:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28776:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      ../crypto/testmgr.h:28800:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      
      Fix this by making the parameters pointer const and constifying the things
      that use it.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f94a3597
  7. 26 4月, 2015 3 次提交
  8. 23 4月, 2015 6 次提交