/* This file describes all the constants and macros used in 
   the incremental cryptography C code */

#include <global.h>
#include <rsaref.h>
#include <rsa.h>

#define RANDOM_PAD_SIZE 10    /* number of random bytes to use */
#define DATA_SIZE 1           /* number of bytes of data */
#define MAX_INPUT_SIZE 256    /* maximal length of a line */

#define PKE_PATH "/.pke_keys/" /* extension to $HOME where keys are */


/* Things that need no touching */

#define DATA_LEN (DATA_SIZE + RANDOM_PAD_SIZE)
          /* length in bytes of the .data component */
#define MAX_ENC_DATA_LEN MAX_RSA_MODULUS_LEN
          /* length of encrypted data block */

/* for the main loop */
#define INPUT_ERROR 0
#define INPUT_QUIT 1
#define INPUT_KEY 2
#define INPUT_CREATE 3
#define INPUT_INSERT 4
#define INPUT_MODIFY 5
#define INPUT_DELETE 6
#define INPUT_SAVE 7
#define INPUT_LOAD 8

typedef struct pke_elt_struct {
  int datalen;
  char data[MAX_ENC_DATA_LEN];
  struct pke_elt_struct *next;
} pke_elt;

