summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/Kconfig5
-rw-r--r--crypto/Makefile2
-rw-r--r--crypto/userspace/Makefile43
-rw-r--r--include/linux/Kbuild2
4 files changed, 12 insertions, 40 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig
index 81c185a6971..022768adc23 100644
--- a/crypto/Kconfig
+++ b/crypto/Kconfig
@@ -31,6 +31,11 @@ config CRYPTO_FIPS
this is. Note that CRYPTO_ANSI_CPRNG is requred if this
option is selected
+config CRYPTO_USERSPACE
+ tristate "User-space crypto API"
+ help
+ This option provides an user-space API for cryptographic operations.
+
config CRYPTO_ALGAPI
tristate
select CRYPTO_ALGAPI2
diff --git a/crypto/Makefile b/crypto/Makefile
index 9e8f61908cb..bf210884e1f 100644
--- a/crypto/Makefile
+++ b/crypto/Makefile
@@ -90,3 +90,5 @@ obj-$(CONFIG_CRYPTO_GHASH) += ghash-generic.o
#
obj-$(CONFIG_XOR_BLOCKS) += xor.o
obj-$(CONFIG_ASYNC_CORE) += async_tx/
+
+obj-$(CONFIG_CRYPTO_USERSPACE) += userspace/ \ No newline at end of file
diff --git a/crypto/userspace/Makefile b/crypto/userspace/Makefile
index f85b473170c..4a13497cc10 100644
--- a/crypto/userspace/Makefile
+++ b/crypto/userspace/Makefile
@@ -1,6 +1,4 @@
-KERNEL_DIR = /lib/modules/$(shell uname -r)/build
-
-EXTRA_CFLAGS += -I$(SUBDIRS)/libtommath -I$(SUBDIRS)/libtomcrypt/headers -I$(SUBDIRS)/ -DLTC_SOURCE -Wall
+ccflags-y += -I$(src)/libtommath -I$(src)/libtomcrypt/headers -DLTC_SOURCE
TOMMATH_OBJECTS = libtommath/bncore.o libtommath/bn_mp_init.o libtommath/bn_mp_clear.o libtommath/bn_mp_exch.o libtommath/bn_mp_grow.o libtommath/bn_mp_shrink.o \
libtommath/bn_mp_clamp.o libtommath/bn_mp_zero.o libtommath/bn_mp_set.o libtommath/bn_mp_set_int.o libtommath/bn_mp_init_size.o libtommath/bn_mp_copy.o \
@@ -65,45 +63,10 @@ TOMCRYPT_OBJECTS = libtomcrypt/misc/zeromem.o libtomcrypt/misc/crypt/crypt_argch
libtomcrypt/misc/pk_get_oid.o libtomcrypt/pk/asn1/der/x509/der_encode_subject_public_key_info.o \
libtomcrypt/pk/asn1/der/x509/der_decode_subject_public_key_info.o
-cryptodev-objs = cryptodev_main.o cryptodev_cipher.o ncr.o \
+cryptodev-objs := cryptodev_main.o cryptodev_cipher.o ncr.o \
ncr-data.o ncr-key.o ncr-limits.o ncr-sessions.o ncr-pk.o \
ncr-key-wrap.o ncr-key-storage.o $(TOMMATH_OBJECTS) \
$(TOMCRYPT_OBJECTS)
-obj-m += cryptodev.o
-
-build:
- make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules
-
-install:
- make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
- @echo "Installing cryptodev.h in /usr/include/crypto ..."
- @install -D cryptodev.h /usr/include/crypto/cryptodev.h
- @install -D ncr.h /usr/include/crypto/ncr.h
-
-clean:
- make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
- rm -f $(hostprogs)
- KERNEL_DIR=$(KERNEL_DIR) make -C examples clean
-
-check:
- KERNEL_DIR=$(KERNEL_DIR) make -C examples check
-
-FILEBASE = cryptodev-linux-$(VERSION)
-TMPDIR ?= /tmp
-OUTPUT = $(FILEBASE).tar.gz
-
-dist: clean
- @echo Packing
- @rm -f *.tar.gz
- @mkdir $(TMPDIR)/$(FILEBASE)
- @cp -ar . $(TMPDIR)/$(FILEBASE)
- @rm -rf $(TMPDIR)/$(FILEBASE)/.git* $(TMPDIR)/$(FILEBASE)/releases $(TMPDIR)/$(FILEBASE)/scripts
- @tar -C /tmp -czf ./$(OUTPUT) $(FILEBASE)
- @rm -rf $(TMPDIR)/$(FILEBASE)
- @echo Signing $(OUTPUT)
- @gpg --output $(OUTPUT).sig -sb $(OUTPUT)
- @gpg --verify $(OUTPUT).sig $(OUTPUT)
- @mv $(OUTPUT) $(OUTPUT).sig releases/
-
+obj-$(CONFIG_CRYPTO_USERSPACE) += cryptodev.o
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 756f831cbdd..f35589a2ab5 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -51,6 +51,7 @@ header-y += comstats.h
header-y += const.h
header-y += cgroupstats.h
header-y += cramfs_fs.h
+header-y += cryptodev.h
header-y += cycx_cfm.h
header-y += dcbnl.h
header-y += dlmconstants.h
@@ -116,6 +117,7 @@ header-y += mmtimer.h
header-y += mqueue.h
header-y += mtio.h
header-y += ncp_no.h
+header-y += ncr.h
header-y += neighbour.h
header-y += net_dropmon.h
header-y += net_tstamp.h