1. 14 Jan, 2015 1 commit
    • Timothy McCaffrey's avatar
      crypto: aesni - Add support for 192 & 256 bit keys to AESNI RFC4106 · e31ac32d
      Timothy McCaffrey authored
      These patches fix the RFC4106 implementation in the aesni-intel
      module so it supports 192 & 256 bit keys.
      
      Since the AVX support that was added to this module also only
      supports 128 bit keys, and this patch only affects the SSE
      implementation, changes were also made to use the SSE version
      if key sizes other than 128 are specified.
      
      RFC4106 specifies that 192 & 256 bit keys must be supported (section
      8.4).
      
      Also, this should fix Strongswan issue 341 where the aesni module
      needs to be unloaded if 256 bit keys are used:
      
      http://wiki.strongswan.org/issues/341
      
      This patch has been tested with Sandy Bridge and Haswell processors.
      With 128 bit keys and input buffers > 512 bytes a slight performance
      degradation was noticed (~1%).  For input buffers of less than 512
      bytes there was no performance impact.  Compared to 128 bit keys,
      256 bit key size performance is approx. .5 cycles per byte slower
      on Sandy Bridge, and .37 cycles per byte slower on Haswell (vs.
      SSE code).
      
      This patch has also been tested with StrongSwan IPSec connections
      where it worked correctly.
      
      I created this diff from a git clone of crypto-2.6.git.
      
      Any questions, please feel free to contact me.
      Signed-off-by: default avatarTimothy McCaffrey <timothy.mccaffrey@unisys.com>
      Signed-off-by: default avatarJarod Wilson <jarod@redhat.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      e31ac32d
  2. 13 Jan, 2015 11 commits
  3. 08 Jan, 2015 4 commits
  4. 05 Jan, 2015 2 commits
  5. 04 Jan, 2015 1 commit
  6. 29 Dec, 2014 2 commits
    • Stephan Mueller's avatar
      crypto: algif_rng - enable RNG interface compilation · 2f375538
      Stephan Mueller authored
      Enable compilation of the RNG AF_ALG support and provide a Kconfig
      option to compile the RNG AF_ALG support.
      Signed-off-by: default avatarStephan Mueller <smueller@chronox.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      2f375538
    • Stephan Mueller's avatar
      crypto: algif_rng - add random number generator support · 5afdfd22
      Stephan Mueller authored
      This patch adds the random number generator support for AF_ALG.
      
      A random number generator's purpose is to generate data without
      requiring the caller to provide any data. Therefore, the AF_ALG
      interface handler for RNGs only implements a callback handler for
      recvmsg.
      
      The following parameters provided with a recvmsg are processed by the
      RNG callback handler:
      
      	* sock - to resolve the RNG context data structure accessing the
      	  RNG instance private to the socket
      
      	* len - this parameter allows userspace callers to specify how
      	  many random bytes the RNG shall produce and return. As the
      	  kernel context for the RNG allocates a buffer of 128 bytes to
      	  store random numbers before copying them to userspace, the len
      	  parameter is checked that it is not larger than 128. If a
      	  caller wants more random numbers, a new request for recvmsg
      	  shall be made.
      
      The size of 128 bytes is chose because of the following considerations:
      
      	* to increase the memory footprint of the kernel too much (note,
      	  that would be 128 bytes per open socket)
      
      	* 128 is divisible by any typical cryptographic block size an
      	  RNG may have
      
      	* A request for random numbers typically only shall supply small
      	  amount of data like for keys or IVs that should only require
      	  one invocation of the recvmsg function.
      
      Note, during instantiation of the RNG, the code checks whether the RNG
      implementation requires seeding. If so, the RNG is seeded with output
      from get_random_bytes.
      
      A fully working example using all aspects of the RNG interface is
      provided at http://www.chronox.de/libkcapi.htmlSigned-off-by: default avatarStephan Mueller <smueller@chronox.de>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      5afdfd22
  7. 25 Dec, 2014 6 commits
  8. 23 Dec, 2014 5 commits
  9. 22 Dec, 2014 8 commits