#ifndef WB_ENC_H_
#define WB_ENC_H_

#include <stdio.h>
#include <stdlib.h>
//#include <time.h>
//#include <math.h>
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
//#include <unistd.h>
//#include <openssl/err.h>
//#include <openssl/rand.h>
#include "wb_common.h"



/*
** CBC mode
** encrypt a plaintext of any size
** pt: plaintext, ct: ciphertext, size: number of bytes, iv: initialization vector
*/
long cbc_wb_encrypt (unsigned char **ct, unsigned char **pt, long size, unsigned char *iv);

/*
** CBC mode with no padding
** encrypt a plaintext of size multiple of 16
** pt: plaintext, ct:ciphertext, size: number of bytes, iv: initialization vector
*/
long cbc_wb_encrypt_nopadding (unsigned char **ct, unsigned char **pt, long size, unsigned char *iv);

/*
** ECB mode
** encrypt a plaintext of any size
** pt: plaintext, ct: ciphertext, size: number of bytes
*/
long ecb_wb_encrypt (unsigned char **ct, unsigned char **pt, long size);

/*
** encrypt a plaintext of a block of 16 bytes
** pt: plaintext, ct: ciphertext
*/
void encBlock (unsigned char ct[16], const unsigned char pt[16]);

/*
** free variable ct.
*/
void cleanup (unsigned char **ct);

/*
** padding scheme
*/
void padding (unsigned char *pt, long numRemainder);

/*
** get random number of 16 bytes
*/
void get_rand16 (unsigned char rand[16]);

#endif /* WB_ENC_H_ */
