Go to the documentation of this file.
39 #define AH_SUPPORT DISABLED
40 #elif (AH_SUPPORT != ENABLED && AH_SUPPORT != DISABLED)
41 #error AH_SUPPORT parameter is not valid
45 #ifndef AH_ESN_SUPPORT
46 #define AH_ESN_SUPPORT ENABLED
47 #elif (AH_ESN_SUPPORT != ENABLED && AH_ESN_SUPPORT != DISABLED)
48 #error AH_ESN_SUPPORT parameter is not valid
52 #ifndef AH_CMAC_SUPPORT
53 #define AH_CMAC_SUPPORT DISABLED
54 #elif (AH_CMAC_SUPPORT != ENABLED && AH_CMAC_SUPPORT != DISABLED)
55 #error AH_CMAC_SUPPORT parameter is not valid
59 #ifndef AH_HMAC_SUPPORT
60 #define AH_HMAC_SUPPORT ENABLED
61 #elif (AH_HMAC_SUPPORT != ENABLED && AH_HMAC_SUPPORT != DISABLED)
62 #error AH_HMAC_SUPPORT parameter is not valid
66 #ifndef AH_KMAC128_SUPPORT
67 #define AH_KMAC128_SUPPORT DISABLED
68 #elif (AH_KMAC128_SUPPORT != ENABLED && AH_KMAC128_SUPPORT != DISABLED)
69 #error AH_KMAC128_SUPPORT parameter is not valid
73 #ifndef AH_KMAC256_SUPPORT
74 #define AH_KMAC256_SUPPORT DISABLED
75 #elif (AH_KMAC256_SUPPORT != ENABLED && AH_KMAC256_SUPPORT != DISABLED)
76 #error AH_KMAC256_SUPPORT parameter is not valid
80 #ifndef AH_AES_128_SUPPORT
81 #define AH_AES_128_SUPPORT DISABLED
82 #elif (AH_AES_128_SUPPORT != ENABLED && AH_AES_128_SUPPORT != DISABLED)
83 #error AH_AES_128_SUPPORT parameter is not valid
87 #ifndef AH_MD5_SUPPORT
88 #define AH_MD5_SUPPORT DISABLED
89 #elif (AH_MD5_SUPPORT != ENABLED && AH_MD5_SUPPORT != DISABLED)
90 #error AH_MD5_SUPPORT parameter is not valid
94 #ifndef AH_SHA1_SUPPORT
95 #define AH_SHA1_SUPPORT ENABLED
96 #elif (AH_SHA1_SUPPORT != ENABLED && AH_SHA1_SUPPORT != DISABLED)
97 #error AH_SHA1_SUPPORT parameter is not valid
101 #ifndef AH_SHA256_SUPPORT
102 #define AH_SHA256_SUPPORT ENABLED
103 #elif (AH_SHA256_SUPPORT != ENABLED && AH_SHA256_SUPPORT != DISABLED)
104 #error AH_SHA256_SUPPORT parameter is not valid
108 #ifndef AH_SHA384_SUPPORT
109 #define AH_SHA384_SUPPORT ENABLED
110 #elif (AH_SHA384_SUPPORT != ENABLED && AH_SHA384_SUPPORT != DISABLED)
111 #error AH_SHA384_SUPPORT parameter is not valid
115 #ifndef AH_SHA512_SUPPORT
116 #define AH_SHA512_SUPPORT ENABLED
117 #elif (AH_SHA512_SUPPORT != ENABLED && AH_SHA512_SUPPORT != DISABLED)
118 #error AH_SHA512_SUPPORT parameter is not valid
122 #ifndef AH_SHA3_256_SUPPORT
123 #define AH_SHA3_256_SUPPORT DISABLED
124 #elif (AH_SHA3_256_SUPPORT != ENABLED && AH_SHA3_256_SUPPORT != DISABLED)
125 #error AH_SHA3_256_SUPPORT parameter is not valid
129 #ifndef AH_SHA3_384_SUPPORT
130 #define AH_SHA3_384_SUPPORT DISABLED
131 #elif (AH_SHA3_384_SUPPORT != ENABLED && AH_SHA3_384_SUPPORT != DISABLED)
132 #error AH_SHA3_384_SUPPORT parameter is not valid
136 #ifndef AH_SHA3_512_SUPPORT
137 #define AH_SHA3_512_SUPPORT DISABLED
138 #elif (AH_SHA3_512_SUPPORT != ENABLED && AH_SHA3_512_SUPPORT != DISABLED)
139 #error AH_SHA3_512_SUPPORT parameter is not valid
143 #ifndef AH_SM3_SUPPORT
144 #define AH_SM3_SUPPORT DISABLED
145 #elif (AH_SM3_SUPPORT != ENABLED && AH_SM3_SUPPORT != DISABLED)
146 #error AH_SM3_SUPPORT parameter is not valid
150 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
151 #define AH_MAX_DIGEST_SIZE 64
152 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
153 #define AH_MAX_DIGEST_SIZE 48
154 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
155 #define AH_MAX_DIGEST_SIZE 32
157 #define AH_MAX_DIGEST_SIZE 12
161 #if (AH_HMAC_SUPPORT == ENABLED && AH_SHA512_SUPPORT == ENABLED)
162 #define AH_MAX_ICV_SIZE 32
163 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA384_SUPPORT == ENABLED)
164 #define AH_MAX_ICV_SIZE 24
165 #elif (AH_HMAC_SUPPORT == ENABLED && AH_SHA256_SUPPORT == ENABLED)
166 #define AH_MAX_ICV_SIZE 16
168 #define AH_MAX_ICV_SIZE 12
172 #define AH_MAX_OVERHEAD (sizeof(AhHeader) + AH_MAX_ICV_SIZE)
180 #if defined(__CCRX__)
182 #elif defined(__CWCC__) || defined(_WIN32)
183 #pragma pack(push, 1)
203 #if defined(__CCRX__)
205 #elif defined(__CWCC__) || defined(_WIN32)
Structure describing a buffer that spans multiple chunks.
typedef __packed_struct
AH header.
void ahProcessMutableIpv4Options(Ipv4Header *header)
Zeroize mutable IPv4 options.
error_t ahGenerateIcv(IpsecSadEntry *sa, const Ipv4Header *ipv4Header, AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
ICV generation.
void ahDumpHeader(const AhHeader *ahHeader)
Dump AH header for debugging purpose.
error_t ahVerifyIcv(IpsecSadEntry *sa, const Ipv4Header *ipv4Header, const AhHeader *ahHeader, const NetBuffer *buffer, size_t offset)
ICV verification.
error_t ipv4ProcessAhHeader(NetInterface *interface, const Ipv4Header *ipv4Header, const NetBuffer *buffer, size_t offset, NetRxAncillary *ancillary)
Process AH protected packet.