26 Jun, 2006

1 commit

  • Up until now algorithms have been happy to get a context pointer since
    they know everything that's in the tfm already (e.g., alignment, block
    size).

    However, once we have parameterised algorithms, such information will
    be specific to each tfm. So the algorithm API needs to be changed to
    pass the tfm structure instead of the context pointer.

    This patch is basically a text substitution. The only tricky bit is
    the assembly routines that need to get the context pointer offset
    through asm-offsets.h.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

10 Jan, 2006

1 commit


07 Sep, 2005

1 commit


02 Sep, 2005

1 commit

  • The crypto layer currently uses in_atomic() to determine whether it is
    allowed to sleep. This is incorrect since spin locks don't always cause
    in_atomic() to return true.

    Instead of that, this patch returns to an earlier idea of a per-tfm flag
    which determines whether sleeping is allowed. Unlike the earlier version,
    the default is to not allow sleeping. This ensures that no existing code
    can break.

    As usual, this flag may either be set through crypto_alloc_tfm(), or
    just before a specific crypto operation.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

15 Jul, 2005

1 commit


07 Jul, 2005

6 commits

  • Even though cit_iv is now always aligned, the user can still supply an
    unaligned iv through crypto_cipher_encrypt_iv/crypto_cipher_decrypt_iv.
    This patch will check the alignment of the user-supplied iv and copy
    it if necessary.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch ensures that cit_iv is aligned according to cra_alignmask
    by allocating it as part of the tfm structure. As a side effect the
    crypto layer will also guarantee that the tfm ctx area has enough space
    to be aligned by cra_alignmask. This allows us to remove the extra
    space reservation from the Padlock driver.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The VIA Padlock device requires the input and output buffers to
    be aligned on 16-byte boundaries. This patch adds the alignmask
    attribute for low-level cipher implementations to indicate their
    alignment requirements.

    The mid-level crypt() function will copy the input/output buffers
    if they are not aligned correctly before they are passed to the
    low-level implementation.

    Strictly speaking, some of the software implementations require
    the buffers to be aligned on 4-byte boundaries as they do 32-bit
    loads. However, it is not clear whether it is better to copy
    the buffers or pay the penalty for unaligned loads/stores.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch adds hooks for cipher algorithms to implement multi-block
    ECB/CBC operations directly. This is expected to provide significant
    performance boots to the VIA Padlock.

    It could also be used for improving software implementations such as
    AES where operating on multiple blocks at a time may enable certain
    optimisations.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The VIA Padlock device is able to perform much better when multiple
    blocks are fed to it at once. As this device offers an exceptional
    throughput rate it is worthwhile to optimise the infrastructure
    specifically for it.

    We shift the existing page-sized fast path down to the CBC/ECB functions.
    We can then replace the CBC/ECB functions with functions provided by the
    underlying algorithm that performs the multi-block operations.

    As a side-effect this improves the performance of large cipher operations
    for all existing algorithm implementations. I've measured the gain to be
    around 5% for 3DES and 15% for AES.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Checking a pointer for NULL before calling kfree() on it is redundant.
    This patch removes such checks from crypto/

    Signed-off-by: Jesper Juhl
    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Jesper Juhl
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds