From 78905baffa23c95020899d18298bdde2edaf6ea3 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Sat, 20 Feb 2010 09:12:51 +0100 Subject: Use only async API since it is a superset of the synchronous one. Cleanup in structures. --- cryptodev_int.h | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) (limited to 'cryptodev_int.h') diff --git a/cryptodev_int.h b/cryptodev_int.h index e82a761..19cd6a3 100644 --- a/cryptodev_int.h +++ b/cryptodev_int.h @@ -25,21 +25,15 @@ extern int cryptodev_verbosity; struct cipher_data { - int type; /* 1 synchronous, 2 async, 0 uninitialized */ + int init; /* 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; + struct { + struct crypto_ablkcipher* s; + struct cryptodev_result *result; + struct ablkcipher_request *request; + uint8_t iv[EALG_MAX_BLOCK_LEN]; + } async; }; int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, __user uint8_t * key, size_t keylen); @@ -51,20 +45,13 @@ 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 init; /* 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; - + struct { + struct crypto_ahash *s; + struct cryptodev_result *result; + struct ahash_request *request; + } async; }; int cryptodev_hash_final( struct hash_data* hdata, void* output); -- cgit