22 Aug, 2017

1 commit

  • Commit 9ae433bc79f9 ("crypto: chacha20 - convert generic and x86 versions
    to skcipher") ported the existing chacha20 code to use the new skcipher
    API, and introduced a bug along the way. Unfortunately, the tcrypt tests
    did not catch the error, and it was only found recently by Tobias.

    Stefan kindly diagnosed the error, and proposed a fix which is similar
    to the one below, with the exception that 'walk.stride' is used rather
    than the hardcoded block size. This does not actually matter in this
    case, but it's a better example of how to use the skcipher walk API.

    Fixes: 9ae433bc79f9 ("crypto: chacha20 - convert generic and x86 ...")
    Cc: # v4.11+
    Cc: Steffen Klassert
    Reported-by: Tobias Brunner
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

27 Dec, 2016

1 commit

  • This converts the ChaCha20 code from a blkcipher to a skcipher, which
    is now the preferred way to implement symmetric block and stream ciphers.

    This ports the generic and x86 versions at the same time because the
    latter reuses routines of the former.

    Note that the skcipher_walk() API guarantees that all presented blocks
    except the final one are a multiple of the chunk size, so we can simplify
    the encrypt() routine somewhat.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Herbert Xu

    Ard Biesheuvel
     

03 Jul, 2016

1 commit


17 Jul, 2015

1 commit


04 Jun, 2015

1 commit

  • ChaCha20 is a high speed 256-bit key size stream cipher algorithm designed by
    Daniel J. Bernstein. It is further specified in RFC7539 for use in IETF
    protocols as a building block for the ChaCha20-Poly1305 AEAD.

    This is a portable C implementation without any architecture specific
    optimizations. It uses a 16-byte IV, which includes the 12-byte ChaCha20 nonce
    prepended by the initial block counter. Some algorithms require an explicit
    counter value, for example the mentioned AEAD construction.

    Signed-off-by: Martin Willi
    Acked-by: Steffen Klassert
    Signed-off-by: Herbert Xu

    Martin Willi