1. 21 9月, 2006 19 次提交
    • H
      [CRYPTO] cipher: Added block cipher type · 5cde0af2
      Herbert Xu 提交于
      This patch adds the new type of block ciphers.  Unlike current cipher
      algorithms which operate on a single block at a time, block ciphers
      operate on an arbitrarily long linear area of data.  As it is block-based,
      it will skip any data remaining at the end which cannot form a block.
      
      The block cipher has one major difference when compared to the existing
      block cipher implementation.  The sg walking is now performed by the
      algorithm rather than the cipher mid-layer.  This is needed for drivers
      that directly support sg lists.  It also improves performance for all
      algorithms as it reduces the total number of indirect calls by one.
      
      In future the existing cipher algorithm will be converted to only have
      a single-block interface.  This will be done after all existing users
      have switched over to the new block cipher type.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5cde0af2
    • H
      [CRYPTO] scatterwalk: Prepare for block ciphers · 5c64097a
      Herbert Xu 提交于
      This patch prepares the scatterwalk code for use by the new block cipher
      type.
      
      Firstly it halves the size of scatter_walk on 32-bit platforms.  This
      is important as we allocate at least two of these objects on the stack
      for each block cipher operation.
      
      It also exports the symbols since the block cipher code can be built as
      a module.
      
      Finally there is a hack in scatterwalk_unmap that relies on progress
      being made.  Unfortunately, for hardware crypto we can't guarantee
      progress to be made since the hardware can fail.
      
      So this also gets rid of the hack by not advancing the address returned
      by scatterwalk_map.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      5c64097a
    • H
      [CRYPTO] cipher: Added encrypt_one/decrypt_one · f28776a3
      Herbert Xu 提交于
      This patch adds two new operations for the simple cipher that encrypts or
      decrypts a single block at a time.  This will be the main interface after
      the existing block operations have moved over to the new block ciphers.
      
      It also adds the crypto_cipher type which is currently only used on the
      new operations but will be extended to setkey as well once existing users
      have been converted to use block ciphers where applicable.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f28776a3
    • H
      [CRYPTO] api: Added crypto_type support · e853c3cf
      Herbert Xu 提交于
      This patch adds the crypto_type structure which will be used for all new
      crypto algorithm types, beginning with block ciphers.
      
      The primary purpose of this abstraction is to allow different crypto_type
      objects for crypto algorithms of the same type, in particular, there will
      be a different crypto_type objects for asynchronous algorithms.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      e853c3cf
    • H
      [CRYPTO] api: Added crypto_alloc_base · 6d7d684d
      Herbert Xu 提交于
      Up until now all crypto transforms have been of the same type, struct
      crypto_tfm, regardless of whether they are ciphers, digests, or other
      types.  As a result of that, we check the types at run-time before
      each crypto operation.
      
      This is rather cumbersome.  We could instead use different C types for
      each crypto type to ensure that the correct types are used at compile
      time.  That is, we would have crypto_cipher/crypto_digest instead of
      just crypto_tfm.  The appropriate type would then be required for the
      actual operations such as crypto_digest_digest.
      
      Now that we have the type/mask fields when looking up algorithms, it
      is easy to request for an algorithm of the precise type that the user
      wants.  However, crypto_alloc_tfm currently does not expose these new
      attributes.
      
      This patch introduces the function crypto_alloc_base which will carry
      these new parameters.  It will be renamed to crypto_alloc_tfm once
      all existing users have been converted.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      6d7d684d
    • H
      [CRYPTO] api: Added asynchronous flag · f3f632d6
      Herbert Xu 提交于
      This patch adds the asynchronous flag and changes all existing users to
      only look up algorithms that are synchronous.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f3f632d6
    • H
      [CRYPTO] api: Add common instance initialisation code · 7fed0bf2
      Herbert Xu 提交于
      This patch adds the helpers crypto_get_attr_alg and crypto_alloc_instance
      which can be used by simple one-argument templates like hmac to process
      input parameters and allocate instances.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      7fed0bf2
    • H
      [CRYPTO] cipher: Removed special IV checks for ECB · df89820e
      Herbert Xu 提交于
      This patch makes IV operations on ECB fail through nocrypt_iv rather than
      calling BUG().  This is needed to generalise CBC/ECB using the template
      mechanism.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      df89820e
    • H
      [CRYPTO] api: Get rid of flags argument to setkey · 560c06ae
      Herbert Xu 提交于
      Now that the tfm is passed directly to setkey instead of the ctx, we no
      longer need to pass the &tfm->crt_flags pointer.
      
      This patch also gets rid of a few unnecessary checks on the key length
      for ciphers as the cipher layer guarantees that the key length is within
      the bounds specified by the algorithm.
      
      Rather than testing dia_setkey every time, this patch does it only once
      during crypto_alloc_tfm.  The redundant check from crypto_digest_setkey
      is also removed.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      560c06ae
    • M
      [CRYPTO] api: Add missing accessors for new crypto_alg fields · b14cdd67
      Michal Ludvig 提交于
      Add missing accessors for cra_driver_name and cra_priority.
      Signed-off-by: NMichal Ludvig <michal@logix.cz>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      b14cdd67
    • H
      [CRYPTO] api: Added spawns · 6bfd4809
      Herbert Xu 提交于
      Spawns lock a specific crypto algorithm in place.  They can then be used
      with crypto_spawn_tfm to allocate a tfm for that algorithm.  When the base
      algorithm of a spawn is deregistered, all its spawns will be automatically
      removed.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6bfd4809
    • H
      [CRYPTO] api: Add cryptomgr · 2b8c19db
      Herbert Xu 提交于
      The cryptomgr module is a simple manager of crypto algorithm instances.
      It ensures that parameterised algorithms of the type tmpl(alg) (e.g.,
      cbc(aes)) are always created.
      
      This is meant to satisfy the needs for most users.  For more complex
      cases such as deeper combinations or multiple parameters, a netlink
      module will be created which allows arbitrary expressions to be parsed
      in user-space.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2b8c19db
    • H
      [CRYPTO] api: Added event notification · 2825982d
      Herbert Xu 提交于
      This patch adds a notifier chain for algorithm/template registration events.
      This will be used to register compound algorithms such as cbc(aes).  In
      future this will also be passed onto user-space through netlink.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2825982d
    • H
      [CRYPTO] api: Add template registration · 4cc7720c
      Herbert Xu 提交于
      A crypto_template generates a crypto_alg object when given a set of
      parameters.  this patch adds the basic data structure fo templates
      and code to handle their registration/deregistration.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4cc7720c
    • H
      [CRYPTO] api: Split out low-level API · cce9e06d
      Herbert Xu 提交于
      The crypto API is made up of the part facing users such as IPsec and the
      low-level part which is used by cryptographic entities such as algorithms.
      This patch splits out the latter so that the two APIs are more clearly
      delineated.  As a bonus the low-level API can now be modularised if all
      algorithms are built as modules.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      cce9e06d
    • H
      [IPSEC]: Move linux/crypto.h inclusion out of net/xfrm.h · 9409f38a
      Herbert Xu 提交于
      The header file linux/crypto.h is only needed by a few files so including
      it in net/xfrm.h (which is included by half of the networking stack) is a
      waste.  This patch moves it out of net/xfrm.h and into the specific header
      files that actually need it.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      9409f38a
    • H
      [CRYPTO] api: Add crypto_alg reference counting · 6521f302
      Herbert Xu 提交于
      Up until now we've relied on module reference counting to ensure that the
      crypto_alg structures don't disappear from under us.  This was good enough
      as long as each crypto_alg came from exactly one module.
      
      However, with parameterised crypto algorithms a crypto_alg object may need
      two or more modules to operate.  This means that we need to count the
      references to the crypto_alg object directly.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6521f302
    • J
      [CRYPTO] twofish: Split out common c code · 2729bb42
      Joachim Fritschi 提交于
      This patch splits up the twofish crypto routine into a common part ( key
      setup  ) which will be uses by all twofish crypto modules ( generic-c , i586
      assembler and x86_64 assembler ) and generic-c part. It also creates a new
      header file which will be used by all 3 modules.
      
      This eliminates all code duplication.
      
      Correctness was verified with the tcrypt module and automated test scripts.
      Signed-off-by: NJoachim Fritschi <jfritschi@freenet.de>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2729bb42
    • H
      [CRYPTO] api: Fixed crypto_tfm context alignment · 79911102
      Herbert Xu 提交于
      Previously the __aligned__ attribute was added to the crypto_tfm context
      member to ensure it is alinged correctly on architectures such as arm.
      Unfortunately kmalloc does not use the same minimum alignment rules as
      gcc so this is useless.
      
      This patch changes it to use kmalloc's minimum alignment.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      79911102
  2. 19 9月, 2006 3 次提交
  3. 18 9月, 2006 2 次提交
  4. 17 9月, 2006 5 次提交
  5. 14 9月, 2006 1 次提交
  6. 13 9月, 2006 9 次提交
  7. 12 9月, 2006 1 次提交