Go to the documentation of this file.
23 #ifndef NOISE_CONSTANTS_H
24 #define NOISE_CONSTANTS_H
32 #define NOISE_ID(ch,num) ((((int)(ch)) << 8) | ((int)(num)))
35 #define NOISE_CIPHER_NONE 0
36 #define NOISE_CIPHER_CATEGORY NOISE_ID('C', 0)
37 #define NOISE_CIPHER_CHACHAPOLY NOISE_ID('C', 1)
38 #define NOISE_CIPHER_AESGCM NOISE_ID('C', 2)
41 #define NOISE_HASH_NONE 0
42 #define NOISE_HASH_CATEGORY NOISE_ID('H', 0)
43 #define NOISE_HASH_BLAKE2s NOISE_ID('H', 1)
44 #define NOISE_HASH_BLAKE2b NOISE_ID('H', 2)
45 #define NOISE_HASH_SHA256 NOISE_ID('H', 3)
46 #define NOISE_HASH_SHA512 NOISE_ID('H', 4)
49 #define NOISE_DH_NONE 0
50 #define NOISE_DH_CATEGORY NOISE_ID('D', 0)
51 #define NOISE_DH_CURVE25519 NOISE_ID('D', 1)
52 #define NOISE_DH_CURVE448 NOISE_ID('D', 2)
53 #define NOISE_DH_NEWHOPE NOISE_ID('D', 3)
56 #define NOISE_PATTERN_NONE 0
57 #define NOISE_PATTERN_CATEGORY NOISE_ID('P', 0)
58 #define NOISE_PATTERN_N NOISE_ID('P', 1)
59 #define NOISE_PATTERN_X NOISE_ID('P', 2)
60 #define NOISE_PATTERN_K NOISE_ID('P', 3)
61 #define NOISE_PATTERN_NN NOISE_ID('P', 4)
62 #define NOISE_PATTERN_NK NOISE_ID('P', 5)
63 #define NOISE_PATTERN_NX NOISE_ID('P', 6)
64 #define NOISE_PATTERN_XN NOISE_ID('P', 7)
65 #define NOISE_PATTERN_XK NOISE_ID('P', 8)
66 #define NOISE_PATTERN_XX NOISE_ID('P', 9)
67 #define NOISE_PATTERN_KN NOISE_ID('P', 10)
68 #define NOISE_PATTERN_KK NOISE_ID('P', 11)
69 #define NOISE_PATTERN_KX NOISE_ID('P', 12)
70 #define NOISE_PATTERN_IN NOISE_ID('P', 13)
71 #define NOISE_PATTERN_IK NOISE_ID('P', 14)
72 #define NOISE_PATTERN_IX NOISE_ID('P', 15)
73 #define NOISE_PATTERN_XX_FALLBACK NOISE_ID('P', 16)
74 #define NOISE_PATTERN_X_NOIDH NOISE_ID('P', 32)
75 #define NOISE_PATTERN_NX_NOIDH NOISE_ID('P', 33)
76 #define NOISE_PATTERN_XX_NOIDH NOISE_ID('P', 34)
77 #define NOISE_PATTERN_KX_NOIDH NOISE_ID('P', 35)
78 #define NOISE_PATTERN_IK_NOIDH NOISE_ID('P', 36)
79 #define NOISE_PATTERN_IX_NOIDH NOISE_ID('P', 37)
80 #define NOISE_PATTERN_NN_HFS NOISE_ID('P', 48)
81 #define NOISE_PATTERN_NK_HFS NOISE_ID('P', 49)
82 #define NOISE_PATTERN_NX_HFS NOISE_ID('P', 50)
83 #define NOISE_PATTERN_XN_HFS NOISE_ID('P', 51)
84 #define NOISE_PATTERN_XK_HFS NOISE_ID('P', 52)
85 #define NOISE_PATTERN_XX_HFS NOISE_ID('P', 53)
86 #define NOISE_PATTERN_KN_HFS NOISE_ID('P', 54)
87 #define NOISE_PATTERN_KK_HFS NOISE_ID('P', 55)
88 #define NOISE_PATTERN_KX_HFS NOISE_ID('P', 56)
89 #define NOISE_PATTERN_IN_HFS NOISE_ID('P', 57)
90 #define NOISE_PATTERN_IK_HFS NOISE_ID('P', 58)
91 #define NOISE_PATTERN_IX_HFS NOISE_ID('P', 59)
92 #define NOISE_PATTERN_XX_FALLBACK_HFS NOISE_ID('P', 60)
93 #define NOISE_PATTERN_NX_NOIDH_HFS NOISE_ID('P', 80)
94 #define NOISE_PATTERN_XX_NOIDH_HFS NOISE_ID('P', 81)
95 #define NOISE_PATTERN_KX_NOIDH_HFS NOISE_ID('P', 82)
96 #define NOISE_PATTERN_IK_NOIDH_HFS NOISE_ID('P', 83)
97 #define NOISE_PATTERN_IX_NOIDH_HFS NOISE_ID('P', 84)
100 #define NOISE_PREFIX_NONE 0
101 #define NOISE_PREFIX_CATEGORY NOISE_ID('N', 0)
102 #define NOISE_PREFIX_STANDARD NOISE_ID('N', 1)
103 #define NOISE_PREFIX_PSK NOISE_ID('N', 2)
106 #define NOISE_SIGN_NONE 0
107 #define NOISE_SIGN_CATEGORY NOISE_ID('S', 0)
108 #define NOISE_SIGN_ED25519 NOISE_ID('S', 1)
111 #define NOISE_ROLE_INITIATOR NOISE_ID('R', 1)
112 #define NOISE_ROLE_RESPONDER NOISE_ID('R', 2)
115 #define NOISE_ACTION_NONE 0
116 #define NOISE_ACTION_WRITE_MESSAGE NOISE_ID('A', 1)
117 #define NOISE_ACTION_READ_MESSAGE NOISE_ID('A', 2)
118 #define NOISE_ACTION_FAILED NOISE_ID('A', 3)
119 #define NOISE_ACTION_SPLIT NOISE_ID('A', 4)
120 #define NOISE_ACTION_COMPLETE NOISE_ID('A', 5)
123 #define NOISE_PADDING_ZERO NOISE_ID('G', 1)
124 #define NOISE_PADDING_RANDOM NOISE_ID('G', 2)
127 #define NOISE_FINGERPRINT_BASIC NOISE_ID('F', 1)
128 #define NOISE_FINGERPRINT_FULL NOISE_ID('F', 2)
131 #define NOISE_ERROR_NONE 0
132 #define NOISE_ERROR_NO_MEMORY NOISE_ID('E', 1)
133 #define NOISE_ERROR_UNKNOWN_ID NOISE_ID('E', 2)
134 #define NOISE_ERROR_UNKNOWN_NAME NOISE_ID('E', 3)
135 #define NOISE_ERROR_MAC_FAILURE NOISE_ID('E', 4)
136 #define NOISE_ERROR_NOT_APPLICABLE NOISE_ID('E', 5)
137 #define NOISE_ERROR_SYSTEM NOISE_ID('E', 6)
138 #define NOISE_ERROR_REMOTE_KEY_REQUIRED NOISE_ID('E', 7)
139 #define NOISE_ERROR_LOCAL_KEY_REQUIRED NOISE_ID('E', 8)
140 #define NOISE_ERROR_PSK_REQUIRED NOISE_ID('E', 9)
141 #define NOISE_ERROR_INVALID_LENGTH NOISE_ID('E', 10)
142 #define NOISE_ERROR_INVALID_PARAM NOISE_ID('E', 11)
143 #define NOISE_ERROR_INVALID_STATE NOISE_ID('E', 12)
144 #define NOISE_ERROR_INVALID_NONCE NOISE_ID('E', 13)
145 #define NOISE_ERROR_INVALID_PRIVATE_KEY NOISE_ID('E', 14)
146 #define NOISE_ERROR_INVALID_PUBLIC_KEY NOISE_ID('E', 15)
147 #define NOISE_ERROR_INVALID_FORMAT NOISE_ID('E', 16)
148 #define NOISE_ERROR_INVALID_SIGNATURE NOISE_ID('E', 17)
151 #define NOISE_MAX_PAYLOAD_LEN 65535
154 #define NOISE_MAX_PROTOCOL_NAME 128
157 #define NOISE_MAX_FINGERPRINT_LEN 256