Lines Matching refs:context

37 	PHP_SHA1_CTX context;  in PHP_FUNCTION()  local
46 PHP_SHA1Init(&context); in PHP_FUNCTION()
47 PHP_SHA1Update(&context, (unsigned char *) ZSTR_VAL(arg), ZSTR_LEN(arg)); in PHP_FUNCTION()
48 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
70 PHP_SHA1_CTX context; in PHP_FUNCTION() local
85 PHP_SHA1Init(&context); in PHP_FUNCTION()
88 PHP_SHA1Update(&context, buf, n); in PHP_FUNCTION()
91 PHP_SHA1Final(digest, &context); in PHP_FUNCTION()
159 PHPAPI void PHP_SHA1Init(PHP_SHA1_CTX * context) in PHP_SHA1Init() argument
161 context->count[0] = context->count[1] = 0; in PHP_SHA1Init()
164 context->state[0] = 0x67452301; in PHP_SHA1Init()
165 context->state[1] = 0xefcdab89; in PHP_SHA1Init()
166 context->state[2] = 0x98badcfe; in PHP_SHA1Init()
167 context->state[3] = 0x10325476; in PHP_SHA1Init()
168 context->state[4] = 0xc3d2e1f0; in PHP_SHA1Init()
177 PHPAPI void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input, in PHP_SHA1Update() argument
183 index = (unsigned int) ((context->count[0] >> 3) & 0x3F); in PHP_SHA1Update()
186 if ((context->count[0] += ((uint32_t) inputLen << 3)) in PHP_SHA1Update()
188 context->count[1]++; in PHP_SHA1Update()
189 context->count[1] += ((uint32_t) inputLen >> 29); in PHP_SHA1Update()
197 ((unsigned char*) & context->buffer[index], (unsigned char*) input, partLen); in PHP_SHA1Update()
198 SHA1Transform(context->state, context->buffer); in PHP_SHA1Update()
201 SHA1Transform(context->state, &input[i]); in PHP_SHA1Update()
209 ((unsigned char*) & context->buffer[index], (unsigned char*) & input[i], in PHP_SHA1Update()
218 PHPAPI void PHP_SHA1Final(unsigned char digest[20], PHP_SHA1_CTX * context) in PHP_SHA1Final() argument
224 bits[7] = context->count[0] & 0xFF; in PHP_SHA1Final()
225 bits[6] = (context->count[0] >> 8) & 0xFF; in PHP_SHA1Final()
226 bits[5] = (context->count[0] >> 16) & 0xFF; in PHP_SHA1Final()
227 bits[4] = (context->count[0] >> 24) & 0xFF; in PHP_SHA1Final()
228 bits[3] = context->count[1] & 0xFF; in PHP_SHA1Final()
229 bits[2] = (context->count[1] >> 8) & 0xFF; in PHP_SHA1Final()
230 bits[1] = (context->count[1] >> 16) & 0xFF; in PHP_SHA1Final()
231 bits[0] = (context->count[1] >> 24) & 0xFF; in PHP_SHA1Final()
235 index = (unsigned int) ((context->count[0] >> 3) & 0x3f); in PHP_SHA1Final()
237 PHP_SHA1Update(context, PADDING, padLen); in PHP_SHA1Final()
240 PHP_SHA1Update(context, bits, 8); in PHP_SHA1Final()
243 SHA1Encode(digest, context->state, 20); in PHP_SHA1Final()
247 ZEND_SECURE_ZERO((unsigned char*) context, sizeof(*context)); in PHP_SHA1Final()