//----------------------------------------------------------------------------
//
//  ise_test_2.cpp
//
//  Authors: Joe Jarchow, Geoffrey Griffith, Joseph Kadhim, Shinya Daigaku
//           Andrew Pouzeshi
//
//  Sponsor: Tom Lookabaugh, Assistant Professor of Computer Science
//           University of Colorado
//
//  Senior Project: Team ISE (Image Selective Encryption)
//----------------------------------------------------------------------------


// This file is designed to test the ISE production code with test2.sh

#include <stdlib.h>     
#include <iostream>
#include <fstream> 
#include <string>
#include "rijndael-api-fst.h"
#include "ise.h"

using namespace std;

int main(int argc, char * argv[])
{
    /* JPEG_ISE Constructor with All Parameters */
    size_t length = 0;
    char * MyKey;
    char * MyIse;
    char * finalJpeg;

    if (argc > 0)
    {
        length = strlen(argv[1]);
        MyKey = new char [length + 1];
        strcpy (MyKey,argv[1]);
    }
    else
    {
        length = strlen("Bad_Key");
        MyKey = new char [length + 1];
        strcpy (MyKey,"Bad_Key");
    }
    if (argc > 1)
    {
        length = strlen(argv[2]);
        MyIse = new char [length + 1];
        strcpy (MyIse,argv[2]);
    }
    else
    {
        length = strlen("images/ralphie.ise");
        MyIse = new char [length + 1];
        strcpy (MyIse,"images/ralphie.ise");
    }
    if (argc > 2)
    {
        length = strlen(argv[3]);
        finalJpeg = new char [length + 1];
        strcpy (finalJpeg,argv[3]);
    }
    else
    {
        length = strlen("images/ralphie_final.jpg");
        finalJpeg = new char [length + 1];
        strcpy (finalJpeg,"images/ralphie_final.jpg");
    }

    /* Call constructor with all parameters */
    jpeg_ise decrypt_test (MyKey, MyIse, finalJpeg);

    delete [] MyKey;
    delete [] MyIse;
    delete [] finalJpeg;

    return 0;
}
