PandA-2024.02
generate.c
Go to the documentation of this file.
1 #include <stdlib.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <fcntl.h>
7 #include <unistd.h>
8 #include <assert.h>
9 
10 #include "aes.h"
11 
12 int main(int argc, char **argv) {
13  struct bench_args_t data;
14  uint8_t initial_contents[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff};
15  int i, fd;
16 
17  // Fill data structure
18  for(i=0; i<32; i++)
19  data.k[i] = i;
20  memcpy(data.buf, initial_contents, 16);
21 
22  // Open and write
23  fd = open("input.data", O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
24  assert( fd>0 && "Couldn't open input data file" );
25  data_to_input(fd, &data);
26 
27  return 0;
28 }
void data_to_input(int fd, void *vdata)
Definition: local_support.c:34
uint8_t buf[16]
Definition: aes.h:21
int main(int argc, char **argv)
Definition: generate.c:12
uint8_t k[32]
Definition: aes.h:20

Generated on Mon Feb 12 2024 13:02:49 for PandA-2024.02 by doxygen 1.8.13