changed asym decryption to pbp scheme, compatibility untested yet, but works pcp-internally already

This commit is contained in:
git@daemon.de
2014-01-22 16:23:30 +01:00
parent 26d4ee43c5
commit 7b56ab60a6
5 changed files with 148 additions and 141 deletions

View File

@@ -32,6 +32,7 @@
#include "defines.h"
#include "mem.h"
#include "key.h"
#include "keyhash.h"
size_t pcp_sodium_box(unsigned char **cipher,
unsigned char *cleartext,

View File

@@ -65,6 +65,15 @@ typedef unsigned int qbyte; // Quad byte = 32 bits
// sigs
#define PCP_SIG_VERSION 2
// crypto file format stuff
#define PCP_ASYM_CIPHER 5
#define PCP_BLOCK_CIPHER 23
#define PCP_BLOCK_SIZE 32 * 1024
#define PCP_BLOCK_SIZE_IN (PCP_BLOCK_SIZE) + 16 + crypto_secretbox_NONCEBYTES
#define PCP_ASYM_RECIPIENT_SIZE ((crypto_secretbox_KEYBYTES + crypto_box_ZEROBYTES) - crypto_box_BOXZEROBYTES) + crypto_secretbox_NONCEBYTES
//#define PCP_ASYM_ADD_SENDER_PUB
// error handling
extern char *PCP_ERR;
extern byte PCP_ERRSET;
extern int PCP_EXIT;