diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-12 12:57:11 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2010-07-12 12:59:56 +0200 |
commit | 4f7b10f59b97b45d42577c4d6d33958d9565aef7 (patch) | |
tree | 0f78a952c73985d7e2d852f90f7319a52db785de /ncr.h | |
parent | 8d2faf007636a936a5346426f6fe5c251a1255bb (diff) | |
download | kernel-crypto-4f7b10f59b97b45d42577c4d6d33958d9565aef7.tar.gz kernel-crypto-4f7b10f59b97b45d42577c4d6d33958d9565aef7.tar.xz kernel-crypto-4f7b10f59b97b45d42577c4d6d33958d9565aef7.zip |
Initial additions to have PK encryption/decryption. Separated operations
on keys to read/write to prevent overwriting a key while using it. Several
other cleanups.
Diffstat (limited to 'ncr.h')
-rw-r--r-- | ncr.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -8,6 +8,7 @@ #define NCR_CIPHER_MAX_BLOCK_LEN 32 #define NCR_CIPHER_MAX_KEY_LEN 64 #define NCR_HASH_MAX_OUTPUT_SIZE 64 +#define NCR_PK_MAX_OBJECT 640 typedef enum { NCR_ALG_NONE, @@ -126,6 +127,11 @@ struct ncr_key_generate_st { struct ncr_key_generate_params_st params; }; +typedef enum { + RSA_PKCS1_V1_5, + RSA_PKCS1_OAEP, +} ncr_rsa_type_t; + /* used in derivation/encryption */ struct ncr_key_params_st { @@ -137,9 +143,13 @@ struct ncr_key_params_st { size_t iv_size; } cipher; struct { - void * peer_public; + uint8_t peer_public[NCR_PK_MAX_OBJECT]; size_t peer_public_size; } dh; + struct { + ncr_rsa_type_t type; + ncr_algorithm_t hash; /* for OAEP */ + } rsa; } params; }; |