summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-27 17:49:21 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-27 17:49:21 +0200
commitd5c2b894102e59efe499c231a32065afcf37e463 (patch)
tree4140b45a2d4290c10eb3d20e39ac63eafcc051eb /include
parenta04fd1aa4f807e2f97632a46070306e1389264ed (diff)
parent9a2369d426b23f77884b01666370140d10b41c19 (diff)
downloadkernel-crypto-d5c2b894102e59efe499c231a32065afcf37e463.tar.gz
kernel-crypto-d5c2b894102e59efe499c231a32065afcf37e463.tar.xz
kernel-crypto-d5c2b894102e59efe499c231a32065afcf37e463.zip
Merge branch 'standalone-master' into standalone-rename
Conflicts: COPYING examples/pk.c
Diffstat (limited to 'include')
-rw-r--r--include/linux/ncr.h30
1 files changed, 23 insertions, 7 deletions
diff --git a/include/linux/ncr.h b/include/linux/ncr.h
index ee6d50244f7..01fd4131187 100644
--- a/include/linux/ncr.h
+++ b/include/linux/ncr.h
@@ -7,9 +7,8 @@
#endif
#define NCR_CIPHER_MAX_BLOCK_LEN 32
-#define NCR_CIPHER_MAX_KEY_LEN 64
+#define NCR_CIPHER_MAX_KEY_LEN 512
#define NCR_HASH_MAX_OUTPUT_SIZE 64
-#define NCR_PK_MAX_OBJECT 640
typedef enum {
NCR_ALG_NONE,
@@ -39,6 +38,7 @@ typedef enum {
NCR_ALG_RSA=140,
NCR_ALG_DSA,
+ NCR_ALG_DH, /* DH as in PKCS #3 */
} ncr_algorithm_t;
@@ -76,6 +76,7 @@ struct ncr_key_generate_params_st {
ncr_algorithm_t algorithm; /* just a cipher algorithm when
* generating secret keys
*/
+
unsigned int keyflags;
union {
struct {
@@ -83,14 +84,23 @@ struct ncr_key_generate_params_st {
} secret;
struct {
unsigned int bits;
- unsigned long e;
+ unsigned long e; /* use zero for default */
} rsa;
struct {
- unsigned int q_bits;
+ /* For DSS standard allowed values
+ * are: p:1024 q: 160
+ * p:2048 q: 224
+ * p:2048 q: 256
+ * p:3072 q: 256
+ */
unsigned int p_bits;
+ unsigned int q_bits;
} dsa;
struct {
- unsigned int bits;
+ uint8_t __user *p; /* prime */
+ size_t p_size;
+ uint8_t __user *g; /* generator */
+ size_t g_size;
} dh;
} params;
};
@@ -121,8 +131,8 @@ struct ncr_key_params_st {
size_t iv_size;
} cipher;
struct {
- uint8_t peer_public[NCR_PK_MAX_OBJECT];
- size_t peer_public_size;
+ uint8_t __user *pub;
+ size_t pub_size;
} dh;
struct {
ncr_rsa_type_t type;
@@ -136,7 +146,13 @@ struct ncr_key_params_st {
} params;
};
+typedef enum {
+ NCR_DERIVE_DH=1,
+} ncr_derive_t;
+
struct ncr_key_derivation_params_st {
+ ncr_derive_t derive; /* the derivation algorithm */
+
ncr_key_t newkey;
unsigned int keyflags; /* for new key */