• Home
  • Raw
  • Download

Lines Matching refs:sha_info

161 sha_transform(SHAobject *sha_info)  in sha_transform()  argument
166 memcpy(W, sha_info->data, sizeof(sha_info->data)); in sha_transform()
167 longReverse(W, (int)sizeof(sha_info->data), sha_info->Endianness); in sha_transform()
175 A = sha_info->digest[0]; in sha_transform()
176 B = sha_info->digest[1]; in sha_transform()
177 C = sha_info->digest[2]; in sha_transform()
178 D = sha_info->digest[3]; in sha_transform()
179 E = sha_info->digest[4]; in sha_transform()
190 sha_info->digest[0] += E; in sha_transform()
191 sha_info->digest[1] += T; in sha_transform()
192 sha_info->digest[2] += A; in sha_transform()
193 sha_info->digest[3] += B; in sha_transform()
194 sha_info->digest[4] += C; in sha_transform()
211 sha_info->digest[0] += A; in sha_transform()
212 sha_info->digest[1] += B; in sha_transform()
213 sha_info->digest[2] += C; in sha_transform()
214 sha_info->digest[3] += D; in sha_transform()
215 sha_info->digest[4] += E; in sha_transform()
222 sha_init(SHAobject *sha_info) in sha_init() argument
224 TestEndianness(sha_info->Endianness) in sha_init()
226 sha_info->digest[0] = 0x67452301L; in sha_init()
227 sha_info->digest[1] = 0xefcdab89L; in sha_init()
228 sha_info->digest[2] = 0x98badcfeL; in sha_init()
229 sha_info->digest[3] = 0x10325476L; in sha_init()
230 sha_info->digest[4] = 0xc3d2e1f0L; in sha_init()
231 sha_info->count_lo = 0L; in sha_init()
232 sha_info->count_hi = 0L; in sha_init()
233 sha_info->local = 0; in sha_init()
239 sha_update(SHAobject *sha_info, SHA_BYTE *buffer, unsigned int count) in sha_update() argument
244 clo = sha_info->count_lo + ((SHA_INT32) count << 3); in sha_update()
245 if (clo < sha_info->count_lo) { in sha_update()
246 ++sha_info->count_hi; in sha_update()
248 sha_info->count_lo = clo; in sha_update()
249 sha_info->count_hi += (SHA_INT32) count >> 29; in sha_update()
250 if (sha_info->local) { in sha_update()
251 i = SHA_BLOCKSIZE - sha_info->local; in sha_update()
255 memcpy(((SHA_BYTE *) sha_info->data) + sha_info->local, buffer, i); in sha_update()
258 sha_info->local += i; in sha_update()
259 if (sha_info->local == SHA_BLOCKSIZE) { in sha_update()
260 sha_transform(sha_info); in sha_update()
267 memcpy(sha_info->data, buffer, SHA_BLOCKSIZE); in sha_update()
270 sha_transform(sha_info); in sha_update()
272 memcpy(sha_info->data, buffer, count); in sha_update()
273 sha_info->local = count; in sha_update()
279 sha_final(unsigned char digest[20], SHAobject *sha_info) in sha_final() argument
284 lo_bit_count = sha_info->count_lo; in sha_final()
285 hi_bit_count = sha_info->count_hi; in sha_final()
287 ((SHA_BYTE *) sha_info->data)[count++] = 0x80; in sha_final()
289 memset(((SHA_BYTE *) sha_info->data) + count, 0, in sha_final()
291 sha_transform(sha_info); in sha_final()
292 memset((SHA_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8); in sha_final()
295 memset(((SHA_BYTE *) sha_info->data) + count, 0, in sha_final()
301 sha_info->data[56] = (hi_bit_count >> 24) & 0xff; in sha_final()
302 sha_info->data[57] = (hi_bit_count >> 16) & 0xff; in sha_final()
303 sha_info->data[58] = (hi_bit_count >> 8) & 0xff; in sha_final()
304 sha_info->data[59] = (hi_bit_count >> 0) & 0xff; in sha_final()
305 sha_info->data[60] = (lo_bit_count >> 24) & 0xff; in sha_final()
306 sha_info->data[61] = (lo_bit_count >> 16) & 0xff; in sha_final()
307 sha_info->data[62] = (lo_bit_count >> 8) & 0xff; in sha_final()
308 sha_info->data[63] = (lo_bit_count >> 0) & 0xff; in sha_final()
309 sha_transform(sha_info); in sha_final()
310 digest[ 0] = (unsigned char) ((sha_info->digest[0] >> 24) & 0xff); in sha_final()
311 digest[ 1] = (unsigned char) ((sha_info->digest[0] >> 16) & 0xff); in sha_final()
312 digest[ 2] = (unsigned char) ((sha_info->digest[0] >> 8) & 0xff); in sha_final()
313 digest[ 3] = (unsigned char) ((sha_info->digest[0] ) & 0xff); in sha_final()
314 digest[ 4] = (unsigned char) ((sha_info->digest[1] >> 24) & 0xff); in sha_final()
315 digest[ 5] = (unsigned char) ((sha_info->digest[1] >> 16) & 0xff); in sha_final()
316 digest[ 6] = (unsigned char) ((sha_info->digest[1] >> 8) & 0xff); in sha_final()
317 digest[ 7] = (unsigned char) ((sha_info->digest[1] ) & 0xff); in sha_final()
318 digest[ 8] = (unsigned char) ((sha_info->digest[2] >> 24) & 0xff); in sha_final()
319 digest[ 9] = (unsigned char) ((sha_info->digest[2] >> 16) & 0xff); in sha_final()
320 digest[10] = (unsigned char) ((sha_info->digest[2] >> 8) & 0xff); in sha_final()
321 digest[11] = (unsigned char) ((sha_info->digest[2] ) & 0xff); in sha_final()
322 digest[12] = (unsigned char) ((sha_info->digest[3] >> 24) & 0xff); in sha_final()
323 digest[13] = (unsigned char) ((sha_info->digest[3] >> 16) & 0xff); in sha_final()
324 digest[14] = (unsigned char) ((sha_info->digest[3] >> 8) & 0xff); in sha_final()
325 digest[15] = (unsigned char) ((sha_info->digest[3] ) & 0xff); in sha_final()
326 digest[16] = (unsigned char) ((sha_info->digest[4] >> 24) & 0xff); in sha_final()
327 digest[17] = (unsigned char) ((sha_info->digest[4] >> 16) & 0xff); in sha_final()
328 digest[18] = (unsigned char) ((sha_info->digest[4] >> 8) & 0xff); in sha_final()
329 digest[19] = (unsigned char) ((sha_info->digest[4] ) & 0xff); in sha_final()