Lines Matching refs:context
142 PHP_HASH_API void PHP_SHA256InitArgs(PHP_SHA256_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA256InitArgs() argument
144 context->count[0] = context->count[1] = 0; in PHP_SHA256InitArgs()
147 context->state[0] = 0x6a09e667; in PHP_SHA256InitArgs()
148 context->state[1] = 0xbb67ae85; in PHP_SHA256InitArgs()
149 context->state[2] = 0x3c6ef372; in PHP_SHA256InitArgs()
150 context->state[3] = 0xa54ff53a; in PHP_SHA256InitArgs()
151 context->state[4] = 0x510e527f; in PHP_SHA256InitArgs()
152 context->state[5] = 0x9b05688c; in PHP_SHA256InitArgs()
153 context->state[6] = 0x1f83d9ab; in PHP_SHA256InitArgs()
154 context->state[7] = 0x5be0cd19; in PHP_SHA256InitArgs()
202 PHP_HASH_API void PHP_SHA224InitArgs(PHP_SHA224_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA224InitArgs() argument
204 context->count[0] = context->count[1] = 0; in PHP_SHA224InitArgs()
207 context->state[0] = 0xc1059ed8; in PHP_SHA224InitArgs()
208 context->state[1] = 0x367cd507; in PHP_SHA224InitArgs()
209 context->state[2] = 0x3070dd17; in PHP_SHA224InitArgs()
210 context->state[3] = 0xf70e5939; in PHP_SHA224InitArgs()
211 context->state[4] = 0xffc00b31; in PHP_SHA224InitArgs()
212 context->state[5] = 0x68581511; in PHP_SHA224InitArgs()
213 context->state[6] = 0x64f98fa7; in PHP_SHA224InitArgs()
214 context->state[7] = 0xbefa4fa4; in PHP_SHA224InitArgs()
223 PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA224Update() argument
229 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA224Update()
232 if ((context->count[0] += ((uint32_t) inputLen << 3)) < ((uint32_t) inputLen << 3)) { in PHP_SHA224Update()
233 context->count[1]++; in PHP_SHA224Update()
235 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_SHA224Update()
242 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA224Update()
243 SHA256Transform(context->state, context->buffer); in PHP_SHA224Update()
246 SHA256Transform(context->state, &input[i]); in PHP_SHA224Update()
255 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA224Update()
263 PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * context) in PHP_SHA224Final() argument
269 bits[7] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA224Final()
270 bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA224Final()
271 bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA224Final()
272 bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA224Final()
273 bits[3] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA224Final()
274 bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA224Final()
275 bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA224Final()
276 bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA224Final()
280 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA224Final()
282 PHP_SHA224Update(context, PADDING, padLen); in PHP_SHA224Final()
285 PHP_SHA224Update(context, bits, 8); in PHP_SHA224Final()
288 SHAEncode32(digest, context->state, 28); in PHP_SHA224Final()
292 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA224Final()
301 PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA256Update() argument
307 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA256Update()
310 if ((context->count[0] += ((uint32_t) inputLen << 3)) < ((uint32_t) inputLen << 3)) { in PHP_SHA256Update()
311 context->count[1]++; in PHP_SHA256Update()
313 context->count[1] += (uint32_t) (inputLen >> 29); in PHP_SHA256Update()
320 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA256Update()
321 SHA256Transform(context->state, context->buffer); in PHP_SHA256Update()
324 SHA256Transform(context->state, &input[i]); in PHP_SHA256Update()
333 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA256Update()
341 PHP_HASH_API void PHP_SHA256Final(unsigned char digest[32], PHP_SHA256_CTX * context) in PHP_SHA256Final() argument
347 bits[7] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA256Final()
348 bits[6] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA256Final()
349 bits[5] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA256Final()
350 bits[4] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA256Final()
351 bits[3] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA256Final()
352 bits[2] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA256Final()
353 bits[1] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA256Final()
354 bits[0] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA256Final()
358 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA256Final()
360 PHP_SHA256Update(context, PADDING, padLen); in PHP_SHA256Final()
363 PHP_SHA256Update(context, bits, 8); in PHP_SHA256Final()
366 SHAEncode32(digest, context->state, 32); in PHP_SHA256Final()
370 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA256Final()
453 PHP_HASH_API void PHP_SHA384InitArgs(PHP_SHA384_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA384InitArgs() argument
455 context->count[0] = context->count[1] = 0; in PHP_SHA384InitArgs()
458 context->state[0] = L64(0xcbbb9d5dc1059ed8); in PHP_SHA384InitArgs()
459 context->state[1] = L64(0x629a292a367cd507); in PHP_SHA384InitArgs()
460 context->state[2] = L64(0x9159015a3070dd17); in PHP_SHA384InitArgs()
461 context->state[3] = L64(0x152fecd8f70e5939); in PHP_SHA384InitArgs()
462 context->state[4] = L64(0x67332667ffc00b31); in PHP_SHA384InitArgs()
463 context->state[5] = L64(0x8eb44a8768581511); in PHP_SHA384InitArgs()
464 context->state[6] = L64(0xdb0c2e0d64f98fa7); in PHP_SHA384InitArgs()
465 context->state[7] = L64(0x47b5481dbefa4fa4); in PHP_SHA384InitArgs()
516 PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA384Update() argument
522 index = (unsigned int) ((context->count[0] >> 3) & 0x7F); in PHP_SHA384Update()
525 if ((context->count[0] += ((uint64_t) inputLen << 3)) < ((uint64_t) inputLen << 3)) { in PHP_SHA384Update()
526 context->count[1]++; in PHP_SHA384Update()
529 context->count[1] += (uint64_t) inputLen >> 61; in PHP_SHA384Update()
536 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA384Update()
537 SHA512Transform(context->state, context->buffer); in PHP_SHA384Update()
540 SHA512Transform(context->state, &input[i]); in PHP_SHA384Update()
547 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA384Update()
555 PHP_HASH_API void PHP_SHA384Final(unsigned char digest[48], PHP_SHA384_CTX * context) in PHP_SHA384Final() argument
561 bits[15] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA384Final()
562 bits[14] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA384Final()
563 bits[13] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA384Final()
564 bits[12] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA384Final()
565 bits[11] = (unsigned char) ((context->count[0] >> 32) & 0xFF); in PHP_SHA384Final()
566 bits[10] = (unsigned char) ((context->count[0] >> 40) & 0xFF); in PHP_SHA384Final()
567 bits[9] = (unsigned char) ((context->count[0] >> 48) & 0xFF); in PHP_SHA384Final()
568 bits[8] = (unsigned char) ((context->count[0] >> 56) & 0xFF); in PHP_SHA384Final()
569 bits[7] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA384Final()
570 bits[6] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA384Final()
571 bits[5] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA384Final()
572 bits[4] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA384Final()
573 bits[3] = (unsigned char) ((context->count[1] >> 32) & 0xFF); in PHP_SHA384Final()
574 bits[2] = (unsigned char) ((context->count[1] >> 40) & 0xFF); in PHP_SHA384Final()
575 bits[1] = (unsigned char) ((context->count[1] >> 48) & 0xFF); in PHP_SHA384Final()
576 bits[0] = (unsigned char) ((context->count[1] >> 56) & 0xFF); in PHP_SHA384Final()
580 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_SHA384Final()
582 PHP_SHA384Update(context, PADDING, padLen); in PHP_SHA384Final()
585 PHP_SHA384Update(context, bits, 16); in PHP_SHA384Final()
588 SHAEncode64(digest, context->state, 48); in PHP_SHA384Final()
592 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA384Final()
614 PHP_HASH_API void PHP_SHA512InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable *arg… in PHP_SHA512InitArgs() argument
616 context->count[0] = context->count[1] = 0; in PHP_SHA512InitArgs()
619 context->state[0] = L64(0x6a09e667f3bcc908); in PHP_SHA512InitArgs()
620 context->state[1] = L64(0xbb67ae8584caa73b); in PHP_SHA512InitArgs()
621 context->state[2] = L64(0x3c6ef372fe94f82b); in PHP_SHA512InitArgs()
622 context->state[3] = L64(0xa54ff53a5f1d36f1); in PHP_SHA512InitArgs()
623 context->state[4] = L64(0x510e527fade682d1); in PHP_SHA512InitArgs()
624 context->state[5] = L64(0x9b05688c2b3e6c1f); in PHP_SHA512InitArgs()
625 context->state[6] = L64(0x1f83d9abfb41bd6b); in PHP_SHA512InitArgs()
626 context->state[7] = L64(0x5be0cd19137e2179); in PHP_SHA512InitArgs()
633 PHP_HASH_API void PHP_SHA512_256InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable … in PHP_SHA512_256InitArgs() argument
635 context->count[0] = context->count[1] = 0; in PHP_SHA512_256InitArgs()
637 context->state[0] = L64(0x22312194FC2BF72C); in PHP_SHA512_256InitArgs()
638 context->state[1] = L64(0x9F555FA3C84C64C2); in PHP_SHA512_256InitArgs()
639 context->state[2] = L64(0x2393B86B6F53B151); in PHP_SHA512_256InitArgs()
640 context->state[3] = L64(0x963877195940EABD); in PHP_SHA512_256InitArgs()
641 context->state[4] = L64(0x96283EE2A88EFFE3); in PHP_SHA512_256InitArgs()
642 context->state[5] = L64(0xBE5E1E2553863992); in PHP_SHA512_256InitArgs()
643 context->state[6] = L64(0x2B0199FC2C85B8AA); in PHP_SHA512_256InitArgs()
644 context->state[7] = L64(0x0EB72DDC81C52CA2); in PHP_SHA512_256InitArgs()
651 PHP_HASH_API void PHP_SHA512_224InitArgs(PHP_SHA512_CTX * context, ZEND_ATTRIBUTE_UNUSED HashTable … in PHP_SHA512_224InitArgs() argument
653 context->count[0] = context->count[1] = 0; in PHP_SHA512_224InitArgs()
655 context->state[0] = L64(0x8C3D37C819544DA2); in PHP_SHA512_224InitArgs()
656 context->state[1] = L64(0x73E1996689DCD4D6); in PHP_SHA512_224InitArgs()
657 context->state[2] = L64(0x1DFAB7AE32FF9C82); in PHP_SHA512_224InitArgs()
658 context->state[3] = L64(0x679DD514582F9FCF); in PHP_SHA512_224InitArgs()
659 context->state[4] = L64(0x0F6D2B697BD44DA8); in PHP_SHA512_224InitArgs()
660 context->state[5] = L64(0x77E36F7304C48942); in PHP_SHA512_224InitArgs()
661 context->state[6] = L64(0x3F9D85A86A1D36C8); in PHP_SHA512_224InitArgs()
662 context->state[7] = L64(0x1112E6AD91D692A1); in PHP_SHA512_224InitArgs()
671 PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, size_t inp… in PHP_SHA512Update() argument
677 index = (unsigned int) ((context->count[0] >> 3) & 0x7F); in PHP_SHA512Update()
680 if ((context->count[0] += ((uint64_t) inputLen << 3)) < ((uint64_t) inputLen << 3)) { in PHP_SHA512Update()
681 context->count[1]++; in PHP_SHA512Update()
684 context->count[1] += (uint64_t) inputLen >> 61; in PHP_SHA512Update()
691 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA512Update()
692 SHA512Transform(context->state, context->buffer); in PHP_SHA512Update()
695 SHA512Transform(context->state, &input[i]); in PHP_SHA512Update()
704 memcpy((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], inputLen - i); in PHP_SHA512Update()
712 PHP_HASH_API void PHP_SHA512Final(unsigned char digest[64], PHP_SHA512_CTX * context) in PHP_SHA512Final() argument
718 bits[15] = (unsigned char) (context->count[0] & 0xFF); in PHP_SHA512Final()
719 bits[14] = (unsigned char) ((context->count[0] >> 8) & 0xFF); in PHP_SHA512Final()
720 bits[13] = (unsigned char) ((context->count[0] >> 16) & 0xFF); in PHP_SHA512Final()
721 bits[12] = (unsigned char) ((context->count[0] >> 24) & 0xFF); in PHP_SHA512Final()
722 bits[11] = (unsigned char) ((context->count[0] >> 32) & 0xFF); in PHP_SHA512Final()
723 bits[10] = (unsigned char) ((context->count[0] >> 40) & 0xFF); in PHP_SHA512Final()
724 bits[9] = (unsigned char) ((context->count[0] >> 48) & 0xFF); in PHP_SHA512Final()
725 bits[8] = (unsigned char) ((context->count[0] >> 56) & 0xFF); in PHP_SHA512Final()
726 bits[7] = (unsigned char) (context->count[1] & 0xFF); in PHP_SHA512Final()
727 bits[6] = (unsigned char) ((context->count[1] >> 8) & 0xFF); in PHP_SHA512Final()
728 bits[5] = (unsigned char) ((context->count[1] >> 16) & 0xFF); in PHP_SHA512Final()
729 bits[4] = (unsigned char) ((context->count[1] >> 24) & 0xFF); in PHP_SHA512Final()
730 bits[3] = (unsigned char) ((context->count[1] >> 32) & 0xFF); in PHP_SHA512Final()
731 bits[2] = (unsigned char) ((context->count[1] >> 40) & 0xFF); in PHP_SHA512Final()
732 bits[1] = (unsigned char) ((context->count[1] >> 48) & 0xFF); in PHP_SHA512Final()
733 bits[0] = (unsigned char) ((context->count[1] >> 56) & 0xFF); in PHP_SHA512Final()
737 index = (unsigned int) ((context->count[0] >> 3) & 0x7f); in PHP_SHA512Final()
739 PHP_SHA512Update(context, PADDING, padLen); in PHP_SHA512Final()
742 PHP_SHA512Update(context, bits, 16); in PHP_SHA512Final()
745 SHAEncode64(digest, context->state, 64); in PHP_SHA512Final()
749 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA512Final()
756 PHP_HASH_API void PHP_SHA512_256Final(unsigned char digest[32], PHP_SHA512_CTX * context) in PHP_SHA512_256Final() argument
759 PHP_SHA512Final(full_digest, context); in PHP_SHA512_256Final()
767 PHP_HASH_API void PHP_SHA512_224Final(unsigned char digest[28], PHP_SHA512_CTX * context) in PHP_SHA512_224Final() argument
770 PHP_SHA512Final(full_digest, context); in PHP_SHA512_224Final()