summaryrefslogtreecommitdiffstats
path: root/cryptodev_int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-20 09:12:51 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-02-20 09:12:51 +0100
commit78905baffa23c95020899d18298bdde2edaf6ea3 (patch)
tree0d3b39e6b13d6f66c0f523706ff34267935b946f /cryptodev_int.h
parent74a3fa37f57e49df0ce0275677b45282735d9570 (diff)
downloadcryptodev-linux-78905baffa23c95020899d18298bdde2edaf6ea3.tar.gz
cryptodev-linux-78905baffa23c95020899d18298bdde2edaf6ea3.tar.xz
cryptodev-linux-78905baffa23c95020899d18298bdde2edaf6ea3.zip
Use only async API since it is a superset of the synchronous one.
Cleanup in structures.
Diffstat (limited to 'cryptodev_int.h')
-rw-r--r--cryptodev_int.h39
1 files changed, 13 insertions, 26 deletions
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);