Skip to content
Snippets Groups Projects
  1. Mar 13, 2011
  2. Nov 27, 2010
  3. Nov 26, 2010
    • Herbert Xu's avatar
      crypto: algif_skcipher - User-space interface for skcipher operations · 8ff59090
      Herbert Xu authored
      
      This patch adds the af_alg plugin for symmetric key ciphers,
      corresponding to the ablkcipher kernel operation type.
      
      Keys can optionally be set through the setsockopt interface.
      
      Once a sendmsg call occurs without MSG_MORE no further writes
      may be made to the socket until all previous data has been read.
      
      IVs and and whether encryption/decryption is performed can be
      set through the setsockopt interface or as a control message
      to sendmsg.
      
      The interface is completely synchronous, all operations are
      carried out in recvmsg(2) and will complete prior to the system
      call returning.
      
      The splice(2) interface support reading the user-space data directly
      without copying (except that the Crypto API itself may copy the data
      if alignment is off).
      
      The recvmsg(2) interface supports directly writing to user-space
      without additional copying, i.e., the kernel crypto interface will
      receive the user-space address as its output SG list.
      
      Thakns to Miloslav Trmac for reviewing this and contributing
      fixes and improvements.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      8ff59090
  4. Nov 19, 2010
    • Herbert Xu's avatar
      crypto: algif_hash - User-space interface for hash operations · fe869cdb
      Herbert Xu authored
      
      This patch adds the af_alg plugin for hash, corresponding to
      the ahash kernel operation type.
      
      Keys can optionally be set through the setsockopt interface.
      
      Each sendmsg call will finalise the hash unless sent with a MSG_MORE
      flag.
      
      Partial hash states can be cloned using accept(2).
      
      The interface is completely synchronous, all operations will
      complete prior to the system call returning.
      
      Both sendmsg(2) and splice(2) support reading the user-space
      data directly without copying (except that the Crypto API itself
      may copy the data if alignment is off).
      
      For now only the splice(2) interface supports performing digest
      instead of init/update/final.  In future the sendmsg(2) interface
      will also be modified to use digest/finup where possible so that
      hardware that cannot return a partial hash state can still benefit
      from this interface.
      
      Thakns to Miloslav Trmac for reviewing this and contributing
      fixes and improvements.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Tested-by: default avatarMartin Willi <martin@strongswan.org>
      fe869cdb
    • Herbert Xu's avatar
      crypto: af_alg - User-space interface for Crypto API · 03c8efc1
      Herbert Xu authored
      
      This patch creates the backbone of the user-space interface for
      the Crypto API, through a new socket family AF_ALG.
      
      Each session corresponds to one or more connections obtained from
      that socket.  The number depends on the number of inputs/outputs
      of that particular type of operation.  For most types there will
      be a s ingle connection/file descriptor that is used for both input
      and output.  AEAD is one of the few that require two inputs.
      
      Each algorithm type will provide its own implementation that plugs
      into af_alg.  They're keyed using a string such as "skcipher" or
      "hash".
      
      IOW this patch only contains the boring bits that is required
      to hold everything together.
      
      Thakns to Miloslav Trmac for reviewing this and contributing
      fixes and improvements.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
      Tested-by: default avatarMartin Willi <martin@strongswan.org>
      03c8efc1
  5. Jun 03, 2010
  6. Jan 06, 2010
  7. Sep 02, 2009
  8. Aug 05, 2009
  9. Jul 13, 2009
  10. Mar 04, 2009
    • Geert Uytterhoeven's avatar
      crypto: zlib - New zlib crypto module, using pcomp · bf68e65e
      Geert Uytterhoeven authored
      
      Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Cc: James Morris <jmorris@namei.org>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      bf68e65e
    • Geert Uytterhoeven's avatar
      crypto: compress - Add pcomp interface · a1d2f095
      Geert Uytterhoeven authored
      
      The current "comp" crypto interface supports one-shot (de)compression only,
      i.e. the whole data buffer to be (de)compressed must be passed at once, and
      the whole (de)compressed data buffer will be received at once.
      In several use-cases (e.g. compressed file systems that store files in big
      compressed blocks), this workflow is not suitable.
      Furthermore, the "comp" type doesn't provide for the configuration of
      (de)compression parameters, and always allocates workspace memory for both
      compression and decompression, which may waste memory.
      
      To solve this, add a "pcomp" partial (de)compression interface that provides
      the following operations:
        - crypto_compress_{init,update,final}() for compression,
        - crypto_decompress_{init,update,final}() for decompression,
        - crypto_{,de}compress_setup(), to configure (de)compression parameters
          (incl. allocating workspace memory).
      
      The (de)compression methods take a struct comp_request, which was mimicked
      after the z_stream object in zlib, and contains buffer pointer and length
      pairs for input and output.
      
      The setup methods take an opaque parameter pointer and length pair. Parameters
      are supposed to be encoded using netlink attributes, whose meanings depend on
      the actual (name of the) (de)compression algorithm.
      
      Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      a1d2f095
  11. Feb 18, 2009
  12. Dec 24, 2008
    • Herbert Xu's avatar
      crypto: hash - Add shash interface · 7b5a080b
      Herbert Xu authored
      
      The shash interface replaces the current synchronous hash interface.
      It improves over hash in two ways.  Firstly shash is reentrant,
      meaning that the same tfm may be used by two threads simultaneously
      as all hashing state is stored in a local descriptor.
      
      The other enhancement is that shash no longer takes scatter list
      entries.  This is because shash is specifically designed for
      synchronous algorithms and as such scatter lists are unnecessary.
      
      All existing hash users will be converted to shash once the
      algorithms have been completely converted.
      
      There is also a new finup function that combines update with final.
      This will be extended to ahash once the algorithm conversion is
      done.
      
      This is also the first time that an algorithm type has their own
      registration function.  Existing algorithm types will be converted
      to this way in due course.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      7b5a080b
  13. Dec 10, 2008
  14. Aug 28, 2008
  15. Jul 15, 2008
  16. Jul 10, 2008
  17. Apr 20, 2008
  18. Feb 22, 2008
  19. Jan 10, 2008
  20. Oct 10, 2007
    • Sebastian Siewior's avatar
      [CRYPTO] sha: Load the SHA[1|256] module by an alias · ad5d2789
      Sebastian Siewior authored
      
      Loading the crypto algorithm by the alias instead of by module directly
      has the advantage that all possible implementations of this algorithm
      are loaded automatically and the crypto API can choose the best one
      depending on its priority.
      
      Additionally it ensures that the generic implementation as well as the
      HW driver (if available) is loaded in case the HW driver needs the
      generic version as fallback in corner cases.
      
      Also remove the probe for sha1 in padlock's init code.
      
      Quote from Herbert:
        The probe is actually pointless since we can always probe when
        the algorithm is actually used which does not lead to dead-locks
        like this.
      
      Signed-off-by: default avatarSebastian Siewior <sebastian@breakpoint.cc>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      ad5d2789
    • Sebastian Siewior's avatar
      [CRYPTO] aes: Rename aes to aes-generic · f8246af0
      Sebastian Siewior authored
      
      Loading the crypto algorithm by the alias instead of by module directly
      has the advantage that all possible implementations of this algorithm
      are loaded automatically and the crypto API can choose the best one
      depending on its priority.
      
      Additionally it ensures that the generic implementation as well as the
      HW driver (if available) is loaded in case the HW driver needs the
      generic version as fallback in corner cases.
      
      Signed-off-by: default avatarSebastian Siewior <sebastian@breakpoint.cc>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      f8246af0
Loading