25 Sep, 2020

2 commits

  • The implementation of EC is introduced from libgcrypt as the
    basic algorithm of elliptic curve, which can be more perfectly
    integrated with MPI implementation.
    Some other algorithms will be developed based on mpi ecc, such as SM2.

    Signed-off-by: Tianjia Zhang
    Tested-by: Xufeng Zhang
    Signed-off-by: Herbert Xu

    Tianjia Zhang
     
  • Expand the mpi library based on libgcrypt, and the ECC algorithm of
    mpi based on libgcrypt requires these functions.
    Some other algorithms will be developed based on mpi ecc, such as SM2.

    Signed-off-by: Tianjia Zhang
    Tested-by: Xufeng Zhang
    Signed-off-by: Herbert Xu

    Tianjia Zhang
     

31 Jul, 2020

1 commit

  • Add mpi_sub_ui() based on Gnu MP mpz_sub_ui() function from file
    mpz/aors_ui.h[1] from change id 510b83519d1c adapting the code to the
    kernel's data structures, helper functions and coding style and also
    removing the defines used to produce mpz_sub_ui() and mpz_add_ui()
    from the same code.

    [1] https://gmplib.org/repo/gmp-6.2/file/510b83519d1c/mpz/aors.h

    Signed-off-by: Marcelo Henrique Cerri
    Signed-off-by: Stephan Mueller
    Signed-off-by: Herbert Xu

    Marcelo Henrique Cerri
     

24 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    gnupg is free software you can redistribute it and or modify it
    under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version gnupg is distributed in the hope that
    it will be useful but without any warranty without even the implied
    warranty of merchantability or fitness for a particular purpose see
    the gnu general public license for more details you should have
    received a copy of the gnu general public license along with this
    program if not write to the free software foundation inc 59 temple
    place suite 330 boston ma 02111 1307 usa note this code is heavily
    based on the gnu mp library actually it s the same code with only
    minor changes in the way the data is stored this is to support the
    abstraction of an optional secure memory allocation which may be
    used to avoid revealing of sensitive data due to paging etc the gnu
    mp library itself is published under the lgpl however i decided to
    publish this code under the plain gpl

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 14 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Reviewed-by: Kate Stewart
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190520170856.639982569@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

08 Jun, 2018

1 commit

  • MPI headers contain definitions for huge number of non-existing
    functions.

    Most part of these functions was removed in 2012 by Dmitry Kasatkin
    - 7cf4206a99d1 ("Remove unused code from MPI library")
    - 9e235dcaf4f6 ("Revert "crypto: GnuPG based MPI lib - additional ...")
    - bc95eeadf5c6 ("lib/mpi: removed unused functions")
    however headers wwere not updated properly.

    Also I deleted some unused macros.

    Link: http://lkml.kernel.org/r/fb2fc1ef-1185-f0a3-d8d0-173d2f97bbaf@virtuozzo.com
    Signed-off-by: Vasily Averin
    Reviewed-by: Andrew Morton
    Cc: Dmitry Kasatkin
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Vasily Averin
     

01 Jul, 2016

1 commit

  • Every implementation of RSA that we have naturally generates
    output with leading zeroes. The one and only user of RSA,
    pkcs1pad wants to have those leading zeroes in place, in fact
    because they are currently absent it has to write those zeroes
    itself.

    So we shouldn't be stripping leading zeroes in the first place.
    In fact this patch makes rsa-generic produce output with fixed
    length so that pkcs1pad does not need to do any extra work.

    This patch also changes DH to use the new interface.

    Signed-off-by: Herbert Xu

    Herbert Xu
     

31 May, 2016

1 commit


20 Oct, 2015

1 commit


14 Oct, 2015

1 commit


16 Jun, 2015

1 commit


08 Oct, 2012

1 commit

  • 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
     

01 Feb, 2012

1 commit


09 Nov, 2011

1 commit

  • 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