summaryrefslogtreecommitdiffstats
path: root/cryptodev_int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 19:27:19 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-19 19:27:19 +0100
commit84b619d45e883755d8982806386531d3bde350f8 (patch)
tree6b04030c7993b081c1cfc8bcda6920ce31654856 /cryptodev_int.h
parentfe14a65cbd856408ae57e617190c994dae85d5f5 (diff)
downloadcryptodev-linux-84b619d45e883755d8982806386531d3bde350f8.tar.gz
cryptodev-linux-84b619d45e883755d8982806386531d3bde350f8.tar.xz
cryptodev-linux-84b619d45e883755d8982806386531d3bde350f8.zip
Added async hash support.
Diffstat (limited to 'cryptodev_int.h')
-rw-r--r--cryptodev_int.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/cryptodev_int.h b/cryptodev_int.h
index f91bea7..3aab19c 100644
--- a/cryptodev_int.h
+++ b/cryptodev_int.h
@@ -1,3 +1,5 @@
+/* cipher stuff */
+
struct cipher_data
{
int type; /* 1 synchronous, 2 async, 0 uninitialized */
@@ -22,3 +24,29 @@ 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);
+
+/* hash stuff */
+struct hash_data
+{
+ int type; /* 1 synchronous, 2 async, 0 uninitialized */
+ int digestsize;
+ union {
+ struct {
+ struct crypto_hash* s;
+ struct hash_desc desc;
+ } sync;
+ struct {
+ struct crypto_ahash *s;
+ struct cryptodev_result *async_result;
+ struct ahash_request *async_request;
+ } async;
+ } u;
+
+};
+
+int cryptodev_hash_final( struct hash_data* hdata, void* output);
+ssize_t cryptodev_hash_update( struct hash_data* hdata, struct scatterlist *sg, size_t len);
+int cryptodev_hash_reset( struct hash_data* hdata);
+void cryptodev_hash_deinit(struct hash_data* hdata);
+int cryptodev_hash_init( struct hash_data* hdata, const char* alg_name, int hmac_mode, __user void* mackey, size_t mackeylen);
+