11 Jan, 2012

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (54 commits)
    crypto: gf128mul - remove leftover "(EXPERIMENTAL)" in Kconfig
    crypto: serpent-sse2 - remove unneeded LRW/XTS #ifdefs
    crypto: serpent-sse2 - select LRW and XTS
    crypto: twofish-x86_64-3way - remove unneeded LRW/XTS #ifdefs
    crypto: twofish-x86_64-3way - select LRW and XTS
    crypto: xts - remove dependency on EXPERIMENTAL
    crypto: lrw - remove dependency on EXPERIMENTAL
    crypto: picoxcell - fix boolean and / or confusion
    crypto: caam - remove DECO access initialization code
    crypto: caam - fix polarity of "propagate error" logic
    crypto: caam - more desc.h cleanups
    crypto: caam - desc.h - convert spaces to tabs
    crypto: talitos - convert talitos_error to struct device
    crypto: talitos - remove NO_IRQ references
    crypto: talitos - fix bad kfree
    crypto: convert drivers/crypto/* to use module_platform_driver()
    char: hw_random: convert drivers/char/hw_random/* to use module_platform_driver()
    crypto: serpent-sse2 - should select CRYPTO_CRYPTD
    crypto: serpent - rename serpent.c to serpent_generic.c
    crypto: serpent - cleanup checkpatch errors and warnings
    ...

    Linus Torvalds
     

20 Dec, 2011

5 commits


30 Nov, 2011

1 commit


21 Nov, 2011

2 commits

  • Patch adds i586/SSE2 assembler implementation of serpent cipher. Assembler
    functions crypt data in four block chunks.

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmarks results (serpent-sse2/serpent_generic speed ratios):

    Intel Atom N270:

    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
    16 0.95x 1.12x 1.02x 1.07x 0.97x 0.98x
    64 1.73x 1.82x 1.08x 1.82x 1.72x 1.73x
    256 2.08x 2.00x 1.04x 2.07x 1.99x 2.01x
    1024 2.28x 2.18x 1.05x 2.23x 2.17x 2.20x
    8192 2.28x 2.13x 1.05x 2.23x 2.18x 2.20x

    Full output:
    http://koti.mbnet.fi/axh/kernel/crypto/atom-n270/serpent-generic.txt
    http://koti.mbnet.fi/axh/kernel/crypto/atom-n270/serpent-sse2.txt

    Userspace test results:

    Encryption/decryption of sse2-i586 vs generic on Intel Atom N270:
    encrypt: 2.35x
    decrypt: 2.54x

    Encryption/decryption of sse2-i586 vs generic on AMD Phenom II:
    encrypt: 1.82x
    decrypt: 2.51x

    Encryption/decryption of sse2-i586 vs generic on Intel Xeon E7330:
    encrypt: 2.99x
    decrypt: 3.48x

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     
  • Patch adds x86_64/SSE2 assembler implementation of serpent cipher. Assembler
    functions crypt data in eigth block chunks (two 4 block chunk SSE2 operations
    in parallel to improve performance on out-of-order CPUs). Glue code is based
    on one from AES-NI implementation, so requests from irq context are redirected
    to cryptd.

    v2:
    - add missing include of linux/module.h
    (appearently crypto.h used to include module.h, which changed for 3.2 by
    commit 7c926402a7e8c9b279968fd94efec8700ba3859e)

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmarks results (serpent-sse2/serpent_generic speed ratios):

    AMD Phenom II 1055T (fam:16, model:10):

    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
    16B 1.03x 1.01x 1.03x 1.05x 1.00x 0.99x
    64B 1.00x 1.01x 1.02x 1.04x 1.02x 1.01x
    256B 2.34x 2.41x 0.99x 2.43x 2.39x 2.40x
    1024B 2.51x 2.57x 1.00x 2.59x 2.56x 2.56x
    8192B 2.50x 2.54x 1.00x 2.55x 2.57x 2.57x

    Intel Celeron T1600 (fam:6, model:15, step:13):

    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
    16B 0.97x 0.97x 1.01x 1.01x 1.01x 1.02x
    64B 1.00x 1.00x 1.00x 1.02x 1.01x 1.01x
    256B 3.41x 3.35x 1.00x 3.39x 3.42x 3.44x
    1024B 3.75x 3.72x 0.99x 3.74x 3.75x 3.75x
    8192B 3.70x 3.68x 0.99x 3.68x 3.69x 3.69x

    Full output:
    http://koti.mbnet.fi/axh/kernel/crypto/phenom-ii-1055t/serpent-generic.txt
    http://koti.mbnet.fi/axh/kernel/crypto/phenom-ii-1055t/serpent-sse2.txt
    http://koti.mbnet.fi/axh/kernel/crypto/celeron-t1600/serpent-generic.txt
    http://koti.mbnet.fi/axh/kernel/crypto/celeron-t1600/serpent-sse2.txt

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

14 Nov, 2011

2 commits


09 Nov, 2011

1 commit


01 Nov, 2011

1 commit


26 Oct, 2011

1 commit


21 Oct, 2011

2 commits

  • This patch adds a basic userspace configuration API for the crypto layer.
    With this it is possible to instantiate, remove and to show crypto
    algorithms from userspace.

    Signed-off-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Steffen Klassert
     
  • Patch adds 3-way parallel x86_64 assembly implementation of twofish as new
    module. New assembler functions crypt data in three blocks chunks, improving
    cipher performance on out-of-order CPUs.

    Patch has been tested with tcrypt and automated filesystem tests.

    Summary of the tcrypt benchmarks:

    Twofish 3-way-asm vs twofish asm (128bit 8kb block ECB)
    encrypt: 1.3x speed
    decrypt: 1.3x speed

    Twofish 3-way-asm vs twofish asm (128bit 8kb block CBC)
    encrypt: 1.07x speed
    decrypt: 1.4x speed

    Twofish 3-way-asm vs twofish asm (128bit 8kb block CTR)
    encrypt: 1.4x speed

    Twofish 3-way-asm vs AES asm (128bit 8kb block ECB)
    encrypt: 1.0x speed
    decrypt: 1.0x speed

    Twofish 3-way-asm vs AES asm (128bit 8kb block CBC)
    encrypt: 0.84x speed
    decrypt: 1.09x speed

    Twofish 3-way-asm vs AES asm (128bit 8kb block CTR)
    encrypt: 1.15x speed

    Full output:
    http://koti.mbnet.fi/axh/kernel/crypto/tcrypt-speed-twofish-3way-asm-x86_64.txt
    http://koti.mbnet.fi/axh/kernel/crypto/tcrypt-speed-twofish-asm-x86_64.txt
    http://koti.mbnet.fi/axh/kernel/crypto/tcrypt-speed-aes-asm-x86_64.txt

    Tests were run on:
    vendor_id : AuthenticAMD
    cpu family : 16
    model : 10
    model name : AMD Phenom(tm) II X6 1055T Processor

    Also userspace test were run on:
    vendor_id : GenuineIntel
    cpu family : 6
    model : 15
    model name : Intel(R) Xeon(R) CPU E7330 @ 2.40GHz
    stepping : 11

    Userspace test results:

    Encryption/decryption of twofish 3-way vs x86_64-asm on AMD Phenom II:
    encrypt: 1.27x
    decrypt: 1.25x

    Encryption/decryption of twofish 3-way vs x86_64-asm on Intel Xeon E7330:
    encrypt: 1.36x
    decrypt: 1.36x

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

22 Sep, 2011

2 commits

  • Patch adds x86_64 assembly implementation of blowfish. Two set of assembler
    functions are provided. First set is regular 'one-block at time'
    encrypt/decrypt functions. Second is 'four-block at time' functions that
    gain performance increase on out-of-order CPUs. Performance of 4-way
    functions should be equal to 1-way functions with in-order CPUs.

    Summary of the tcrypt benchmarks:

    Blowfish assembler vs blowfish C (256bit 8kb block ECB)
    encrypt: 2.2x speed
    decrypt: 2.3x speed

    Blowfish assembler vs blowfish C (256bit 8kb block CBC)
    encrypt: 1.12x speed
    decrypt: 2.5x speed

    Blowfish assembler vs blowfish C (256bit 8kb block CTR)
    encrypt: 2.5x speed

    Full output:
    http://koti.mbnet.fi/axh/kernel/crypto/tcrypt-speed-blowfish-asm-x86_64.txt
    http://koti.mbnet.fi/axh/kernel/crypto/tcrypt-speed-blowfish-c-x86_64.txt

    Tests were run on:
    vendor_id : AuthenticAMD
    cpu family : 16
    model : 10
    model name : AMD Phenom(tm) II X6 1055T Processor
    stepping : 0

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     
  • Patch splits up the blowfish crypto routine into a common part (key setup)
    which will be used by blowfish crypto modules (x86_64 assembly and generic-c).

    Also fixes errors/warnings reported by checkpatch.

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

10 Aug, 2011

1 commit

  • This is an assembler implementation of the SHA1 algorithm using the
    Supplemental SSE3 (SSSE3) instructions or, when available, the
    Advanced Vector Extensions (AVX).

    Testing with the tcrypt module shows the raw hash performance is up to
    2.3 times faster than the C implementation, using 8k data blocks on a
    Core 2 Duo T5500. For the smalest data set (16 byte) it is still 25%
    faster.

    Since this implementation uses SSE/YMM registers it cannot safely be
    used in every situation, e.g. while an IRQ interrupts a kernel thread.
    The implementation falls back to the generic SHA1 variant, if using
    the SSE/YMM registers is not possible.

    With this algorithm I was able to increase the throughput of a single
    IPsec link from 344 Mbit/s to 464 Mbit/s on a Core 2 Quad CPU using
    the SSSE3 variant -- a speedup of +34.8%.

    Saving and restoring SSE/YMM state might make the actual throughput
    fluctuate when there are FPU intensive userland applications running.
    For example, meassuring the performance using iperf2 directly on the
    machine under test gives wobbling numbers because iperf2 uses the FPU
    for each packet to check if the reporting interval has expired (in the
    above test I got min/max/avg: 402/484/464 MBit/s).

    Using this algorithm on a IPsec gateway gives much more reasonable and
    stable numbers, albeit not as high as in the directly connected case.
    Here is the result from an RFC 2544 test run with a EXFO Packet Blazer
    FTB-8510:

    frame size sha1-generic sha1-ssse3 delta
    64 byte 37.5 MBit/s 37.5 MBit/s 0.0%
    128 byte 56.3 MBit/s 62.5 MBit/s +11.0%
    256 byte 87.5 MBit/s 100.0 MBit/s +14.3%
    512 byte 131.3 MBit/s 150.0 MBit/s +14.2%
    1024 byte 162.5 MBit/s 193.8 MBit/s +19.3%
    1280 byte 175.0 MBit/s 212.5 MBit/s +21.4%
    1420 byte 175.0 MBit/s 218.7 MBit/s +25.0%
    1518 byte 150.0 MBit/s 181.2 MBit/s +20.8%

    The throughput for the largest frame size is lower than for the
    previous size because the IP packets need to be fragmented in this
    case to make there way through the IPsec tunnel.

    Signed-off-by: Mathias Krause
    Cc: Maxim Locktyukhin
    Signed-off-by: Herbert Xu

    Mathias Krause
     

26 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

11 Jul, 2011

1 commit


30 Jun, 2011

1 commit


16 May, 2011

1 commit

  • Loading fpu without aesni-intel does nothing. Loading aesni-intel
    without fpu causes modes like xts to fail. (Unloading
    aesni-intel will restore those modes.)

    One solution would be to make aesni-intel depend on fpu, but it
    seems cleaner to just combine the modules.

    This is probably responsible for bugs like:
    https://bugzilla.redhat.com/show_bug.cgi?id=589390

    Signed-off-by: Andy Lutomirski
    Signed-off-by: Herbert Xu

    Andy Lutomirski
     

28 Dec, 2010

1 commit


29 Nov, 2010

1 commit

  • Add missing dependency on NET since we require sockets for our
    interface.

    Should really be a select but kconfig doesn't like that:

    net/Kconfig:6:error: found recursive dependency: NET -> NETWORK_FILESYSTEMS -> AFS_FS -> AF_RXRPC -> CRYPTO -> CRYPTO_USER_API_HASH -> CRYPTO_USER_API -> NET

    Reported-by: Zimny Lech
    Signed-off-by: Herbert Xu

    Herbert Xu
     

27 Nov, 2010

1 commit

  • The AES-NI instructions are also available in legacy mode so the 32-bit
    architecture may profit from those, too.

    To illustrate the performance gain here's a short summary of a dm-crypt
    speed test on a Core i7 M620 running at 2.67GHz comparing both assembler
    implementations:

    x86: i568 aes-ni delta
    ECB, 256 bit: 93.8 MB/s 123.3 MB/s +31.4%
    CBC, 256 bit: 84.8 MB/s 262.3 MB/s +209.3%
    LRW, 256 bit: 108.6 MB/s 222.1 MB/s +104.5%
    XTS, 256 bit: 105.0 MB/s 205.5 MB/s +95.7%

    Additionally, due to some minor optimizations, the 64-bit version also
    got a minor performance gain as seen below:

    x86-64: old impl. new impl. delta
    ECB, 256 bit: 121.1 MB/s 123.0 MB/s +1.5%
    CBC, 256 bit: 285.3 MB/s 290.8 MB/s +1.9%
    LRW, 256 bit: 263.7 MB/s 265.3 MB/s +0.6%
    XTS, 256 bit: 251.1 MB/s 255.3 MB/s +1.7%

    Signed-off-by: Mathias Krause
    Reviewed-by: Huang Ying
    Signed-off-by: Herbert Xu

    Mathias Krause
     

26 Nov, 2010

1 commit

  • 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: Herbert Xu
    Acked-by: David S. Miller

    Herbert Xu
     

19 Nov, 2010

2 commits

  • 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: Herbert Xu
    Acked-by: David S. Miller
    Tested-by: Martin Willi

    Herbert Xu
     
  • 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: Herbert Xu
    Acked-by: David S. Miller
    Tested-by: Martin Willi

    Herbert Xu
     

12 Sep, 2010

1 commit

  • Below is a patch to update the broken web addresses, in crypto/*
    that I could locate. Some are just simple typos that needed to be
    fixed, and some had a change in location altogether..
    let me know if any of them need to be changed and such.

    Signed-off-by: Justin P. Mattock
    Signed-off-by: Herbert Xu

    Justin P. Mattock
     

03 Sep, 2010

1 commit


06 Aug, 2010

2 commits

  • On Thu, Aug 05, 2010 at 07:01:21PM -0700, Linus Torvalds wrote:
    > On Thu, Aug 5, 2010 at 6:40 PM, Herbert Xu wrote:
    > >
    > > -config CRYPTO_MANAGER_TESTS
    > > - bool "Run algolithms' self-tests"
    > > - default y
    > > - depends on CRYPTO_MANAGER2
    > > +config CRYPTO_MANAGER_DISABLE_TESTS
    > > + bool "Disable run-time self tests"
    > > + depends on CRYPTO_MANAGER2 && EMBEDDED
    >
    > Why do you still want to force-enable those tests? I was going to
    > complain about the "default y" anyway, now I'm _really_ complaining,
    > because you've now made it impossible to disable those tests. Why?

    As requested, this patch sets the default to y and removes the
    EMBEDDED dependency.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch fixes a serious bug in the test disabling patch where
    it can cause an spurious load of the cryptomgr module even when
    it's compiled in.

    It also negates the test disabling option so that its absence
    causes tests to be enabled.

    The Kconfig option is also now behind EMBEDDED.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

03 Jun, 2010

2 commits


29 Mar, 2010

1 commit


08 Mar, 2010

1 commit


05 Feb, 2010

1 commit


07 Jan, 2010

1 commit


27 Oct, 2009

1 commit