Lines Matching refs:context
143 PHP_HASH_API void PHP_SHA256InitArgs(PHP_SHA256_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA256InitArgs() argument
145 context->count[0] = context->count[1] = 0; in PHP_SHA256InitArgs()
148 context->state[0] = 0x6a09e667; in PHP_SHA256InitArgs()
149 context->state[1] = 0xbb67ae85; in PHP_SHA256InitArgs()
150 context->state[2] = 0x3c6ef372; in PHP_SHA256InitArgs()
151 context->state[3] = 0xa54ff53a; in PHP_SHA256InitArgs()
152 context->state[4] = 0x510e527f; in PHP_SHA256InitArgs()
153 context->state[5] = 0x9b05688c; in PHP_SHA256InitArgs()
154 context->state[6] = 0x1f83d9ab; in PHP_SHA256InitArgs()
155 context->state[7] = 0x5be0cd19; in PHP_SHA256InitArgs()
221 PHP_HASH_API void PHP_SHA224InitArgs(PHP_SHA224_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA224InitArgs() argument
223 context->count[0] = context->count[1] = 0; in PHP_SHA224InitArgs()
226 context->state[0] = 0xc1059ed8; in PHP_SHA224InitArgs()
227 context->state[1] = 0x367cd507; in PHP_SHA224InitArgs()
228 context->state[2] = 0x3070dd17; in PHP_SHA224InitArgs()
229 context->state[3] = 0xf70e5939; in PHP_SHA224InitArgs()
230 context->state[4] = 0xffc00b31; in PHP_SHA224InitArgs()
231 context->state[5] = 0x68581511; in PHP_SHA224InitArgs()
232 context->state[6] = 0x64f98fa7; in PHP_SHA224InitArgs()
233 context->state[7] = 0xbefa4fa4; in PHP_SHA224InitArgs()
242 PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA224Update() argument
248 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA224Update()
251 if ((context->count[0] += ((uint32_t) inputLen << 3)) < ((uint32_t) inputLen << 3)) { in PHP_SHA224Update()
252 context->count[1]++; in PHP_SHA224Update()
254 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_SHA224Update()
261 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA224Update()
262 SHA256Transform(context->state, context->buffer); in PHP_SHA224Update()
265 SHA256Transform(context->state, &input[i]); in PHP_SHA224Update()
274 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA224Update()
282 PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * context) in PHP_SHA224Final() argument
288 bits[7] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA224Final()
289 bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA224Final()
290 bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA224Final()
291 bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA224Final()
292 bits[3] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA224Final()
293 bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA224Final()
294 bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA224Final()
295 bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA224Final()
299 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA224Final()
301 PHP_SHA224Update(context, PADDING, padLen); in PHP_SHA224Final()
304 PHP_SHA224Update(context, bits, 8); in PHP_SHA224Final()
307 SHAEncode32(digest, context->state, 28); in PHP_SHA224Final()
311 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA224Final()
320 PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA256Update() argument
326 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA256Update()
329 if ((context->count[0] += ((uint32_t) inputLen << 3)) < ((uint32_t) inputLen << 3)) { in PHP_SHA256Update()
330 context->count[1]++; in PHP_SHA256Update()
332 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_SHA256Update()
339 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA256Update()
340 SHA256Transform(context->state, context->buffer); in PHP_SHA256Update()
343 SHA256Transform(context->state, &input[i]); in PHP_SHA256Update()
352 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA256Update()
360 PHP_HASH_API void PHP_SHA256Final(unsigned char digest[32], PHP_SHA256_CTX * context) in PHP_SHA256Final() argument
366 bits[7] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA256Final()
367 bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA256Final()
368 bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA256Final()
369 bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA256Final()
370 bits[3] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA256Final()
371 bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA256Final()
372 bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA256Final()
373 bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA256Final()
377 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA256Final()
379 PHP_SHA256Update(context, PADDING, padLen); in PHP_SHA256Final()
382 PHP_SHA256Update(context, bits, 8); in PHP_SHA256Final()
385 SHAEncode32(digest, context->state, 32); in PHP_SHA256Final()
389 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA256Final()
472 PHP_HASH_API void PHP_SHA384InitArgs(PHP_SHA384_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA384InitArgs() argument
474 context->count[0] = context->count[1] = 0; in PHP_SHA384InitArgs()
477 context->state[0] = L64(0xcbbb9d5dc1059ed8); in PHP_SHA384InitArgs()
478 context->state[1] = L64(0x629a292a367cd507); in PHP_SHA384InitArgs()
479 context->state[2] = L64(0x9159015a3070dd17); in PHP_SHA384InitArgs()
480 context->state[3] = L64(0x152fecd8f70e5939); in PHP_SHA384InitArgs()
481 context->state[4] = L64(0x67332667ffc00b31); in PHP_SHA384InitArgs()
482 context->state[5] = L64(0x8eb44a8768581511); in PHP_SHA384InitArgs()
483 context->state[6] = L64(0xdb0c2e0d64f98fa7); in PHP_SHA384InitArgs()
484 context->state[7] = L64(0x47b5481dbefa4fa4); in PHP_SHA384InitArgs()
535 PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA384Update() argument
541 index = (unsigned int) ((context->count[0] >> 3) & 0x7F); in PHP_SHA384Update()
544 if ((context->count[0] += ((uint64_t) inputLen << 3)) < ((uint64_t) inputLen << 3)) { in PHP_SHA384Update()
545 context->count[1]++; in PHP_SHA384Update()
548 context->count[1] += (uint64_t) inputLen >> 61; in PHP_SHA384Update()
555 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA384Update()
556 SHA512Transform(context->state, context->buffer); in PHP_SHA384Update()
559 SHA512Transform(context->state, &input[i]); in PHP_SHA384Update()
566 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA384Update()
574 PHP_HASH_API void PHP_SHA384Final(unsigned char digest[48], PHP_SHA384_CTX * context) in PHP_SHA384Final() argument
580 bits[15] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA384Final()
581 bits[14] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA384Final()
582 bits[13] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA384Final()
583 bits[12] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA384Final()
584 bits[11] = (unsigned char) ((context->count[0] >> 32) & 0xFF); in PHP_SHA384Final()
585 bits[10] = (unsigned char) ((context->count[0] >> 40) & 0xFF); in PHP_SHA384Final()
586 bits[9] = (unsigned char) ((context->count[0] >> 48) & 0xFF); in PHP_SHA384Final()
587 bits[8] = (unsigned char) ((context->count[0] >> 56) & 0xFF); in PHP_SHA384Final()
588 bits[7] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA384Final()
589 bits[6] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA384Final()
590 bits[5] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA384Final()
591 bits[4] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA384Final()
592 bits[3] = (unsigned char) ((context->count[1] >> 32) & 0xFF); in PHP_SHA384Final()
593 bits[2] = (unsigned char) ((context->count[1] >> 40) & 0xFF); in PHP_SHA384Final()
594 bits[1] = (unsigned char) ((context->count[1] >> 48) & 0xFF); in PHP_SHA384Final()
595 bits[0] = (unsigned char) ((context->count[1] >> 56) & 0xFF); in PHP_SHA384Final()
599 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_SHA384Final()
601 PHP_SHA384Update(context, PADDING, padLen); in PHP_SHA384Final()
604 PHP_SHA384Update(context, bits, 16); in PHP_SHA384Final()
607 SHAEncode64(digest, context->state, 48); in PHP_SHA384Final()
611 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA384Final()
633 PHP_HASH_API void PHP_SHA512InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA512InitArgs() argument
635 context->count[0] = context->count[1] = 0; in PHP_SHA512InitArgs()
638 context->state[0] = L64(0x6a09e667f3bcc908); in PHP_SHA512InitArgs()
639 context->state[1] = L64(0xbb67ae8584caa73b); in PHP_SHA512InitArgs()
640 context->state[2] = L64(0x3c6ef372fe94f82b); in PHP_SHA512InitArgs()
641 context->state[3] = L64(0xa54ff53a5f1d36f1); in PHP_SHA512InitArgs()
642 context->state[4] = L64(0x510e527fade682d1); in PHP_SHA512InitArgs()
643 context->state[5] = L64(0x9b05688c2b3e6c1f); in PHP_SHA512InitArgs()
644 context->state[6] = L64(0x1f83d9abfb41bd6b); in PHP_SHA512InitArgs()
645 context->state[7] = L64(0x5be0cd19137e2179); in PHP_SHA512InitArgs()
652 PHP_HASH_API void PHP_SHA512_256InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable … in PHP_SHA512_256InitArgs() argument
654 context->count[0] = context->count[1] = 0; in PHP_SHA512_256InitArgs()
656 context->state[0] = L64(0x22312194FC2BF72C); in PHP_SHA512_256InitArgs()
657 context->state[1] = L64(0x9F555FA3C84C64C2); in PHP_SHA512_256InitArgs()
658 context->state[2] = L64(0x2393B86B6F53B151); in PHP_SHA512_256InitArgs()
659 context->state[3] = L64(0x963877195940EABD); in PHP_SHA512_256InitArgs()
660 context->state[4] = L64(0x96283EE2A88EFFE3); in PHP_SHA512_256InitArgs()
661 context->state[5] = L64(0xBE5E1E2553863992); in PHP_SHA512_256InitArgs()
662 context->state[6] = L64(0x2B0199FC2C85B8AA); in PHP_SHA512_256InitArgs()
663 context->state[7] = L64(0x0EB72DDC81C52CA2); in PHP_SHA512_256InitArgs()
670 PHP_HASH_API void PHP_SHA512_224InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable … in PHP_SHA512_224InitArgs() argument
672 context->count[0] = context->count[1] = 0; in PHP_SHA512_224InitArgs()
674 context->state[0] = L64(0x8C3D37C819544DA2); in PHP_SHA512_224InitArgs()
675 context->state[1] = L64(0x73E1996689DCD4D6); in PHP_SHA512_224InitArgs()
676 context->state[2] = L64(0x1DFAB7AE32FF9C82); in PHP_SHA512_224InitArgs()
677 context->state[3] = L64(0x679DD514582F9FCF); in PHP_SHA512_224InitArgs()
678 context->state[4] = L64(0x0F6D2B697BD44DA8); in PHP_SHA512_224InitArgs()
679 context->state[5] = L64(0x77E36F7304C48942); in PHP_SHA512_224InitArgs()
680 context->state[6] = L64(0x3F9D85A86A1D36C8); in PHP_SHA512_224InitArgs()
681 context->state[7] = L64(0x1112E6AD91D692A1); in PHP_SHA512_224InitArgs()
690 PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA512Update() argument
696 index = (unsigned int) ((context->count[0] >> 3) & 0x7F); in PHP_SHA512Update()
699 if ((context->count[0] += ((uint64_t) inputLen << 3)) < ((uint64_t) inputLen << 3)) { in PHP_SHA512Update()
700 context->count[1]++; in PHP_SHA512Update()
703 context->count[1] += (uint64_t) inputLen >> 61; in PHP_SHA512Update()
710 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA512Update()
711 SHA512Transform(context->state, context->buffer); in PHP_SHA512Update()
714 SHA512Transform(context->state, &input[i]); in PHP_SHA512Update()
723 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA512Update()
731 PHP_HASH_API void PHP_SHA512Final(unsigned char digest[64], PHP_SHA512_CTX * context) in PHP_SHA512Final() argument
737 bits[15] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA512Final()
738 bits[14] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA512Final()
739 bits[13] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA512Final()
740 bits[12] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA512Final()
741 bits[11] = (unsigned char) ((context->count[0] >> 32) & 0xFF); in PHP_SHA512Final()
742 bits[10] = (unsigned char) ((context->count[0] >> 40) & 0xFF); in PHP_SHA512Final()
743 bits[9] = (unsigned char) ((context->count[0] >> 48) & 0xFF); in PHP_SHA512Final()
744 bits[8] = (unsigned char) ((context->count[0] >> 56) & 0xFF); in PHP_SHA512Final()
745 bits[7] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA512Final()
746 bits[6] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA512Final()
747 bits[5] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA512Final()
748 bits[4] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA512Final()
749 bits[3] = (unsigned char) ((context->count[1] >> 32) & 0xFF); in PHP_SHA512Final()
750 bits[2] = (unsigned char) ((context->count[1] >> 40) & 0xFF); in PHP_SHA512Final()
751 bits[1] = (unsigned char) ((context->count[1] >> 48) & 0xFF); in PHP_SHA512Final()
752 bits[0] = (unsigned char) ((context->count[1] >> 56) & 0xFF); in PHP_SHA512Final()
756 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_SHA512Final()
758 PHP_SHA512Update(context, PADDING, padLen); in PHP_SHA512Final()
761 PHP_SHA512Update(context, bits, 16); in PHP_SHA512Final()
764 SHAEncode64(digest, context->state, 64); in PHP_SHA512Final()
768 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA512Final()
775 PHP_HASH_API void PHP_SHA512_256Final(unsigned char digest[32], PHP_SHA512_CTX * context) in PHP_SHA512_256Final() argument
778 PHP_SHA512Final(full_digest, context); in PHP_SHA512_256Final()
786 PHP_HASH_API void PHP_SHA512_224Final(unsigned char digest[28], PHP_SHA512_CTX * context) in PHP_SHA512_224Final() argument
789 PHP_SHA512Final(full_digest, context); in PHP_SHA512_224Final()