MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / sha512_update

Function sha512_update

sha512.c:241–276  ·  view source on GitHub ↗

* SHA-512 process buffer */

Source from the content-addressed store, hash-verified

239 * SHA-512 process buffer
240 */
241void sha512_update( sha512_context *ctx, const unsigned char *input,
242 size_t ilen )
243{
244 size_t fill;
245 unsigned int left;
246
247 if( ilen == 0 )
248 return;
249
250 left = (unsigned int) (ctx->total[0] & 0x7F);
251 fill = 128 - left;
252
253 ctx->total[0] += (uint64_t) ilen;
254
255 if( ctx->total[0] < (uint64_t) ilen )
256 ctx->total[1]++;
257
258 if( left && ilen >= fill )
259 {
260 memcpy( (void *) (ctx->buffer + left), input, fill );
261 sha512_process( ctx, ctx->buffer );
262 input += fill;
263 ilen -= fill;
264 left = 0;
265 }
266
267 while( ilen >= 128 )
268 {
269 sha512_process( ctx, input );
270 input += 128;
271 ilen -= 128;
272 }
273
274 if( ilen > 0 )
275 memcpy( (void *) (ctx->buffer + left), input, ilen );
276}
277
278static const unsigned char sha512_padding[128] =
279{

Callers 8

sha512_finishFunction · 0.85
sha512Function · 0.85
sha512_fileFunction · 0.85
sha512_hmac_startsFunction · 0.85
sha512_hmac_updateFunction · 0.85
sha512_hmac_finishFunction · 0.85
sha512_hmac_resetFunction · 0.85
sha512_self_testFunction · 0.85

Calls 1

sha512_processFunction · 0.85

Tested by

no test coverage detected