#ifndef __ENCMAC_H__
#define __ENCMAC_H__

#include "fullSpec.h"

int encryptAndMac (unsigned char *authenticatedCiphertext,
	       unsigned char *cipherKey, unsigned char *iv,
	       unsigned char *macKey, unsigned char *data,
	       unsigned long dataLen);
int validateMacAndDecrypt (unsigned char *plaintext, unsigned char *cipherKey,
		       unsigned char *iv, unsigned char *macKey,
		       unsigned char *authenticatedCiphertext,
		       unsigned long authenticatedCiphertextLength);


extern int makeKeyBinary (keyInstance * keyInst, BYTE direction,
	       unsigned char *cipherKey);
extern int cipherInitBinary (cipherInstance * cipherInst, unsigned char *IV);
extern int encryptData (unsigned char *result, cipherInstance * cipherInst,
	     keyInstance * keyInst, unsigned char *plaintext,
	     unsigned long plainLen);
extern int decryptData (unsigned char *result, cipherInstance * cipherInst,
	     keyInstance * keyInst, unsigned char *ciphertext,
	     unsigned long cipherLen);
extern int validateMac (unsigned char *reference, int referenceLen, unsigned char *data,
	     unsigned int dataLen, unsigned char *key);
extern int computeKeyFromPassword (BYTE * cipherKey, char *fullPassword);
extern int computeMac (unsigned char *result, int resLen, unsigned char *data,
	    unsigned int dataLen, unsigned char *key);


#endif /* __ENCMAC_H__ */