11 Nov, 2011

1 commit


21 Oct, 2011

1 commit


06 Aug, 2010

1 commit

  • If a scatterwalk chain contains an entry with an unaligned offset then
    hash_walk_next() will cut off the next step at the next alignment point.

    However, if the entry ends before the next alignment point then we a loop,
    which leads to a kernel oops.

    Fix this by checking whether the next aligment point is before the end of the
    current entry.

    Signed-off-by: Szilveszter Ördög
    Acked-by: David S. Miller
    Signed-off-by: Herbert Xu

    Szilveszter Ördög
     

03 Mar, 2010

1 commit

  • The correct way to calculate the start of the aligned part of an
    unaligned buffer is:

    offset = ALIGN(offset, alignmask + 1);

    However, crypto_hash_walk_done() has:

    offset += alignmask - 1;
    offset = ALIGN(offset, alignmask + 1);

    which actually skips a whole block unless offset % (alignmask + 1) == 1.

    This patch fixes the problem.

    Signed-off-by: Szilveszter Ördög
    Signed-off-by: Herbert Xu

    Szilveszter Ördög
     

24 Jul, 2009

1 commit


15 Jul, 2009

2 commits


14 Jul, 2009

5 commits


31 May, 2009

1 commit

  • A quirk that we've always supported is having an sg entry that's
    bigger than a page, or more generally an sg entry that crosses
    page boundaries. Even though it would be better to explicitly have
    to sg entries for this, we need to support it for the existing users,
    in particular, IPsec.

    The new ahash sg walking code did try to handle this, but there was
    a bug where we didn't increment the page so kept on walking on the
    first page over an dover again.

    This patch fixes it.

    Tested-by: Martin Willi
    Signed-off-by: Herbert Xu

    Herbert Xu
     

19 Feb, 2009

1 commit


25 Dec, 2008

3 commits

  • Since most cryptographic hash algorithms have no keys, this patch
    makes the setkey function optional for ahash and shash.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch allows shash algorithms to be used through the old hash
    interface. This is a transitional measure so we can convert the
    underlying algorithms to shash before converting the users across.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • It is often useful to save the partial state of a hash function
    so that it can be used as a base for two or more computations.

    The most prominent example is HMAC where all hashes start from
    a base determined by the key. Having an import/export interface
    means that we only have to compute that base once rather than
    for each message.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

10 Jul, 2008

4 commits

  • This patch adds the walking helpers for hash algorithms akin to
    those of block ciphers. This is a necessary step before we can
    reimplement existing hash algorithms using the new ahash interface.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • The base field in ahash_tfm appears to have been cut-n-pasted from
    ablkcipher. It isn't needed here at all. Similarly, the info field
    in ahash_request also appears to have originated from its cipher
    counter-part and is vestigial.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • The digest size check on hash algorithms is incorrect. It's
    perfectly valid for hash algorithms to have a digest length
    longer than their block size. For example crc32c has a block
    size of 1 and a digest size of 4. Rather than having it lie
    about its block size, this patch fixes the checks to do what
    they really should which is to bound the digest size so that
    code placing the digest on the stack continue to work.

    HMAC however still needs to check this as it's only defined
    for such algorithms.

    Signed-off-by: Herbert Xu

    Herbert Xu
     
  • This patch adds asynchronous hash and digest support.

    Signed-off-by: Loc Ho
    Signed-off-by: Herbert Xu

    Loc Ho