Lines Matching defs:sha
39 #define sha1_match "sha1|SHA1|sha-1|SHA-1"
179 /* Copy sha->state[] to working vars */
229 Sha1_t* sha = (Sha1_t*)p;
234 j = sha->count[0];
235 if ((sha->count[0] += len << 3) < j)
236 sha->count[1] += (len >> 29) + 1;
239 (void)memcpy(&sha->buffer[j], data, (i = 64 - j));
240 sha1_transform(sha->state, sha->buffer);
242 sha1_transform(sha->state, &data[i]);
248 (void)memcpy(&sha->buffer[j], &data[i], len - i);
256 register Sha1_t* sha = (Sha1_t*)p;
258 sha->count[0] = sha->count[1] = 0;
259 sha->state[0] = 0x67452301;
260 sha->state[1] = 0xEFCDAB89;
261 sha->state[2] = 0x98BADCFE;
262 sha->state[3] = 0x10325476;
263 sha->state[4] = 0xC3D2E1F0;
271 Sha1_t* sha;
273 if (sha = newof(0, Sha1_t, 1, 0))
275 sha->method = (Method_t*)method;
276 sha->name = name;
277 sha1_init((Sum_t*)sha);
279 return (Sum_t*)sha;
292 Sha1_t* sha = (Sha1_t*)p;
299 ((sha->count[(i >= 4 ? 0 : 1)]
304 while ((sha->count[0] & 504) != 448)
309 for (i = 0; i < elementsof(sha->digest); i++)
311 sha->digest[i] = (unsigned char)((sha->state[i >> 2] >> ((3 - (i & 3)) * 8)) & 255);
312 sha->digest_sum[i] ^= sha->digest[i];
314 memset(sha->count, 0, sizeof(sha->count));
315 memset(sha->state, 0, sizeof(sha->state));
316 memset(sha->buffer, 0, sizeof(sha->buffer));
323 register Sha1_t* sha = (Sha1_t*)p;
327 d = (flags & SUM_TOTAL) ? sha->digest_sum : sha->digest;
328 for (n = 0; n < elementsof(sha->digest); n++)
336 register Sha1_t* sha = (Sha1_t*)p;
338 data->size = elementsof(sha->digest);
340 data->buf = sha->digest;