fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. // 01234567890123456789012345678901
  5. #define K 3B7116E69E222295163FF1CAA1681FAC
  6.  
  7. #define STRINGIFY_HELPER(A) #A
  8. #define STRINGIFY(...) STRINGIFY_HELPER(__VA_ARGS__)
  9.  
  10. #define KEY STRINGIFY(K)
  11.  
  12. #define HEXTONIBBLE(c) (*(c) >= 'A' ? (*(c) - 'A')+10 : (*(c)-'0'))
  13.  
  14. #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
  15.  
  16. uint8_t aes_key[] = {
  17. HEXTOBYTE(KEY+0),
  18. HEXTOBYTE(KEY+2),
  19. HEXTOBYTE(KEY+4),
  20. HEXTOBYTE(KEY+6),
  21. HEXTOBYTE(KEY+8),
  22. HEXTOBYTE(KEY+10),
  23. HEXTOBYTE(KEY+12),
  24. HEXTOBYTE(KEY+14),
  25. HEXTOBYTE(KEY+16),
  26. HEXTOBYTE(KEY+18),
  27. HEXTOBYTE(KEY+20),
  28. HEXTOBYTE(KEY+22),
  29. HEXTOBYTE(KEY+24),
  30. HEXTOBYTE(KEY+26),
  31. HEXTOBYTE(KEY+28),
  32. HEXTOBYTE(KEY+30)
  33. };
  34.  
  35. int main() {
  36.  
  37. for (int i=0; i<sizeof(aes_key); i++) {
  38. printf("%02X ", aes_key[i]);
  39. }
  40.  
  41. return 0;
  42. }
  43.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:17:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+0),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[0]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:17:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+0),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:18:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+2),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[1]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:18:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+2),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:19:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+4),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[2]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:19:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+4),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:20:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+6),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[3]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:20:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+6),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:21:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+8),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[4]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:21:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+8),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:22:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+10),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[5]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:22:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+10),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:23:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+12),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[6]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:23:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+12),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:24:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+14),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[7]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:24:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+14),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:25:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+16),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[8]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:25:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+16),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:26:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+18),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[9]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:26:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+18),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:27:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+20),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[10]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:27:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+20),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:28:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+22),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[11]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:28:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+22),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:29:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+24),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[12]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:29:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+24),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:30:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+26),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[13]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:30:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+26),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:31:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+28),
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[14]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:31:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+28),
     ^~~~~~~~~
prog.c:14:22: error: initializer element is not constant
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:32:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+30)
     ^~~~~~~~~
prog.c:14:22: note: (near initialization for ‘aes_key[15]’)
 #define HEXTOBYTE(c) (HEXTONIBBLE(c)*16 + HEXTONIBBLE(c+1))
                      ^
prog.c:32:5: note: in expansion of macro ‘HEXTOBYTE’
     HEXTOBYTE(KEY+30)
     ^~~~~~~~~
stdout
Standard output is empty