21 Apr, 2008

14 commits

  • Ciphers, block modes, name it, are grouped together and sorted.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • On Thu, Mar 27, 2008 at 03:40:36PM +0100, Bodo Eggert wrote:
    > Kamalesh Babulal wrote:
    >
    > > This patch cleanups the crypto code, replaces the init() and fini()
    > > with the _init/_fini
    >
    > This part ist OK.
    >
    > > or init/fini_ (if the
    > > _init/_fini exist)
    >
    > Having init_foo and foo_init won't be a good thing, will it? I'd start
    > confusing them.
    >
    > What about foo_modinit instead?

    Thanks for the suggestion, the init() is replaced with

    _mod_init ()

    and fini () is replaced with _mod_fini.

    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Herbert Xu

    Kamalesh Babulal
     
  • The key expansion routine could be get little more generic, become
    a kernel doc entry and then get exported.

    Signed-off-by: Sebastian Siewior
    Tested-by: Stefan Hellermann
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Implement CTS wrapper for CBC mode required for support of AES
    encryption support for Kerberos (rfc3962).

    Signed-off-by: Kevin Coffman
    Signed-off-by: Herbert Xu

    Kevin Coffman
     
  • replace all:
    big_endian_variable = cpu_to_beX(beX_to_cpu(big_endian_variable) +
    expression_in_cpu_byteorder);
    with:
    beX_add_cpu(&big_endian_variable, expression_in_cpu_byteorder);

    Signed-off-by: Marcin Slusarz
    Cc: David S. Miller
    Cc: Roel Kluin
    Signed-off-by: Herbert Xu

    Marcin Slusarz
     
  • The third test vector of ECB-XTEA-ENC fails for me all other
    are fine. I could not find a RFC or something else where they
    are defined. The test vector has not been modified since git
    started recording histrory. The implementation is very close
    (not to say equal) to what is available as Public Domain (they
    recommend 64 rounds and the in kernel uses 32). Therefore I
    belive that there is typo somewhere and tcrypt reported always
    *fail* instead of *okey*.
    This patch replaces input + result of the third test vector with
    result + input from the third decryption vector. The key is the
    same, the other three test vectors are also the reverse.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Currently the tcrypt module is about 2 MiB on x86-32. The
    main reason for the huge size is the data segment which contains
    all the test vectors for each algorithm. The test vectors are
    staticly allocated in an array and the size of the array has been
    drastically increased by the merge of the Salsa20 test vectors.

    With a hint from Benedigt Spranger I found a way how I could
    convert those fixed-length arrays to strings which are flexible
    in size. VIM and regex were also very helpfull :)
    So, I am talking about a shrinking of ~97% on x86-32:

    text data bss dec hex filename
    18309 2039708 20 2058037 1f6735 tcrypt-b4.ko
    45628 23516 80 69224 10e68 tcrypt.ko

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • The test routines (test_{cipher,hash,aead}) are makeing a copy
    of the test template and are processing the encryption process
    in place. This patch changes the creation of the copy so it will
    work even if the source address of the input data isn't an array
    inside of the template but a pointer.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Signed-off-by: Jan Engelhardt
    Signed-off-by: Herbert Xu

    Jan Engelhardt
     
  • The speed templates as it look always the same. The key size
    is repeated for each block size and we test always the same
    block size. The addition of one inner loop makes it possible
    to get rid of the struct and it is possible to use a tiny
    u8 array :)

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Some crypto ciphers which are impleneted support similar key sizes
    (16,24 & 32 byte). They can be grouped together and use a common
    templatte instead of their own which contains the same data.

    Signed-off-by: Sebastian Siewior
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     
  • Rename sha512 to sha512_generic and add a MODULE_ALIAS for sha512
    so all sha512 implementations can be loaded automatically.

    Keep the broken tabs so git recognizes this as a rename.

    Signed-off-by: Jan Glauber
    Signed-off-by: Herbert Xu

    Jan Glauber
     
  • Signed-off-by: Alexey Dobriyan
    Signed-off-by: Herbert Xu

    Alexey Dobriyan
     

18 Apr, 2008

2 commits

  • 'ack' is currently a simple integer that flags whether or not a client is done
    touching fields in the given descriptor. It is effectively just a single bit
    of information. Converting this to a flags parameter allows the other bits to
    be put to use to control completion actions, like dma-unmap, and capture
    results, like xor-zero-sum == 0.

    Changes are one of:
    1/ convert all open-coded ->ack manipulations to use async_tx_ack
    and async_tx_test_ack.
    2/ set the ack bit at prep time where possible
    3/ make drivers store the flags at prep time
    4/ add flags to the device_prep_dma_interrupt prototype

    Acked-by: Maciej Sosnowski
    Signed-off-by: Dan Williams

    Dan Williams
     
  • Shrink struct dma_async_tx_descriptor and introduce
    async_tx_channel_switch to properly inject a channel switch interrupt in
    the descriptor stream. This simplifies the locking model as drivers no
    longer need to handle dma_async_tx_descriptor.lock.

    Acked-by: Shannon Nelson
    Signed-off-by: Dan Williams

    Dan Williams
     

02 Apr, 2008

1 commit

  • The kernel crashes when ipsec passes a udp packet of about 14XX bytes
    of data to aes-xcbc-mac.

    It seems the first xxxx bytes of the data are in first sg entry,
    and remaining xx bytes are in next sg entry. But we don't
    check next sg entry to see if we need to go look the page up.

    I noticed in hmac.c, we do a scatterwalk_sg_next(), to do this check
    and possible lookup, thus xcbc.c needs to use this routine too.

    A 15-hour run of an ipsec stress test sending streams of tcp and
    udp packets of various sizes, using this patch and
    aes-xcbc-mac completed successfully, so hopefully this fixes the
    problem.

    Signed-off-by: Joy Latten
    Signed-off-by: Herbert Xu

    Joy Latten
     

19 Mar, 2008

1 commit


14 Mar, 2008

1 commit


08 Mar, 2008

1 commit


06 Mar, 2008

2 commits

  • When using aes-xcbc-mac for authentication in IPsec,
    the kernel crashes. It seems this algorithm doesn't
    account for the space IPsec may make in scatterlist for authtag.
    Thus when crypto_xcbc_digest_update2() gets called,
    nbytes may be less than sg[i].length.
    Since nbytes is an unsigned number, it wraps
    at the end of the loop allowing us to go back
    into loop and causing crash in memcpy.

    I used update function in digest.c to model this fix.
    Please let me know if it looks ok.

    Signed-off-by: Joy Latten
    Signed-off-by: Herbert Xu

    Joy Latten
     
  • The XTS blockmode uses a copy of the IV which is saved on the stack
    and may or may not be properly aligned. If it is not, it will break
    hardware cipher like the geode or padlock.
    This patch encrypts the IV in place so we don't have to worry about
    alignment.

    Signed-off-by: Sebastian Siewior
    Tested-by: Stefan Hellermann
    Signed-off-by: Herbert Xu

    Sebastian Siewior
     

05 Mar, 2008

1 commit


23 Feb, 2008

2 commits


18 Feb, 2008

1 commit

  • This patch fixes the following build error caused by commit
    3631c650c495d61b1dabf32eb26b46873636e918:

    ...
    LD .tmp_vmlinux1
    crypto/built-in.o: In function `skcipher_null_crypt':
    crypto_null.c:(.text+0x3d14): undefined reference to `blkcipher_walk_virt'
    crypto_null.c:(.text+0x3d14): relocation truncated to fit: R_MIPS_26 against `blkcipher_walk_virt'
    crypto/built-in.o: In function `$L32':
    crypto_null.c:(.text+0x3d54): undefined reference to `blkcipher_walk_done'
    crypto_null.c:(.text+0x3d54): relocation truncated to fit: R_MIPS_26 against `blkcipher_walk_done'
    crypto/built-in.o:(.data+0x2e8): undefined reference to `crypto_blkcipher_type'
    make[1]: *** [.tmp_vmlinux1] Error 1

    Signed-off-by: Adrian Bunk
    Signed-off-by: Herbert Xu

    Adrian Bunk
     

15 Feb, 2008

1 commit


08 Feb, 2008

1 commit


07 Feb, 2008

6 commits

  • The source and destination addresses are included to allow channel
    selection based on address alignment.

    Signed-off-by: Dan Williams
    Reviewed-by: Haavard Skinnemoen

    Dan Williams
     
  • Pass a full set of flags to drivers' per-operation 'prep' routines.
    Currently the only flag passed is DMA_PREP_INTERRUPT. The expectation is
    that arch-specific async_tx_find_channel() implementations can exploit this
    capability to find the best channel for an operation.

    Signed-off-by: Dan Williams
    Acked-by: Shannon Nelson
    Reviewed-by: Haavard Skinnemoen

    Dan Williams
     
  • The tx_set_src and tx_set_dest methods were originally implemented to allow
    an array of addresses to be passed down from async_xor to the dmaengine
    driver while minimizing stack overhead. Removing these methods allows
    drivers to have all transaction parameters available at 'prep' time, saves
    two function pointers in struct dma_async_tx_descriptor, and reduces the
    number of indirect branches..

    A consequence of moving this data to the 'prep' routine is that
    multi-source routines like async_xor need temporary storage to convert an
    array of linear addresses into an array of dma addresses. In order to keep
    the same stack footprint of the previous implementation the input array is
    reused as storage for the dma addresses. This requires that
    sizeof(dma_addr_t) be less than or equal to sizeof(void *). As a
    consequence CONFIG_DMADEVICES now depends on !CONFIG_HIGHMEM64G. It also
    requires that drivers be able to make descriptor resources available when
    the 'prep' routine is polled.

    Signed-off-by: Dan Williams
    Acked-by: Shannon Nelson

    Dan Williams
     
  • Remove the unused ASYNC_TX_ASSUME_COHERENT flag. Async_tx is
    meant to hide the difference between asynchronous hardware and synchronous
    software operations, this flag requires clients to understand cache
    coherency consequences of the async path.

    Signed-off-by: Dan Williams
    Reviewed-by: Haavard Skinnemoen

    Dan Williams
     
  • single list_head variable initialized with LIST_HEAD_INIT could almost
    always can be replaced with LIST_HEAD declaration, this shrinks the code
    and looks better.

    Signed-off-by: Denis Cheng
    Signed-off-by: Dan Williams

    Denis Cheng
     
  • do_async_xor must be compiled away on !HAS_DMA archs.

    Signed-off-by: Dan Williams
    Acked-by: Cornelia Huck

    Dan Williams
     

26 Jan, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (125 commits)
    [CRYPTO] twofish: Merge common glue code
    [CRYPTO] hifn_795x: Fixup container_of() usage
    [CRYPTO] cast6: inline bloat--
    [CRYPTO] api: Set default CRYPTO_MINALIGN to unsigned long long
    [CRYPTO] tcrypt: Make xcbc available as a standalone test
    [CRYPTO] xcbc: Remove bogus hash/cipher test
    [CRYPTO] xcbc: Fix algorithm leak when block size check fails
    [CRYPTO] tcrypt: Zero axbuf in the right function
    [CRYPTO] padlock: Only reset the key once for each CBC and ECB operation
    [CRYPTO] api: Include sched.h for cond_resched in scatterwalk.h
    [CRYPTO] salsa20-asm: Remove unnecessary dependency on CRYPTO_SALSA20
    [CRYPTO] tcrypt: Add select of AEAD
    [CRYPTO] salsa20: Add x86-64 assembly version
    [CRYPTO] salsa20_i586: Salsa20 stream cipher algorithm (i586 version)
    [CRYPTO] gcm: Introduce rfc4106
    [CRYPTO] api: Show async type
    [CRYPTO] chainiv: Avoid lock spinning where possible
    [CRYPTO] seqiv: Add select AEAD in Kconfig
    [CRYPTO] scatterwalk: Handle zero nbytes in scatterwalk_map_and_copy
    [CRYPTO] null: Allow setkey on digest_null
    ...

    Linus Torvalds
     

11 Jan, 2008

5 commits