asm.m4 1.08 KB
Newer Older
1
changequote(<,>)dnl
2
dnl (progn (modify-syntax-entry ?< "(>") (modify-syntax-entry ?> ")<") )
Niels Möller's avatar
Niels Möller committed
3
4
5
6
7
8
9
10
11
12
13

dnl FORTRAN style comment character
define(C, <
dnl>)

dnl     changecom(!,<
dnl     >)dnl

dnl including files from the srcdir
define(<include_src>, <include(srcdir/$1)>)

14
15
16
17
18
19
20
21
22
23
24
25
26
dnl Struct defining macros

dnl STRUCTURE(prefix) 
define(<STRUCTURE>, <define(<SOFFSET>, 0)define(<SPREFIX>, <$1>)>)

dnl STRUCT(name, size)
define(STRUCT,
<define(SPREFIX<_>$1, SOFFSET)dnl
 define(<SOFFSET>, eval(SOFFSET + ($2)))>)

dnl UNSIGNED(name)
define(<UNSIGNED>, <STRUCT(<$1>, 4)>)

27
dnl Offsets in aes_ctx and aes_table
28
29
30
STRUCTURE(AES)
  STRUCT(KEYS, 4*60)
  UNSIGNED(NROUNDS)
31

32
33
34
35
define(AES_SBOX_SIZE,	256)dnl
define(AES_IDX_SIZE,	16)dnl
define(AES_TABLE_SIZE,	1024)dnl

Niels Möller's avatar
Niels Möller committed
36
STRUCTURE(AES)
37
38
39
40
41
  STRUCT(SBOX, AES_SBOX_SIZE)

  STRUCT(IDX1, AES_IDX_SIZE)
  STRUCT(IDX2, AES_IDX_SIZE)
  STRUCT(IDX3, AES_IDX_SIZE)
42

43
44
45
  STRUCT(SIDX1, AES_IDX_SIZE)
  STRUCT(SIDX2, AES_IDX_SIZE)
  STRUCT(SIDX3, AES_IDX_SIZE)
46

47
48
49
50
  STRUCT(TABLE0, AES_TABLE_SIZE)
  STRUCT(TABLE1, AES_TABLE_SIZE)
  STRUCT(TABLE2, AES_TABLE_SIZE)
  STRUCT(TABLE3, AES_TABLE_SIZE)