23 Jun, 2015

1 commit

  • Pull crypto update from Herbert Xu:
    "Here is the crypto update for 4.2:

    API:

    - Convert RNG interface to new style.

    - New AEAD interface with one SG list for AD and plain/cipher text.
    All external AEAD users have been converted.

    - New asymmetric key interface (akcipher).

    Algorithms:

    - Chacha20, Poly1305 and RFC7539 support.

    - New RSA implementation.

    - Jitter RNG.

    - DRBG is now seeded with both /dev/random and Jitter RNG. If kernel
    pool isn't ready then DRBG will be reseeded when it is.

    - DRBG is now the default crypto API RNG, replacing krng.

    - 842 compression (previously part of powerpc nx driver).

    Drivers:

    - Accelerated SHA-512 for arm64.

    - New Marvell CESA driver that supports DMA and more algorithms.

    - Updated powerpc nx 842 support.

    - Added support for SEC1 hardware to talitos"

    * git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (292 commits)
    crypto: marvell/cesa - remove COMPILE_TEST dependency
    crypto: algif_aead - Temporarily disable all AEAD algorithms
    crypto: af_alg - Forbid the use internal algorithms
    crypto: echainiv - Only hold RNG during initialisation
    crypto: seqiv - Add compatibility support without RNG
    crypto: eseqiv - Offer normal cipher functionality without RNG
    crypto: chainiv - Offer normal cipher functionality without RNG
    crypto: user - Add CRYPTO_MSG_DELRNG
    crypto: user - Move cryptouser.h to uapi
    crypto: rng - Do not free default RNG when it becomes unused
    crypto: skcipher - Allow givencrypt to be NULL
    crypto: sahara - propagate the error on clk_disable_unprepare() failure
    crypto: rsa - fix invalid select for AKCIPHER
    crypto: picoxcell - Update to the current clk API
    crypto: nx - Check for bogus firmware properties
    crypto: marvell/cesa - add DT bindings documentation
    crypto: marvell/cesa - add support for Kirkwood and Dove SoCs
    crypto: marvell/cesa - add support for Orion SoCs
    crypto: marvell/cesa - add allhwsupport module parameter
    crypto: marvell/cesa - add support for all armada SoCs
    ...

    Linus Torvalds
     

16 Jun, 2015

1 commit


13 Jun, 2015

1 commit

  • This patch fixes mips compilation error:

    lib/mpi/generic_mpih-mul1.c: In function 'mpihelp_mul_1':
    lib/mpi/longlong.h:651:2: error: impossible constraint in 'asm'

    Signed-off-by: Jaedon Shin
    Cc: Linux-MIPS
    Patchwork: https://patchwork.linux-mips.org/patch/10546/
    Signed-off-by: Ralf Baechle

    Jaedon Shin
     

15 Jan, 2015

1 commit

  • If u and v both represent negative integers and their limb counts
    happen to differ, mpi_cmp will always return a positive value - this
    is obviously bogus. u is smaller than v if and only if it is larger in
    absolute value.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: David Howells
    Acked-by: Dmitry Kasatkin

    Rasmus Villemoes
     

14 Jan, 2015

2 commits

  • The macro MPN_COPY_INCR this occurs in isn't used anywhere.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: David Howells

    Rasmus Villemoes
     
  • The condition preceding 'return 1;' makes my head hurt. At this point,
    we know that u and v have the same sign; if they are negative, they
    compare opposite to how their absolute values compare (which
    mpihelp_cmp found for us), otherwise cmp itself is the
    answer. Negating cmp is ok since mpihelp_cmp returns {-1,0,1};
    -INT_MIN==INT_MIN won't bite us.

    Signed-off-by: Rasmus Villemoes
    Signed-off-by: David Howells
    Acked-by: Dmitry Kasatkin

    Rasmus Villemoes
     

26 Sep, 2013

1 commit


20 Jul, 2013

1 commit


13 Jun, 2013

1 commit

  • For 'while' looping, need stop when 'nbytes == 0', or will cause issue.
    ('nbytes' is size_t which is always bigger or equal than zero).

    The related warning: (with EXTRA_CFLAGS=-W)

    lib/mpi/mpicoder.c:40:2: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]

    Signed-off-by: Chen Gang
    Cc: Rusty Russell
    Cc: David Howells
    Cc: James Morris
    Cc: Andy Shevchenko
    Acked-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chen Gang
     

25 May, 2013

1 commit

  • The umul_ppmm() macro for parisc uses the xmpyu assembler statement
    which does calculation via a floating point register.

    But usage of floating point registers inside the Linux kernel are not
    allowed and gcc will stop compilation due to the -mdisable-fpregs
    compiler option.

    Fix this by disabling the umul_ppmm() and udiv_qrnnd() macros. The
    mpilib will then use the generic built-in implementations instead.

    Signed-off-by: Helge Deller

    Helge Deller
     

01 Feb, 2013

1 commit


24 Nov, 2012

1 commit

  • Since 4.4 GCC on MIPS no longer recognizes the "h" constraint,
    leading to this build failure:

    CC lib/mpi/generic_mpih-mul1.o
    lib/mpi/generic_mpih-mul1.c: In function 'mpihelp_mul_1':
    lib/mpi/generic_mpih-mul1.c:50:3: error: impossible constraint in 'asm'

    This patch updates MPI with the latest umul_ppm implementations for MIPS.

    Signed-off-by: Manuel Lauss
    Cc: Linux-MIPS
    Cc: Dmitry Kasatkin
    Cc: James Morris
    Patchwork: https://patchwork.linux-mips.org/patch/4612/
    Signed-off-by: Ralf Baechle

    Manuel Lauss
     

08 Oct, 2012

3 commits

  • Provide a function to read raw data of a predetermined size into an MPI rather
    than expecting the size to be encoded within the data. The data is assumed to
    represent an unsigned integer, and the resulting MPI will be positive.

    The function looks like this:

    MPI mpi_read_raw_data(const void *, size_t);

    This is useful for reading ASN.1 integer primitives where the length is encoded
    in the ASN.1 metadata.

    Signed-off-by: David Howells
    Signed-off-by: Rusty Russell

    David Howells
     
  • Reinstate and export mpi_cmp() and mpi_cmp_ui() from the MPI library for use by
    RSA signature verification as per RFC3447 section 5.2.2 step 1.

    Signed-off-by: David Howells
    Signed-off-by: Rusty Russell

    David Howells
     
  • Provide count_leading/trailing_zeros() macros based on extant arch bit scanning
    functions rather than reimplementing from scratch in MPILIB.

    Whilst we're at it, turn count_foo_zeros(n, x) into n = count_foo_zeros(x).

    Also move the definition to asm-generic as other people may be interested in
    using it.

    Signed-off-by: David Howells
    Cc: David S. Miller
    Cc: Dmitry Kasatkin
    Cc: Arnd Bergmann
    Signed-off-by: Rusty Russell

    David Howells
     

26 May, 2012

2 commits


18 Apr, 2012

1 commit

  • At the start of the function we assign 'a->d' to 'ap'. Then we use the
    RESIZE_IF_NEEDED macro on 'a' - this may free 'a->d' and replace it
    with newly allocaetd storage. In that case, we'll be operating on
    freed memory further down in the function when we index into 'ap[]'.
    Since we don't actually need 'ap' until after the use of the
    RESIZE_IF_NEEDED macro we can just delay the assignment to it until
    after we've potentially resized, thus avoiding the issue.

    While I was there anyway I also changed the integer variable 'n' to be
    const. It might as well be since we only assign to it once and use it
    as a constant, and then the compiler will tell us if we ever assign to
    it in the future.

    Signed-off-by: Jesper Juhl
    Acked-by: Dmitry Kasatkin
    Signed-off-by: James Morris

    Jesper Juhl
     

02 Feb, 2012

2 commits


01 Feb, 2012

8 commits


19 Jan, 2012

1 commit


07 Dec, 2011

1 commit


09 Nov, 2011

4 commits

  • Adds the multi-precision-integer maths library which was originally taken
    from GnuPG and ported to the kernel by (among others) David Howells.
    This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
    The difference is that checkpatch reported errors and warnings have been fixed.

    This library is used to implemenet RSA digital signature verification
    used in IMA/EVM integrity protection subsystem.

    Due to patch size limitation, the patch is divided into 4 parts.

    This code is unnecessary for RSA digital signature verification,
    but for completeness it is included here and can be compiled,
    if CONFIG_MPILIB_EXTRA is enabled.

    Signed-off-by: Dmitry Kasatkin

    Dmitry Kasatkin
     
  • Adds the multi-precision-integer maths library which was originally taken
    from GnuPG and ported to the kernel by (among others) David Howells.
    This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
    The difference is that checkpatch reported errors and warnings have been fixed.

    This library is used to implemenet RSA digital signature verification
    used in IMA/EVM integrity protection subsystem.

    Due to patch size limitation, the patch is divided into 4 parts.

    Signed-off-by: Dmitry Kasatkin

    Dmitry Kasatkin
     
  • Adds the multi-precision-integer maths library which was originally taken
    from GnuPG and ported to the kernel by (among others) David Howells.
    This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
    The difference is that checkpatch reported errors and warnings have been fixed.

    This library is used to implemenet RSA digital signature verification
    used in IMA/EVM integrity protection subsystem.

    Due to patch size limitation, the patch is divided into 4 parts.

    Signed-off-by: Dmitry Kasatkin

    Dmitry Kasatkin
     
  • Adds the multi-precision-integer maths library which was originally taken
    from GnuPG and ported to the kernel by (among others) David Howells.
    This version is taken from Fedora kernel 2.6.32-71.14.1.el6.
    The difference is that checkpatch reported errors and warnings have been fixed.

    This library is used to implemenet RSA digital signature verification
    used in IMA/EVM integrity protection subsystem.

    Due to patch size limitation, the patch is divided into 4 parts.

    Signed-off-by: Dmitry Kasatkin

    Dmitry Kasatkin