MCPcopy Create free account
hub / github.com/SNAS/openbmp / finalize

Method finalize

Server/src/md5.cpp:175–209  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174
175void MD5::finalize (){
176
177 unsigned char bits[8];
178 unsigned int index, padLen;
179 static uint1 PADDING[64]={
180 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
182 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
183 };
184
185 if (finalized){
186 cerr << "MD5::finalize: Already finalized this digest!" << endl;
187 return;
188 }
189
190 // Save number of bits
191 encode (bits, count, 8);
192
193 // Pad out to 56 mod 64.
194 index = (uint4) ((count[0] >> 3) & 0x3f);
195 padLen = (index < 56) ? (56 - index) : (120 - index);
196 update (PADDING, padLen);
197
198 // Append length (before padding)
199 update (bits, 8);
200
201 // Store state in digest
202 encode (digest, state, 16);
203
204 // Zeroize sensitive information
205 memset (buffer, 0, sizeof(*buffer));
206
207 finalized=1;
208
209}
210
211
212

Callers 11

runServerFunction · 0.80
genNodeHashIdMethod · 0.80
update_PeerMethod · 0.80
update_baseAttributeMethod · 0.80
update_L3VpnMethod · 0.80
update_eVPNMethod · 0.80
update_unicastPrefixMethod · 0.80
update_LsLinkMethod · 0.80
update_LsPrefixMethod · 0.80
hashRouterMethod · 0.80
hashRouterMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected