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