Skip to contentSkip to conversation

cipher infrastructure

PATCH New Tomasz Bursztyka 1 participant 3 messages Feb 3, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

cover cipher infrastructure

Hi,

I applied the comments on the RFC. Now ARV4 works.
I introduced as well the iv/iv_length parameters to l_cipher_new(), however it's not implemented yet. There will be time to support it as well as other ciphers (twofish, blowfish... )

Tomasz Bursztyka (2):
cipher: Add a basic infrastructure for kernel based cipher operations
unit: Add unit test for the cipher infrastructure

 Makefile.am        |  11 ++-
 ell/cipher.c       | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 ell/cipher.h       |  53 ++++++++++++
 ell/ell.h          |   1 +
 unit/test-cipher.c | 109 ++++++++++++++++++++++++
 5 files changed, 409 insertions(+), 3 deletions(-)
 create mode 100644 ell/cipher.c
 create mode 100644 ell/cipher.h
 create mode 100644 unit/test-cipher.c
Signature · 1 line
2.0.5
#1 lore raw

PATCH 1/2 cipher: Add a basic infrastructure for kernel based cipher operations

This will let the possibility to use the crypto API provided by the kernel in a simple manner. However, it's worth noticing such API might not be relevant if a lot of big frames need to processed, where it will be better to get non blocking sockets as well as lowering the memory copies via vmsplice/splice.

---
 Makefile.am  |   6 +-
 ell/cipher.c | 238 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ell/cipher.h |  53 +++++++++++++
 ell/ell.h    |   1 +
 4 files changed, 296 insertions(+), 2 deletions(-)
 create mode 100644 ell/cipher.c
 create mode 100644 ell/cipher.h
Makefile.am +4 -2
index 50f81eb..910d5e0 100644
@@ -33,7 +33,8 @@ pkginclude_HEADERS = ell/ell.h \
 			ell/genl.h \
 			ell/dbus.h \
 			ell/dbus-service.h \
-			ell/hwdb.h
+			ell/hwdb.h \
+			ell/cipher.h
 
 lib_LTLIBRARIES = ell/libell.la
 
@@ -67,7 +68,8 @@ ell_libell_la_SOURCES = $(linux_headers) \
 			ell/gvariant-util.c \
 			ell/siphash-private.h \
 			ell/siphash.c \
-			ell/hwdb.c
+			ell/hwdb.c \
+			ell/cipher.c
 
 ell_libell_la_LDFLAGS = -no-undefined \
 			-version-info $(ELL_CURRENT):$(ELL_REVISION):$(ELL_AGE)
ell/cipher.c new file +238 -0

238 lines not on this page · raw message

ell/cipher.h new file +53 -0

53 lines not on this page · raw message

ell/ell.h +1 -0
index c4dc1f2..4d9afa3 100644
@@ -35,6 +35,7 @@
 #include <ell/checksum.h>
 #include <ell/settings.h>
 #include <ell/hwdb.h>
+#include <ell/cipher.h>
 
 #include <ell/netlink.h>
 #include <ell/genl.h>
Signature · 1 line
2.0.5
#2 lore raw

PATCH 2/2 unit: Add unit test for the cipher infrastructure

In reply to Tomasz Bursztyka

It quickly encrypt, verify that the buffer has different content, and again decrypt and verify now it has the same content.

---
 Makefile.am        |   5 ++-
 unit/test-cipher.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+), 1 deletion(-)
 create mode 100644 unit/test-cipher.c
Makefile.am +4 -1
index 910d5e0..e32054f 100644
@@ -107,7 +107,8 @@ unit_tests = unit/test-unit \
 			unit/test-gvariant-util \
 			unit/test-gvariant-message \
 			unit/test-siphash \
-			unit/test-hwdb
+			unit/test-hwdb \
+			unit/test-cipher
 
 if MAINTAINER_MODE
 noinst_PROGRAMS += $(unit_tests)
@@ -157,6 +158,8 @@ unit_test_siphash_LDADD = ell/libell-private.la
 
 unit_test_hwdb_LDADD = ell/libell-private.la
 
+unit_test_cipher_LDADD = ell/libell-private.la
+
 if MAINTAINER_MODE
 noinst_LTLIBRARIES += unit/example-plugin.la
 endif
unit/test-cipher.c new file +109 -0

109 lines not on this page · raw message

Signature · 1 line
2.0.5