summaryrefslogtreecommitdiffstats
path: root/cryptodev_int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 17:01:52 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 17:01:52 +0100
commit12883105566c38cf0b0ccd2a258311435283a97b (patch)
tree6aa4865fae628c4c8674fea834f06761de27d528 /cryptodev_int.h
parentc75d5221a2b57789916ca85fcbfcac12553d2ee6 (diff)
downloadkernel-crypto-12883105566c38cf0b0ccd2a258311435283a97b.tar.gz
kernel-crypto-12883105566c38cf0b0ccd2a258311435283a97b.tar.xz
kernel-crypto-12883105566c38cf0b0ccd2a258311435283a97b.zip
Added support for asynchronous block ciphers.
Diffstat (limited to 'cryptodev_int.h')
-rw-r--r--cryptodev_int.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/cryptodev_int.h b/cryptodev_int.h
new file mode 100644
index 00000000000..f91bea749c3
--- /dev/null
+++ b/cryptodev_int.h
@@ -0,0 +1,24 @@
+struct cipher_data
+{
+ int type; /* 1 synchronous, 2 async, 0 uninitialized */
+ int blocksize;
+ int ivsize;
+ union {
+ struct {
+ struct crypto_blkcipher* s;
+ struct blkcipher_desc desc;
+ } blk;
+ struct {
+ struct crypto_ablkcipher* s;
+ struct cryptodev_result *async_result;
+ struct ablkcipher_request *async_request;
+ uint8_t iv[EALG_MAX_BLOCK_LEN];
+ } ablk;
+ } u;
+};
+
+int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, __user uint8_t * key, size_t keylen);
+void cryptodev_cipher_deinit(struct cipher_data* cdata);
+ssize_t cryptodev_cipher_decrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
+ssize_t cryptodev_cipher_encrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len);
+void cryptodev_cipher_set_iv(struct cipher_data* cdata, void* iv, size_t iv_size);