/*      idea.h - header file for idea.c
*/

#include "usuals.h"  /* typedefs for byte, word16, boolean, etc. */

#define IDEAKEYSIZE 16
#define IDEABLOCKSIZE 8
#define ROUNDS       8          /* Don't change this value, should be 8 */

typedef word32 idea_keyblock[6][ROUNDS+1];
typedef word32 (*idea_keyblockptr)[ROUNDS+1];

/* lower level */

extern void en_key_idea(word16 userkey[8], idea_keyblock);
extern void de_key_idea(idea_keyblock, idea_keyblock);
extern void cipher_idea(word16 inblock[4], word16 outblock[4],
                idea_keyblock);

/* higher level */

void initcfb_idea(word16 iv0[4], byte key[16], boolean decryp);
void ideacfb(byteptr buf, int count);
void close_idea(void);

void init_idearand(byte key[16], byte seed[8], word32 tstamp);
byte idearand(void);
void close_idearand(void);


/* prototypes for passwd.c */

/* getideakey - get pass phrase from user, hashes it to an IDEA key. */
int getideakey(char *keystring, char *hash, boolean noecho);

/* hashpass - Hash pass phrase down to 128 bits (16 bytes). */
void hashpass (char *keystring, int keylen, byte *hash);
