Commit | Line | Data |
---|---|---|
ff05a229 | 1 | /* Magic numbers used within secnet */ |
c215a4bc IJ |
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 | |
9c6a8729 | 8 | * the Free Software Foundation; either version 3 of the License, or |
c215a4bc IJ |
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 | */ | |
ff05a229 SE |
20 | |
21 | #ifndef magic_h | |
22 | #define magic_h | |
23 | ||
5b5f297f IJ |
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 | |
dd9209d1 | 36 | #define LABEL_PROD 0x0a0a0a0a |
ff05a229 | 37 | |
09a385fb | 38 | /* uses of the 32-bit capability bitmap */ |
5b5f297f IJ |
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 | |
09a385fb | 66 | |
ff05a229 | 67 | #endif /* magic_h */ |