summaryrefslogtreecommitdiffstats
path: root/cryptodev.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2009-11-28 19:35:35 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2009-11-28 19:35:35 +0200
commit30181c1a49a63fddc97dd10dbac1b49568aede1f (patch)
treeeaa074d13276370bce20198ccad68c0df25d18b9 /cryptodev.h
parent3c0c804b7ffd37e03e83d486080f65ce2952a2fc (diff)
downloadcryptodev-linux-30181c1a49a63fddc97dd10dbac1b49568aede1f.tar.gz
cryptodev-linux-30181c1a49a63fddc97dd10dbac1b49568aede1f.tar.xz
cryptodev-linux-30181c1a49a63fddc97dd10dbac1b49568aede1f.zip
Added CIOCCRYPTV that will encrypt/hash iovectors.
Diffstat (limited to 'cryptodev.h')
-rw-r--r--cryptodev.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/cryptodev.h b/cryptodev.h
index 895ad1c..891ad2a 100644
--- a/cryptodev.h
+++ b/cryptodev.h
@@ -75,7 +75,7 @@ struct crypt_op {
uint32_t ses; /* from session_op->ses */
#define COP_DECRYPT 0
#define COP_ENCRYPT 1
- uint32_t op; /* ie. COP_ENCRYPT */
+ uint16_t op; /* ie. COP_ENCRYPT */
uint32_t flags; /* unused */
size_t len;
@@ -84,6 +84,30 @@ struct crypt_op {
void *iv;
};
+struct crypt_iovec {
+#define IOP_CIPHER 1
+#define IOP_HASH 2
+ uint16_t op_flags; /* ie. IOP_CIPHER|IOP_HASH */
+ void *src;
+ size_t len;
+};
+
+/* ioctl parameter to request a crypt/decrypt operation against a session */
+struct crypt_opv {
+ uint32_t ses; /* from session_op->ses */
+ #define COP_DECRYPT 0
+ #define COP_ENCRYPT 1
+ uint16_t op; /* ie. COP_ENCRYPT */
+ uint32_t flags; /* unused */
+
+ struct crypt_iovec* iovec;
+ uint16_t iovec_cnt;
+
+ void *dst;
+ void *mac;
+ void *iv;
+};
+
/* clone original filedescriptor */
#define CRIOGET _IOWR('c', 101, uint32_t)
@@ -100,6 +124,9 @@ struct crypt_op {
#define CIOCKEY _IOWR('c', 105, void *)
#define CIOCASYMFEAT _IOR('c', 106, uint32_t)
+/* request encryption/decryptions of a given buffer vector */
+#define CIOCCRYPTV _IOWR('c', 107, struct crypt_opv)
+
#endif /* _CRYPTODEV_H */
/* unused structures */