Lines Matching refs:context

40 	PHP_SHA1_CTX context;  in PHP_FUNCTION()  local
48 PHP_SHA1Init(&context); in PHP_FUNCTION()
49 PHP_SHA1Update(&context, (unsigned char *) ZSTR_VAL(arg), ZSTR_LEN(arg)); in PHP_FUNCTION()
50 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
73 PHP_SHA1_CTX context; in PHP_FUNCTION() local
86 PHP_SHA1Init(&context); in PHP_FUNCTION()
89 PHP_SHA1Update(&context, buf, n); in PHP_FUNCTION()
92 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
160 PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX * context) in PHP_SHA1Init() argument
162 context->count[0] = context->count[1] = 0; in PHP_SHA1Init()
165 context->state[0] = 0x67452301; in PHP_SHA1Init()
166 context->state[1] = 0xefcdab89; in PHP_SHA1Init()
167 context->state[2] = 0x98badcfe; in PHP_SHA1Init()
168 context->state[3] = 0x10325476; in PHP_SHA1Init()
169 context->state[4] = 0xc3d2e1f0; in PHP_SHA1Init()
178 PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, in PHP_SHA1Update() argument
184 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA1Update()
187 if ((context->count[0] += ((php_uint32) inputLen << 3)) in PHP_SHA1Update()
189 context->count[1]++; in PHP_SHA1Update()
190 context->count[1] += ((php_uint32) inputLen >> 29); in PHP_SHA1Update()
198 ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA1Update()
199 SHA1Transform(context->state, context->buffer); in PHP_SHA1Update()
202 SHA1Transform(context->state, &input[i]); in PHP_SHA1Update()
210 ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], in PHP_SHA1Update()
219 PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context) in PHP_SHA1Final() argument
225 bits[7] = context->count[0] & 0xFF; in PHP_SHA1Final()
226 bits[6] = (context->count[0] >> 8) & 0xFF; in PHP_SHA1Final()
227 bits[5] = (context->count[0] >> 16) & 0xFF; in PHP_SHA1Final()
228 bits[4] = (context->count[0] >> 24) & 0xFF; in PHP_SHA1Final()
229 bits[3] = context->count[1] & 0xFF; in PHP_SHA1Final()
230 bits[2] = (context->count[1] >> 8) & 0xFF; in PHP_SHA1Final()
231 bits[1] = (context->count[1] >> 16) & 0xFF; in PHP_SHA1Final()
232 bits[0] = (context->count[1] >> 24) & 0xFF; in PHP_SHA1Final()
236 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA1Final()
238 PHP_SHA1Update(context, PADDING, padLen); in PHP_SHA1Final()
241 PHP_SHA1Update(context, bits, 8); in PHP_SHA1Final()
244 SHA1Encode(digest, context->state, 20); in PHP_SHA1Final()
248 memset((unsigned char*) context, 0, sizeof(*context)); in PHP_SHA1Final()