crypto: GnuPG based MPI lib - make files (part 3)
authorDmitry Kasatkin <dmitry.kasatkin@intel.com>
Wed, 31 Aug 2011 11:05:16 +0000 (14:05 +0300)
committerDmitry Kasatkin <dmitry.kasatkin@intel.com>
Wed, 9 Nov 2011 09:47:25 +0000 (11:47 +0200)
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@intel.com>
lib/Kconfig
lib/Makefile
lib/mpi/Makefile [new file with mode: 0644]

index 32f3e5ae2be543c59ae3e50682ca504010eb87a3..4af07ec7f2de66daba106800d1ced9afa2cd4a71 100644 (file)
@@ -276,4 +276,11 @@ config CORDIC
          so its calculations are in fixed point. Modules can select this
          when they require this function. Module will be called cordic.
 
+config MPILIB
+       tristate "Multiprecision maths library"
+       help
+         Multiprecision maths library from GnuPG.
+         It is used to implement RSA digital signature verification,
+         which is used by IMA/EVM digital signature extension.
+
 endmenu
index a4da283f5dc0182a45d370fd76884a86fa37ac42..6ba8cbf4c72f35b77a8875b545d5c12b696b1af2 100644 (file)
@@ -115,6 +115,8 @@ obj-$(CONFIG_CPU_RMAP) += cpu_rmap.o
 
 obj-$(CONFIG_CORDIC) += cordic.o
 
+obj-$(CONFIG_MPILIB) += mpi/
+
 hostprogs-y    := gen_crc32table
 clean-files    := crc32table.h
 
diff --git a/lib/mpi/Makefile b/lib/mpi/Makefile
new file mode 100644 (file)
index 0000000..45ca90a
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# MPI multiprecision maths library (from gpg)
+#
+
+obj-$(CONFIG_MPILIB) = mpi.o
+
+mpi-y = \
+       generic_mpih-lshift.o           \
+       generic_mpih-mul1.o             \
+       generic_mpih-mul2.o             \
+       generic_mpih-mul3.o             \
+       generic_mpih-rshift.o           \
+       generic_mpih-sub1.o             \
+       generic_mpih-add1.o             \
+       mpicoder.o                      \
+       mpi-bit.o                       \
+       mpih-cmp.o                      \
+       mpih-div.o                      \
+       mpih-mul.o                      \
+       mpi-pow.o                       \
+       mpiutil.o