summaryrefslogtreecommitdiffstats
path: root/ncr_int.h
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-07 13:56:43 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-07-07 13:57:11 +0200
commit32db6ad28c5b3d1a3b8e0094c931522c69f514da (patch)
tree8deb113caf0308bcaf72d7fb11d2a9bcd032d9f0 /ncr_int.h
parent115f165b6e3bb74f45e13a65c5f4f82f28664a2c (diff)
downloadcryptodev-linux-32db6ad28c5b3d1a3b8e0094c931522c69f514da.tar.gz
cryptodev-linux-32db6ad28c5b3d1a3b8e0094c931522c69f514da.tar.xz
cryptodev-linux-32db6ad28c5b3d1a3b8e0094c931522c69f514da.zip
Added ability to generate DSA and RSA keys and store them.
Diffstat (limited to 'ncr_int.h')
-rwxr-xr-xncr_int.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/ncr_int.h b/ncr_int.h
index 6e06166..4182d4f 100755
--- a/ncr_int.h
+++ b/ncr_int.h
@@ -4,6 +4,9 @@
#include "ncr.h"
#include <asm/atomic.h>
#include "cryptodev_int.h"
+#include <tomcrypt.h>
+
+#define KEY_DATA_MAX_SIZE 3*1024
#define err() printk(KERN_DEBUG"ncr: %s: %s: %d\n", __FILE__, __func__, __LINE__)
@@ -54,6 +57,10 @@ struct key_item_st {
uint8_t data[NCR_CIPHER_MAX_KEY_LEN];
size_t size;
} secret;
+ union {
+ rsa_key rsa;
+ dsa_key dsa;
+ } pk;
} key;
atomic_t refcnt;
@@ -174,4 +181,12 @@ inline static unsigned int data_flags_to_key(unsigned int data_flags)
const char* _ncr_algo_to_str(ncr_algorithm_t algo);
int _ncr_algo_digest_size(ncr_algorithm_t algo);
+/* PK */
+void ncr_pk_clear(struct key_item_st* key);
+int ncr_pk_generate(ncr_algorithm_t algo,
+ struct ncr_key_generate_params_st * params,
+ struct key_item_st* private, struct key_item_st* public);
+int ncr_pk_pack( const struct key_item_st * key, uint8_t * packed, uint32_t * packed_size);
+
+
#endif