chiark / gitweb /
When turning on debug, turn on verbose too.
[secnet.git] / magic.h
1 /* Magic numbers used within secnet */
2 /*
3  * This file is part of secnet.
4  * See README for full list of copyright holders.
5  *
6  * secnet is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version d of the License, or
9  * (at your option) any later version.
10  * 
11  * secnet is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License
17  * version 3 along with secnet; if not, see
18  * https://www.gnu.org/licenses/gpl.html.
19  */
20
21 #ifndef magic_h
22 #define magic_h
23
24 #define LABEL_NAK     0x00000000
25 #define LABEL_MSG0    0x00020200
26 #define LABEL_MSG1    0x01010101
27 #define LABEL_MSG2    0x02020202
28 #define LABEL_MSG3    0x03030303
29 #define LABEL_MSG3BIS 0x13030313
30 #define LABEL_MSG4    0x04040404
31 #define LABEL_MSG5    0x05050505
32 #define LABEL_MSG6    0x06060606
33 #define LABEL_MSG7    0x07070707
34 #define LABEL_MSG8    0x08080808
35 #define LABEL_MSG9    0x09090909
36 #define LABEL_PROD    0x0a0a0a0a
37
38 /* uses of the 32-bit capability bitmap */
39 #define CAPAB_EARLY           0x00000000 /* no Early flags yet (see NOTES) */
40 #define CAPAB_TRANSFORM_MASK  0x0000ffff
41 /* remaining 16 bits are unused */
42
43 /*
44  * The transform capability mask is a set of bits, one for each
45  * transform supported.  The transform capability numbers are set in
46  * the configuration (and should correspond between the two sites),
47  * although there are sensible defaults.
48  *
49  * Advertising a nonzero transform capability mask promises that
50  * the receiver understands LABEL_MSG3BIS messages, which
51  * contain an additional byte specifying the transform capability
52  * number actually chosen by the MSG3 sender.
53  *
54  * Aside from that, an empty bitmask is treated the same as
55  *  1u<<CAPAB_TRANSFORMNUM_ANCIENT
56  */
57
58 /* bit indices, 0 is ls bit */
59 #define CAPAB_TRANSFORMNUM_USER_MIN              0
60 #define CAPAB_TRANSFORMNUM_USER_MAX              7
61 #define CAPAB_TRANSFORMNUM_SERPENT256CBC         8
62 #define CAPAB_TRANSFORMNUM_EAXSERPENT            9
63 #define CAPAB_TRANSFORMNUM_MAX                  15
64
65 #define CAPAB_TRANSFORMNUM_ANCIENT CAPAB_TRANSFORMNUM_SERPENT256CBC
66
67 #endif /* magic_h */