Lines Matching refs:sha1_context_p
80 jerryx_sha1_init (jerryx_sha1_context *sha1_context_p) /**< SHA-1 context */
82 memset (sha1_context_p, 0, sizeof (jerryx_sha1_context));
84 sha1_context_p->total[0] = 0;
85 sha1_context_p->total[1] = 0;
87 sha1_context_p->state[0] = 0x67452301;
88 sha1_context_p->state[1] = 0xEFCDAB89;
89 sha1_context_p->state[2] = 0x98BADCFE;
90 sha1_context_p->state[3] = 0x10325476;
91 sha1_context_p->state[4] = 0xC3D2E1F0;
104 jerryx_sha1_process (jerryx_sha1_context *sha1_context_p, /**< SHA-1 context */
134 A = sha1_context_p->state[0];
135 B = sha1_context_p->state[1];
136 C = sha1_context_p->state[2];
137 D = sha1_context_p->state[3];
138 E = sha1_context_p->state[4];
248 sha1_context_p->state[0] += A;
249 sha1_context_p->state[1] += B;
250 sha1_context_p->state[2] += C;
251 sha1_context_p->state[3] += D;
252 sha1_context_p->state[4] += E;
264 jerryx_sha1_update (jerryx_sha1_context *sha1_context_p, /**< SHA-1 context */
276 left = sha1_context_p->total[0] & 0x3F;
279 sha1_context_p->total[0] += (uint32_t) source_length;
282 if (sha1_context_p->total[0] < (uint32_t) source_length)
284 sha1_context_p->total[1]++;
289 memcpy ((void *) (sha1_context_p->buffer + left), source_p, fill);
290 jerryx_sha1_process (sha1_context_p, sha1_context_p->buffer);
298 jerryx_sha1_process (sha1_context_p, source_p);
305 memcpy ((void *) (sha1_context_p->buffer + left), source_p, source_length);
313 jerryx_sha1_finish (jerryx_sha1_context *sha1_context_p, /**< SHA-1 context */
318 uint32_t high = (sha1_context_p->total[0] >> 29) | (sha1_context_p->total[1] << 3);
319 uint32_t low = (sha1_context_p->total[0] << 3);
321 uint32_t last = sha1_context_p->total[0] & 0x3F;
329 jerryx_sha1_update (sha1_context_p, buffer, sizeof (buffer));
334 jerryx_sha1_update (sha1_context_p, buffer, padn);
339 jerryx_sha1_update (sha1_context_p, buffer, 8);
341 JERRYX_SHA1_PUT_UINT32_BE (sha1_context_p->state[0], destination_p, 0);
342 JERRYX_SHA1_PUT_UINT32_BE (sha1_context_p->state[1], destination_p, 4);
343 JERRYX_SHA1_PUT_UINT32_BE (sha1_context_p->state[2], destination_p, 8);
344 JERRYX_SHA1_PUT_UINT32_BE (sha1_context_p->state[3], destination_p, 12);
345 JERRYX_SHA1_PUT_UINT32_BE (sha1_context_p->state[4], destination_p, 16);