Lines Matching refs:context
139 static inline void TigerFinalize(PHP_TIGER_CTX *context) in TigerFinalize() argument
141 context->passed += (php_hash_uint64) context->length << 3; in TigerFinalize()
143 context->buffer[context->length++] = 0x1; in TigerFinalize()
144 if (context->length % 8) { in TigerFinalize()
145 memset(&context->buffer[context->length], 0, 8-context->length%8); in TigerFinalize()
146 context->length += 8-context->length%8; in TigerFinalize()
149 if (context->length > 56) { in TigerFinalize()
150 memset(&context->buffer[context->length], 0, 64 - context->length); in TigerFinalize()
151 tiger_compress(context->passes, ((php_hash_uint64 *) context->buffer), context->state); in TigerFinalize()
152 memset(context->buffer, 0, 56); in TigerFinalize()
154 memset(&context->buffer[context->length], 0, 56 - context->length); in TigerFinalize()
158 memcpy(&context->buffer[56], &context->passed, sizeof(php_hash_uint64)); in TigerFinalize()
160 context->buffer[56] = (unsigned char) (context->passed & 0xff); in TigerFinalize()
161 context->buffer[57] = (unsigned char) ((context->passed >> 8) & 0xff); in TigerFinalize()
162 context->buffer[58] = (unsigned char) ((context->passed >> 16) & 0xff); in TigerFinalize()
163 context->buffer[59] = (unsigned char) ((context->passed >> 24) & 0xff); in TigerFinalize()
164 context->buffer[60] = (unsigned char) ((context->passed >> 32) & 0xff); in TigerFinalize()
165 context->buffer[61] = (unsigned char) ((context->passed >> 40) & 0xff); in TigerFinalize()
166 context->buffer[62] = (unsigned char) ((context->passed >> 48) & 0xff); in TigerFinalize()
167 context->buffer[63] = (unsigned char) ((context->passed >> 56) & 0xff); in TigerFinalize()
169 tiger_compress(context->passes, ((php_hash_uint64 *) context->buffer), context->state); in TigerFinalize()
172 PHP_HASH_API void PHP_3TIGERInit(PHP_TIGER_CTX *context) in PHP_3TIGERInit() argument
174 memset(context, 0, sizeof(*context)); in PHP_3TIGERInit()
175 context->state[0] = L64(0x0123456789ABCDEF); in PHP_3TIGERInit()
176 context->state[1] = L64(0xFEDCBA9876543210); in PHP_3TIGERInit()
177 context->state[2] = L64(0xF096A5B4C3B2E187); in PHP_3TIGERInit()
180 PHP_HASH_API void PHP_4TIGERInit(PHP_TIGER_CTX *context) in PHP_4TIGERInit() argument
182 memset(context, 0, sizeof(*context)); in PHP_4TIGERInit()
183 context->passes = 1; in PHP_4TIGERInit()
184 context->state[0] = L64(0x0123456789ABCDEF); in PHP_4TIGERInit()
185 context->state[1] = L64(0xFEDCBA9876543210); in PHP_4TIGERInit()
186 context->state[2] = L64(0xF096A5B4C3B2E187); in PHP_4TIGERInit()
189 PHP_HASH_API void PHP_TIGERUpdate(PHP_TIGER_CTX *context, const unsigned char *input, size_t len) in PHP_TIGERUpdate() argument
191 if (context->length + len < 64) { in PHP_TIGERUpdate()
192 memcpy(&context->buffer[context->length], input, len); in PHP_TIGERUpdate()
193 context->length += len; in PHP_TIGERUpdate()
195 size_t i = 0, r = (context->length + len) % 64; in PHP_TIGERUpdate()
197 if (context->length) { in PHP_TIGERUpdate()
198 i = 64 - context->length; in PHP_TIGERUpdate()
199 memcpy(&context->buffer[context->length], input, i); in PHP_TIGERUpdate()
200 tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state); in PHP_TIGERUpdate()
201 memset(context->buffer, 0, 64); in PHP_TIGERUpdate()
202 context->passed += 512; in PHP_TIGERUpdate()
206 memcpy(context->buffer, &input[i], 64); in PHP_TIGERUpdate()
207 tiger_compress(context->passes, ((const php_hash_uint64 *) context->buffer), context->state); in PHP_TIGERUpdate()
208 context->passed += 512; in PHP_TIGERUpdate()
210 memset(&context->buffer[r], 0, 64-r); in PHP_TIGERUpdate()
211 memcpy(context->buffer, &input[i], r); in PHP_TIGERUpdate()
212 context->length = r; in PHP_TIGERUpdate()
216 PHP_HASH_API void PHP_TIGER128Final(unsigned char digest[16], PHP_TIGER_CTX *context) in PHP_TIGER128Final() argument
218 TigerFinalize(context); in PHP_TIGER128Final()
220 digest[0] = (unsigned char) ((context->state[0] >> 56) & 0xff); in PHP_TIGER128Final()
221 digest[1] = (unsigned char) ((context->state[0] >> 48) & 0xff); in PHP_TIGER128Final()
222 digest[2] = (unsigned char) ((context->state[0] >> 40) & 0xff); in PHP_TIGER128Final()
223 digest[3] = (unsigned char) ((context->state[0] >> 32) & 0xff); in PHP_TIGER128Final()
224 digest[4] = (unsigned char) ((context->state[0] >> 24) & 0xff); in PHP_TIGER128Final()
225 digest[5] = (unsigned char) ((context->state[0] >> 16) & 0xff); in PHP_TIGER128Final()
226 digest[6] = (unsigned char) ((context->state[0] >> 8) & 0xff); in PHP_TIGER128Final()
227 digest[7] = (unsigned char) (context->state[0] & 0xff); in PHP_TIGER128Final()
228 digest[8] = (unsigned char) ((context->state[1] >> 56) & 0xff); in PHP_TIGER128Final()
229 digest[9] = (unsigned char) ((context->state[1] >> 48) & 0xff); in PHP_TIGER128Final()
230 digest[10] = (unsigned char) ((context->state[1] >> 40) & 0xff); in PHP_TIGER128Final()
231 digest[11] = (unsigned char) ((context->state[1] >> 32) & 0xff); in PHP_TIGER128Final()
232 digest[12] = (unsigned char) ((context->state[1] >> 24) & 0xff); in PHP_TIGER128Final()
233 digest[13] = (unsigned char) ((context->state[1] >> 16) & 0xff); in PHP_TIGER128Final()
234 digest[14] = (unsigned char) ((context->state[1] >> 8) & 0xff); in PHP_TIGER128Final()
235 digest[15] = (unsigned char) (context->state[1] & 0xff); in PHP_TIGER128Final()
237 memset(context, 0, sizeof(*context)); in PHP_TIGER128Final()
240 PHP_HASH_API void PHP_TIGER160Final(unsigned char digest[20], PHP_TIGER_CTX *context) in PHP_TIGER160Final() argument
242 TigerFinalize(context); in PHP_TIGER160Final()
244 digest[0] = (unsigned char) ((context->state[0] >> 56) & 0xff); in PHP_TIGER160Final()
245 digest[1] = (unsigned char) ((context->state[0] >> 48) & 0xff); in PHP_TIGER160Final()
246 digest[2] = (unsigned char) ((context->state[0] >> 40) & 0xff); in PHP_TIGER160Final()
247 digest[3] = (unsigned char) ((context->state[0] >> 32) & 0xff); in PHP_TIGER160Final()
248 digest[4] = (unsigned char) ((context->state[0] >> 24) & 0xff); in PHP_TIGER160Final()
249 digest[5] = (unsigned char) ((context->state[0] >> 16) & 0xff); in PHP_TIGER160Final()
250 digest[6] = (unsigned char) ((context->state[0] >> 8) & 0xff); in PHP_TIGER160Final()
251 digest[7] = (unsigned char) (context->state[0] & 0xff); in PHP_TIGER160Final()
252 digest[8] = (unsigned char) ((context->state[1] >> 56) & 0xff); in PHP_TIGER160Final()
253 digest[9] = (unsigned char) ((context->state[1] >> 48) & 0xff); in PHP_TIGER160Final()
254 digest[10] = (unsigned char) ((context->state[1] >> 40) & 0xff); in PHP_TIGER160Final()
255 digest[11] = (unsigned char) ((context->state[1] >> 32) & 0xff); in PHP_TIGER160Final()
256 digest[12] = (unsigned char) ((context->state[1] >> 24) & 0xff); in PHP_TIGER160Final()
257 digest[13] = (unsigned char) ((context->state[1] >> 16) & 0xff); in PHP_TIGER160Final()
258 digest[14] = (unsigned char) ((context->state[1] >> 8) & 0xff); in PHP_TIGER160Final()
259 digest[15] = (unsigned char) (context->state[1] & 0xff); in PHP_TIGER160Final()
260 digest[16] = (unsigned char) ((context->state[2] >> 56) & 0xff); in PHP_TIGER160Final()
261 digest[17] = (unsigned char) ((context->state[2] >> 48) & 0xff); in PHP_TIGER160Final()
262 digest[18] = (unsigned char) ((context->state[2] >> 40) & 0xff); in PHP_TIGER160Final()
263 digest[19] = (unsigned char) ((context->state[2] >> 32) & 0xff); in PHP_TIGER160Final()
265 memset(context, 0, sizeof(*context)); in PHP_TIGER160Final()
268 PHP_HASH_API void PHP_TIGER192Final(unsigned char digest[24], PHP_TIGER_CTX *context) in PHP_TIGER192Final() argument
270 TigerFinalize(context); in PHP_TIGER192Final()
272 digest[0] = (unsigned char) ((context->state[0] >> 56) & 0xff); in PHP_TIGER192Final()
273 digest[1] = (unsigned char) ((context->state[0] >> 48) & 0xff); in PHP_TIGER192Final()
274 digest[2] = (unsigned char) ((context->state[0] >> 40) & 0xff); in PHP_TIGER192Final()
275 digest[3] = (unsigned char) ((context->state[0] >> 32) & 0xff); in PHP_TIGER192Final()
276 digest[4] = (unsigned char) ((context->state[0] >> 24) & 0xff); in PHP_TIGER192Final()
277 digest[5] = (unsigned char) ((context->state[0] >> 16) & 0xff); in PHP_TIGER192Final()
278 digest[6] = (unsigned char) ((context->state[0] >> 8) & 0xff); in PHP_TIGER192Final()
279 digest[7] = (unsigned char) (context->state[0] & 0xff); in PHP_TIGER192Final()
280 digest[8] = (unsigned char) ((context->state[1] >> 56) & 0xff); in PHP_TIGER192Final()
281 digest[9] = (unsigned char) ((context->state[1] >> 48) & 0xff); in PHP_TIGER192Final()
282 digest[10] = (unsigned char) ((context->state[1] >> 40) & 0xff); in PHP_TIGER192Final()
283 digest[11] = (unsigned char) ((context->state[1] >> 32) & 0xff); in PHP_TIGER192Final()
284 digest[12] = (unsigned char) ((context->state[1] >> 24) & 0xff); in PHP_TIGER192Final()
285 digest[13] = (unsigned char) ((context->state[1] >> 16) & 0xff); in PHP_TIGER192Final()
286 digest[14] = (unsigned char) ((context->state[1] >> 8) & 0xff); in PHP_TIGER192Final()
287 digest[15] = (unsigned char) (context->state[1] & 0xff); in PHP_TIGER192Final()
288 digest[16] = (unsigned char) ((context->state[2] >> 56) & 0xff); in PHP_TIGER192Final()
289 digest[17] = (unsigned char) ((context->state[2] >> 48) & 0xff); in PHP_TIGER192Final()
290 digest[18] = (unsigned char) ((context->state[2] >> 40) & 0xff); in PHP_TIGER192Final()
291 digest[19] = (unsigned char) ((context->state[2] >> 32) & 0xff); in PHP_TIGER192Final()
292 digest[20] = (unsigned char) ((context->state[2] >> 24) & 0xff); in PHP_TIGER192Final()
293 digest[21] = (unsigned char) ((context->state[2] >> 16) & 0xff); in PHP_TIGER192Final()
294 digest[22] = (unsigned char) ((context->state[2] >> 8) & 0xff); in PHP_TIGER192Final()
295 digest[23] = (unsigned char) (context->state[2] & 0xff); in PHP_TIGER192Final()
297 memset(context, 0, sizeof(*context)); in PHP_TIGER192Final()