test_pi_keygen.c 465 Bytes
#include <stdlib.h>
#include <stdio.h>

#include "pi_aes.h"
#include "test_utils.h"

main(int argc,char *argv[])
{
    u8 key[16],expkey[44*4];

    if(argc!=3){
        printf("usage: test_pi_keygen <key_in_file> <expanded_key_out_file>\n");
        printf("   <key_in_file> is ascii file such as key_ex.dat\n");
        return;
    }

    readAsciiBinaryData(argv[1],key,16);

    aesKeyExpand(key,expkey);

    writeAsciiBinaryData(argv[2],expkey,44*4);
}