symm/rijndael-mktab.c: Don't hardwire output `rcon' table size.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 5 Jan 2018 04:27:14 +0000 (04:27 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 11 Jun 2018 23:51:37 +0000 (00:51 +0100)
We output `sizeof(rc)' entries, so that's what we should put in the
array length.

symm/rijndael-mktab.c

index 91007cc..182ae32 100644 (file)
@@ -331,11 +331,11 @@ const uint32 rijndael_u[4][256] = {\n\
   /* --- Round constants --- */
 
   rcon();
-  fputs("\
+  printf("\
 /* --- The round constants --- */\n\
 \n\
-const octet rijndael_rcon[32] = {\n\
-  ", stdout);
+const octet rijndael_rcon[%u] = {\n\
+  ", (unsigned)sizeof(rc));
   for (i = 0; i < sizeof(rc); i++) {
     printf("0x%02x", rc[i]);
     if (i == sizeof(rc) - 1)