fixed key generation, now the ed25519 key is derived from a seed

and the curve25519 key is derived from the ed25519 key. the encrypted
part now contains the ed25519 secret.
This commit is contained in:
TLINDEN
2013-11-10 14:25:36 +01:00
parent 74a66e7456
commit 71d7121c87
17 changed files with 312 additions and 192 deletions

View File

@@ -45,7 +45,7 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
#define PCP_ME "Pretty Curved Privacy"
#define PCP_KEY_VERSION 0x00000002U
#define PCP_KEY_VERSION 0x00000003U
#define PCP_KEY_PRIMITIVE "CURVE25519-ED25519-SALSA20-POLY1305"
#define PCP_KEY_TYPE_MAINSECRET 0x01

View File

@@ -46,9 +46,10 @@ extern "C" {
PCP private key structure. Most fields are self explanatory.
Some notes:
'encrypted' contains the encrypted secret key. If it's set,
'encrypted' contains the encrypted ed25519 secret key. If it's set,
the field 'secret' which contains the clear secret key will
be zeroed with random values, the first byte will be 0.
be zeroed with random values, the first byte will be 0. Same
for the field 'edsecret'.
'nonce' contains the nonce required to decrypt the encrypted
secret, if set.
@@ -80,8 +81,9 @@ struct _pcp_key_t {
byte public[32];
byte secret[32];
byte edpub[32];
byte edsecret[64];
byte nonce[24];
byte encrypted[48];
byte encrypted[80];
char owner[255];
char mail[255];
char id[17];
@@ -114,6 +116,9 @@ pcp_pubkey_t *pcppubkey_hash;
void pcp_cleanhashes();
pcp_key_t *pcpkey_new ();
void pcp_keypairs(byte *csk, byte *cpk, byte *esk, byte *epk, byte *seed);
void pcp_ed_keypairs(byte *csk, byte *esk);
char *pcppubkey_get_art(pcp_pubkey_t *k);
char *pcpkey_get_art(pcp_key_t *k);

View File

@@ -25,7 +25,7 @@
#define PCP_VERSION_MAJOR 0
#define PCP_VERSION_MINOR 1
#define PCP_VERSION_PATCH 3
#define PCP_VERSION_PATCH 4
#define PCP_MAKE_VERSION(major, minor, patch) \
((major) * 10000 + (minor) * 100 + (patch))