#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
#include "des.h"



main () {
    des_key_schedule k;
    unsigned char in[1024*1024];
    unsigned char out[1024*1024];
    unsigned char ivec[8];
    int i;
    struct timeval tv;
    double t1,t2;

    des_set_key("abcdefgh",k);


    /* CBC TEST */
    

    for (i=0; i<8; i++) ivec[i] = 0;
    for (i=0; i<1024*1024; i++) in[i] = ' ';

    gettimeofday(&tv, NULL);
    t1 = tv.tv_sec + tv.tv_usec * 1E-6;

    des_cbc_encrypt(in, out, 1024*1024, k, ivec, 1);

    gettimeofday(&tv, NULL);
    t2 = tv.tv_sec + tv.tv_usec * 1E-6;

    printf("%f\n", t2-t1);
}
