Lines Matching refs:context
41 PHP_SHA1_CTX context; in PHP_FUNCTION() local
49 PHP_SHA1Init(&context); in PHP_FUNCTION()
50 PHP_SHA1Update(&context, arg, arg_len); in PHP_FUNCTION()
51 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
74 PHP_SHA1_CTX context; in PHP_FUNCTION() local
87 PHP_SHA1Init(&context); in PHP_FUNCTION()
90 PHP_SHA1Update(&context, buf, n); in PHP_FUNCTION()
93 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
165 PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX * context) in PHP_SHA1Init() argument
167 context->count[0] = context->count[1] = 0; in PHP_SHA1Init()
170 context->state[0] = 0x67452301; in PHP_SHA1Init()
171 context->state[1] = 0xefcdab89; in PHP_SHA1Init()
172 context->state[2] = 0x98badcfe; in PHP_SHA1Init()
173 context->state[3] = 0x10325476; in PHP_SHA1Init()
174 context->state[4] = 0xc3d2e1f0; in PHP_SHA1Init()
183 PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, in PHP_SHA1Update() argument
189 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA1Update()
192 if ((context->count[0] += ((php_uint32) inputLen << 3)) in PHP_SHA1Update()
194 context->count[1]++; in PHP_SHA1Update()
195 context->count[1] += ((php_uint32) inputLen >> 29); in PHP_SHA1Update()
203 ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA1Update()
204 SHA1Transform(context->state, context->buffer); in PHP_SHA1Update()
207 SHA1Transform(context->state, &input[i]); in PHP_SHA1Update()
215 ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], in PHP_SHA1Update()
224 PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context) in PHP_SHA1Final() argument
230 bits[7] = context->count[0] & 0xFF; in PHP_SHA1Final()
231 bits[6] = (context->count[0] >> 8) & 0xFF; in PHP_SHA1Final()
232 bits[5] = (context->count[0] >> 16) & 0xFF; in PHP_SHA1Final()
233 bits[4] = (context->count[0] >> 24) & 0xFF; in PHP_SHA1Final()
234 bits[3] = context->count[1] & 0xFF; in PHP_SHA1Final()
235 bits[2] = (context->count[1] >> 8) & 0xFF; in PHP_SHA1Final()
236 bits[1] = (context->count[1] >> 16) & 0xFF; in PHP_SHA1Final()
237 bits[0] = (context->count[1] >> 24) & 0xFF; in PHP_SHA1Final()
241 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA1Final()
243 PHP_SHA1Update(context, PADDING, padLen); in PHP_SHA1Final()
246 PHP_SHA1Update(context, bits, 8); in PHP_SHA1Final()
249 SHA1Encode(digest, context->state, 20); in PHP_SHA1Final()
253 memset((unsigned char*) context, 0, sizeof(*context)); in PHP_SHA1Final()