summaryrefslogtreecommitdiffstats
path: root/cryptodev_int.h
diff options
context:
space:
mode:
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 0000000..f91bea7
--- /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);