asm.m4 1.03 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

dnl FORTRAN style comment character
5
6
define(<C>, <
dnl>)dnl
Niels Möller's avatar
Niels Möller committed
7
8

dnl including files from the srcdir
9
define(<include_src>, <include(srcdir/$1)>)dnl
Niels Möller's avatar
Niels Möller committed
10

11
12
13
dnl Struct defining macros

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

dnl STRUCT(name, size)
17
define(<STRUCT>,
18
<define(SPREFIX<_>$1, SOFFSET)dnl
19
 define(<SOFFSET>, eval(SOFFSET + ($2)))>)dnl
20
21

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

24
dnl Offsets in aes_ctx and aes_table
25
26
27
STRUCTURE(AES)
  STRUCT(KEYS, 4*60)
  UNSIGNED(NROUNDS)
28

29
30
31
32
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
33
STRUCTURE(AES)
34
35
36
37
38
  STRUCT(SBOX, AES_SBOX_SIZE)

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

40
41
  STRUCT(SIDX1, AES_IDX_SIZE)
  STRUCT(SIDX3, AES_IDX_SIZE)
42

43
44
45
46
  STRUCT(TABLE0, AES_TABLE_SIZE)
  STRUCT(TABLE1, AES_TABLE_SIZE)
  STRUCT(TABLE2, AES_TABLE_SIZE)
  STRUCT(TABLE3, AES_TABLE_SIZE)