
#ifndef __ENCDEC_H__
#define __ENCDEC_H__

#include "fullSpec.h"

int makeKeyBinary (keyInstance * keyInst, BYTE direction,
	       unsigned char *cipherKey);
int cipherInitBinary (cipherInstance * cipherInst, unsigned char *IV);
int encryptData (unsigned char *result, cipherInstance * cipherInst,
	     keyInstance * keyInst, unsigned char *plaintext,
	     unsigned long plainLen);
int decryptData (unsigned char *result, cipherInstance * cipherInst,
	     keyInstance * keyInst, unsigned char *ciphertext,
	     unsigned long cipherLen);

extern int rijndaelKeySetupEnc (u32 rk[ /*4*(Nr + 1) */ ], const u8 cipherKey[],
			 int keyBits);
extern int rijndaelKeySetupDec (u32 rk[ /*4*(Nr + 1) */ ], const u8 cipherKey[],
			 int keyBits);
extern int padEncrypt (cipherInstance * cipher, keyInstance * key,
		BYTE * input, int inputOctets, BYTE * outBuffer);
extern int padDecrypt (cipherInstance * cipher, keyInstance * key,
		BYTE * input, int inputOctets, BYTE * outBuffer);

#endif /* __ENCDEC_H__ */