21 Mar, 2014

1 commit


28 Nov, 2013

1 commit

  • Commit d8a32ac25698cd60b02bed2100379803c7f964e3 (crypto: testmgr - make
    test_aead also test 'dst != src' code paths) added support for different
    source and destination buffers in test_aead.

    This patch modifies the source and destination buffer lengths accordingly:
    the lengths are not equal since encryption / decryption adds / removes
    the ICV.

    Cc: Jussi Kivilinna
    Signed-off-by: Horia Geanta
    Signed-off-by: Herbert Xu

    Horia Geanta
     

15 Nov, 2013

1 commit


07 Sep, 2013

2 commits


01 Aug, 2013

1 commit


24 Jul, 2013

1 commit

  • This reverts commits
    67822649d7305caf3dd50ed46c27b99c94eff996
    39761214eefc6b070f29402aa1165f24d789b3f7
    0b95a7f85718adcbba36407ef88bba0a7379ed03
    31d939625a9a20b1badd2d4e6bf6fd39fa523405
    2d31e518a42828df7877bca23a958627d60408bc

    Unfortunately this change broke boot on some systems that used an
    initrd which does not include the newly created crct10dif modules.
    As these modules are required by sd_mod under certain configurations
    this is a serious problem.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

21 Jun, 2013

6 commits


24 May, 2013

1 commit

  • These are simple tests to do sanity check of CRC T10 DIF hash. The
    correctness of the transform can be checked with the command
    modprobe tcrypt mode=47
    The speed of the transform can be evaluated with the command
    modprobe tcrypt mode=320

    Set the cpu frequency to constant and turn turbo off when running the
    speed test so the frequency governor will not tweak the frequency and
    affects the measurements.

    Signed-off-by: Tim Chen
    Signed-off-by: Herbert Xu

    Tim Chen
     

25 Apr, 2013

7 commits


20 Jan, 2013

1 commit

  • fcrypt is used only as pcbc(fcrypt), but testmgr does not know this.
    Use the zero key, zero plaintext pcbc(fcrypt) test vector for
    testing plain 'fcrypt' to hide "no test for fcrypt" warnings.

    Signed-off-by: Jussi Kivilinna
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

06 Dec, 2012

3 commits


09 Nov, 2012

1 commit

  • This patch adds AES-NI/AVX/x86_64 assembler implementation of Camellia block
    cipher. Implementation process data in sixteen block chunks, which are
    byte-sliced and AES SubBytes is reused for Camellia s-box with help of pre-
    and post-filtering.

    Patch has been tested with tcrypt and automated filesystem tests.

    tcrypt test results:

    Intel Core i5-2450M:

    camellia-aesni-avx vs camellia-asm-x86_64-2way:
    128bit key: (lrw:256bit) (xts:256bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.98x 0.96x 0.99x 0.96x 0.96x 0.95x 0.95x 0.94x 0.97x 0.98x
    64B 0.99x 0.98x 1.00x 0.98x 0.98x 0.99x 0.98x 0.93x 0.99x 0.98x
    256B 2.28x 2.28x 1.01x 2.29x 2.25x 2.24x 1.96x 1.97x 1.91x 1.90x
    1024B 2.57x 2.56x 1.00x 2.57x 2.51x 2.53x 2.19x 2.17x 2.19x 2.22x
    8192B 2.49x 2.49x 1.00x 2.53x 2.48x 2.49x 2.17x 2.17x 2.22x 2.22x

    256bit key: (lrw:384bit) (xts:512bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.97x 0.98x 0.99x 0.97x 0.97x 0.96x 0.97x 0.98x 0.98x 0.99x
    64B 1.00x 1.00x 1.01x 0.99x 0.98x 0.99x 0.99x 0.99x 0.99x 0.99x
    256B 2.37x 2.37x 1.01x 2.39x 2.35x 2.33x 2.10x 2.11x 1.99x 2.02x
    1024B 2.58x 2.60x 1.00x 2.58x 2.56x 2.56x 2.28x 2.29x 2.28x 2.29x
    8192B 2.50x 2.52x 1.00x 2.56x 2.51x 2.51x 2.24x 2.25x 2.26x 2.29x

    Signed-off-by: Jussi Kivilinna
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

24 Oct, 2012

2 commits


27 Sep, 2012

3 commits


01 Aug, 2012

4 commits

  • This patch adds a x86_64/avx assembler implementation of the Cast6 block
    cipher. The implementation processes eight blocks in parallel (two 4 block
    chunk AVX operations). The table-lookups are done in general-purpose registers.
    For small blocksizes the functions from the generic module are called. A good
    performance increase is provided for blocksizes greater or equal to 128B.

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmark results:

    Intel Core i5-2500 CPU (fam:6, model:42, step:7)

    cast6-avx-x86_64 vs. cast6-generic
    128bit key: (lrw:256bit) (xts:256bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.97x 1.00x 1.01x 1.01x 0.99x 0.97x 0.98x 1.01x 0.96x 0.98x
    64B 0.98x 0.99x 1.02x 1.01x 0.99x 1.00x 1.01x 0.99x 1.00x 0.99x
    256B 1.77x 1.84x 0.99x 1.85x 1.77x 1.77x 1.70x 1.74x 1.69x 1.72x
    1024B 1.93x 1.95x 0.99x 1.96x 1.93x 1.93x 1.84x 1.85x 1.89x 1.87x
    8192B 1.91x 1.95x 0.99x 1.97x 1.95x 1.91x 1.86x 1.87x 1.93x 1.90x

    256bit key: (lrw:384bit) (xts:512bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.97x 0.99x 1.02x 1.01x 0.98x 0.99x 1.00x 1.00x 0.98x 0.98x
    64B 0.98x 0.99x 1.01x 1.00x 1.00x 1.00x 1.01x 1.01x 0.97x 1.00x
    256B 1.77x 1.83x 1.00x 1.86x 1.79x 1.78x 1.70x 1.76x 1.71x 1.69x
    1024B 1.92x 1.95x 0.99x 1.96x 1.93x 1.93x 1.83x 1.86x 1.89x 1.87x
    8192B 1.94x 1.95x 0.99x 1.97x 1.95x 1.95x 1.87x 1.87x 1.93x 1.91x

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     
  • New ECB, CBC, CTR, LRW and XTS testvectors for cast6. We need larger
    testvectors to check parallel code paths in the optimized implementation. Tests
    have also been added to the tcrypt module.

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     
  • This patch adds a x86_64/avx assembler implementation of the Cast5 block
    cipher. The implementation processes sixteen blocks in parallel (four 4 block
    chunk AVX operations). The table-lookups are done in general-purpose registers.
    For small blocksizes the functions from the generic module are called. A good
    performance increase is provided for blocksizes greater or equal to 128B.

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmark results:

    Intel Core i5-2500 CPU (fam:6, model:42, step:7)

    cast5-avx-x86_64 vs. cast5-generic
    64bit key:
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
    16B 0.99x 0.99x 1.00x 1.00x 1.02x 1.01x
    64B 1.00x 1.00x 0.98x 1.00x 1.01x 1.02x
    256B 2.03x 2.01x 0.95x 2.11x 2.12x 2.13x
    1024B 2.30x 2.24x 0.95x 2.29x 2.35x 2.35x
    8192B 2.31x 2.27x 0.95x 2.31x 2.39x 2.39x

    128bit key:
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec
    16B 0.99x 0.99x 1.00x 1.00x 1.01x 1.01x
    64B 1.00x 1.00x 0.98x 1.01x 1.02x 1.01x
    256B 2.17x 2.13x 0.96x 2.19x 2.19x 2.19x
    1024B 2.29x 2.32x 0.95x 2.34x 2.37x 2.38x
    8192B 2.35x 2.32x 0.95x 2.35x 2.39x 2.39x

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     
  • New ECB, CBC and CTR testvectors for cast5. We need larger testvectors to check
    parallel code paths in the optimized implementation. Tests have also been added
    to the tcrypt module.

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     

11 Jul, 2012

2 commits

  • Test vectors were generated starting from existing CBC(AES) test vectors
    (RFC3602, NIST SP800-38A) and adding HMAC(SHA*) computed with Crypto++ and
    double-checked with HashCalc.

    Signed-off-by: Horia Geanta
    Signed-off-by: Herbert Xu

    Horia Geanta
     
  • Patch 863b557a88f8c033f7419fabafef4712a5055f85 added NULL entries
    for intel accelerated drivers but did not marked these fips allowed.
    This cause panic if running tests with fips=1.

    For ghash, fips_allowed flag was added in patch
    18c0ebd2d8194cce4b3f67e2903fa01bea892cbc.

    Without patch, "modprobe tcrypt" fails with
    alg: skcipher: Failed to load transform for cbc-aes-aesni: -2
    cbc-aes-aesni: cbc(aes) alg self test failed in fips mode!
    (panic)

    Also add missing cryptd(__driver-cbc-aes-aesni) and
    cryptd(__driver-gcm-aes-aesni) test to complement
    null tests above, otherwise system complains with
    alg: No test for __cbc-aes-aesni (cryptd(__driver-cbc-aes-aesni))
    alg: No test for __gcm-aes-aesni (cryptd(__driver-gcm-aes-aesni))

    Signed-off-by: Milan Broz
    Signed-off-by: Paul Wouters
    Signed-off-by: Herbert Xu

    Milan Broz
     

12 Jun, 2012

3 commits

  • This patch adds a x86_64/avx assembler implementation of the Serpent block
    cipher. The implementation is very similar to the sse2 implementation and
    processes eight blocks in parallel. Because of the new non-destructive three
    operand syntax all move-instructions can be removed and therefore a little
    performance increase is provided.

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmark results:

    Intel Core i5-2500 CPU (fam:6, model:42, step:7)

    serpent-avx-x86_64 vs. serpent-sse2-x86_64
    128bit key: (lrw:256bit) (xts:256bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 1.03x 1.01x 1.01x 1.01x 1.00x 1.00x 1.00x 1.00x 1.00x 1.01x
    64B 1.00x 1.00x 1.00x 1.00x 1.00x 0.99x 1.00x 1.01x 1.00x 1.00x
    256B 1.05x 1.03x 1.00x 1.02x 1.05x 1.06x 1.05x 1.02x 1.05x 1.02x
    1024B 1.05x 1.02x 1.00x 1.02x 1.05x 1.06x 1.05x 1.03x 1.05x 1.02x
    8192B 1.05x 1.02x 1.00x 1.02x 1.06x 1.06x 1.04x 1.03x 1.04x 1.02x

    256bit key: (lrw:384bit) (xts:512bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 1.01x 1.00x 1.01x 1.01x 1.00x 1.00x 0.99x 1.03x 1.01x 1.01x
    64B 1.00x 1.00x 1.00x 1.00x 1.00x 1.00x 1.00x 1.01x 1.00x 1.02x
    256B 1.05x 1.02x 1.00x 1.02x 1.05x 1.02x 1.04x 1.05x 1.05x 1.02x
    1024B 1.06x 1.02x 1.00x 1.02x 1.07x 1.06x 1.05x 1.04x 1.05x 1.02x
    8192B 1.05x 1.02x 1.00x 1.02x 1.06x 1.06x 1.04x 1.05x 1.05x 1.02x

    serpent-avx-x86_64 vs aes-asm (8kB block):
    128bit 256bit
    ecb-enc 1.26x 1.73x
    ecb-dec 1.20x 1.64x
    cbc-enc 0.33x 0.45x
    cbc-dec 1.24x 1.67x
    ctr-enc 1.32x 1.76x
    ctr-dec 1.32x 1.76x
    lrw-enc 1.20x 1.60x
    lrw-dec 1.15x 1.54x
    xts-enc 1.22x 1.64x
    xts-dec 1.17x 1.57x

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     
  • This patch adds a x86_64/avx assembler implementation of the Twofish block
    cipher. The implementation processes eight blocks in parallel (two 4 block
    chunk AVX operations). The table-lookups are done in general-purpose registers.
    For small blocksizes the 3way-parallel functions from the twofish-x86_64-3way
    module are called. A good performance increase is provided for blocksizes
    greater or equal to 128B.

    Patch has been tested with tcrypt and automated filesystem tests.

    Tcrypt benchmark results:

    Intel Core i5-2500 CPU (fam:6, model:42, step:7)

    twofish-avx-x86_64 vs. twofish-x86_64-3way
    128bit key: (lrw:256bit) (xts:256bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.96x 0.97x 1.00x 0.95x 0.97x 0.97x 0.96x 0.95x 0.95x 0.98x
    64B 0.99x 0.99x 1.00x 0.99x 0.98x 0.98x 0.99x 0.98x 0.99x 0.98x
    256B 1.20x 1.21x 1.00x 1.19x 1.15x 1.14x 1.19x 1.20x 1.18x 1.19x
    1024B 1.29x 1.30x 1.00x 1.28x 1.23x 1.24x 1.26x 1.28x 1.26x 1.27x
    8192B 1.31x 1.32x 1.00x 1.31x 1.25x 1.25x 1.28x 1.29x 1.28x 1.30x

    256bit key: (lrw:384bit) (xts:512bit)
    size ecb-enc ecb-dec cbc-enc cbc-dec ctr-enc ctr-dec lrw-enc lrw-dec xts-enc xts-dec
    16B 0.96x 0.96x 1.00x 0.96x 0.97x 0.98x 0.95x 0.95x 0.95x 0.96x
    64B 1.00x 0.99x 1.00x 0.98x 0.98x 1.01x 0.98x 0.98x 0.98x 0.98x
    256B 1.20x 1.21x 1.00x 1.21x 1.15x 1.15x 1.19x 1.20x 1.18x 1.19x
    1024B 1.29x 1.30x 1.00x 1.28x 1.23x 1.23x 1.26x 1.27x 1.26x 1.27x
    8192B 1.31x 1.33x 1.00x 1.31x 1.26x 1.26x 1.29x 1.29x 1.28x 1.30x

    twofish-avx-x86_64 vs aes-asm (8kB block):
    128bit 256bit
    ecb-enc 1.19x 1.63x
    ecb-dec 1.18x 1.62x
    cbc-enc 0.75x 1.03x
    cbc-dec 1.23x 1.67x
    ctr-enc 1.24x 1.65x
    ctr-dec 1.24x 1.65x
    lrw-enc 1.15x 1.53x
    lrw-dec 1.14x 1.52x
    xts-enc 1.16x 1.56x
    xts-dec 1.16x 1.56x

    Signed-off-by: Johannes Goetzfried
    Signed-off-by: Herbert Xu

    Johannes Goetzfried
     
  • Signed-off-by: Sonic Zhang
    Acked-by: Mike Frysinger
    Signed-off-by: Herbert Xu

    Sonic Zhang