11 Feb, 2017

1 commit

  • The generic AES code exposes a 32-bit align mask, which forces all
    users of the code to use temporary buffers or take other measures to
    ensure the alignment requirement is adhered to, even on architectures
    that don't care about alignment for software algorithms such as this
    one.

    So drop the align mask, and fix the code to use get_unaligned_le32()
    where appropriate, which will resolve to whatever is optimal for the
    architecture.

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

    Ard Biesheuvel
     

13 Jan, 2015

1 commit

  • Commit 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"")
    changed the automatic module loading when requesting crypto algorithms
    to prefix all module requests with "crypto-". This requires all crypto
    modules to have a crypto specific module alias even if their file name
    would otherwise match the requested crypto algorithm.

    Even though commit 5d26a105b5a7 added those aliases for a vast amount of
    modules, it was missing a few. Add the required MODULE_ALIAS_CRYPTO
    annotations to those files to make them get loaded automatically, again.
    This fixes, e.g., requesting 'ecb(blowfish-generic)', which used to work
    with kernels v3.18 and below.

    Also change MODULE_ALIAS() lines to MODULE_ALIAS_CRYPTO(). The former
    won't work for crypto modules any more.

    Fixes: 5d26a105b5a7 ("crypto: prefix module autoloading with "crypto-"")
    Cc: Kees Cook
    Signed-off-by: Mathias Krause
    Signed-off-by: Herbert Xu

    Mathias Krause
     

24 Nov, 2014

1 commit


14 Aug, 2013

1 commit


01 Aug, 2012

1 commit

  • Initialization of cra_list is currently mixed, most ciphers initialize this
    field and most shashes do not. Initialization however is not needed at all
    since cra_list is initialized/overwritten in __crypto_register_alg() with
    list_add(). Therefore perform cleanup to remove all unneeded initializations
    of this field in 'crypto/'.

    Signed-off-by: Jussi Kivilinna
    Signed-off-by: Herbert Xu

    Jussi Kivilinna
     

16 Feb, 2010

1 commit


24 Jul, 2009

1 commit

  • It's undefined behaviour in C to write outside the bounds of an array.
    The key expansion routine takes a shortcut of creating 8 words at a
    time, but this creates 4 additional words which don't fit in the array.

    As everyone is hopefully now aware, GCC is at liberty to make any
    assumptions and optimisations it likes in situations where it can
    detect that UB has occured, up to and including nasal demons, and
    as the indices being accessed in the array are trivially calculable,
    it's rash to invite gcc to do take any liberties at all.

    Signed-off-by: Phil Carmody
    Signed-off-by: Herbert Xu

    Phil Carmody
     

25 Dec, 2008

1 commit

  • The tables used by the various AES algorithms are currently
    computed at run-time. This has created an init ordering problem
    because some AES algorithms may be registered before the tables
    have been initialised.

    This patch gets around this whole thing by precomputing the tables.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

21 Apr, 2008

1 commit


11 Jan, 2008

3 commits


11 Oct, 2007

1 commit

  • Loading the crypto algorithm by the alias instead of by module directly
    has the advantage that all possible implementations of this algorithm
    are loaded automatically and the crypto API can choose the best one
    depending on its priority.

    Additionally it ensures that the generic implementation as well as the
    HW driver (if available) is loaded in case the HW driver needs the
    generic version as fallback in corner cases.

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

    Sebastian Siewior