chiark / gitweb /
site: support multiple transforms
[secnet.git] / magic.h
1 /* Magic numbers used within secnet */
2
3 #ifndef magic_h
4 #define magic_h
5
6 #define LABEL_NAK     0x00000000
7 #define LABEL_MSG0    0x00020200
8 #define LABEL_MSG1    0x01010101
9 #define LABEL_MSG2    0x02020202
10 #define LABEL_MSG3    0x03030303
11 #define LABEL_MSG3BIS 0x13030313
12 #define LABEL_MSG4    0x04040404
13 #define LABEL_MSG5    0x05050505
14 #define LABEL_MSG6    0x06060606
15 #define LABEL_MSG7    0x07070707
16 #define LABEL_MSG8    0x08080808
17 #define LABEL_MSG9    0x09090909
18
19 /* uses of the 32-bit capability bitmap */
20 #define CAPAB_EARLY           0x00000000 /* no Early flags yet (see NOTES) */
21 #define CAPAB_TRANSFORM_MASK  0x0000ffff
22 /* remaining 16 bits are unused */
23
24 /*
25  * The transform capability mask is a set of bits, one for each
26  * transform supported.  The transform capability numbers are set in
27  * the configuration (and should correspond between the two sites),
28  * although there are sensible defaults.
29  *
30  * Advertising a nonzero transform capability mask promises that
31  * the receiver understands LABEL_MSG3BIS messages, which
32  * contain an additional byte specifying the transform capability
33  * number actually chosen by the MSG3 sender.
34  *
35  * Aside from that, an empty bitmask is treated the same as
36  *  1u<<CAPAB_TRANSFORMNUM_ANCIENT
37  */
38
39 /* bit indices, 0 is ls bit */
40 #define CAPAB_TRANSFORMNUM_USER_MIN              0
41 #define CAPAB_TRANSFORMNUM_USER_MAX              7
42 #define CAPAB_TRANSFORMNUM_SERPENT256CBC         8
43 #define CAPAB_TRANSFORMNUM_EAXSERPENT            9
44 #define CAPAB_TRANSFORMNUM_MAX                  15
45
46 #define CAPAB_TRANSFORMNUM_ANCIENT CAPAB_TRANSFORMNUM_SERPENT256CBC
47
48 #endif /* magic_h */