Lines Matching refs:sha

97 int SHA384_Init(SHA512_CTX *sha) {  in SHA384_Init()  argument
98 sha->h[0] = OPENSSL_U64(0xcbbb9d5dc1059ed8); in SHA384_Init()
99 sha->h[1] = OPENSSL_U64(0x629a292a367cd507); in SHA384_Init()
100 sha->h[2] = OPENSSL_U64(0x9159015a3070dd17); in SHA384_Init()
101 sha->h[3] = OPENSSL_U64(0x152fecd8f70e5939); in SHA384_Init()
102 sha->h[4] = OPENSSL_U64(0x67332667ffc00b31); in SHA384_Init()
103 sha->h[5] = OPENSSL_U64(0x8eb44a8768581511); in SHA384_Init()
104 sha->h[6] = OPENSSL_U64(0xdb0c2e0d64f98fa7); in SHA384_Init()
105 sha->h[7] = OPENSSL_U64(0x47b5481dbefa4fa4); in SHA384_Init()
107 sha->Nl = 0; in SHA384_Init()
108 sha->Nh = 0; in SHA384_Init()
109 sha->num = 0; in SHA384_Init()
110 sha->md_len = SHA384_DIGEST_LENGTH; in SHA384_Init()
115 int SHA512_Init(SHA512_CTX *sha) { in SHA512_Init() argument
116 sha->h[0] = OPENSSL_U64(0x6a09e667f3bcc908); in SHA512_Init()
117 sha->h[1] = OPENSSL_U64(0xbb67ae8584caa73b); in SHA512_Init()
118 sha->h[2] = OPENSSL_U64(0x3c6ef372fe94f82b); in SHA512_Init()
119 sha->h[3] = OPENSSL_U64(0xa54ff53a5f1d36f1); in SHA512_Init()
120 sha->h[4] = OPENSSL_U64(0x510e527fade682d1); in SHA512_Init()
121 sha->h[5] = OPENSSL_U64(0x9b05688c2b3e6c1f); in SHA512_Init()
122 sha->h[6] = OPENSSL_U64(0x1f83d9abfb41bd6b); in SHA512_Init()
123 sha->h[7] = OPENSSL_U64(0x5be0cd19137e2179); in SHA512_Init()
125 sha->Nl = 0; in SHA512_Init()
126 sha->Nh = 0; in SHA512_Init()
127 sha->num = 0; in SHA512_Init()
128 sha->md_len = SHA512_DIGEST_LENGTH; in SHA512_Init()
169 int SHA384_Final(uint8_t *md, SHA512_CTX *sha) { in SHA384_Final() argument
170 return SHA512_Final(md, sha); in SHA384_Final()
173 int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) { in SHA384_Update() argument
174 return SHA512_Update(sha, data, len); in SHA384_Update()
247 int SHA512_Final(uint8_t *md, SHA512_CTX *sha) { in SHA512_Final() argument
248 uint8_t *p = (uint8_t *)sha->u.p; in SHA512_Final()
249 size_t n = sha->num; in SHA512_Final()
253 if (n > (sizeof(sha->u) - 16)) { in SHA512_Final()
254 memset(p + n, 0, sizeof(sha->u) - n); in SHA512_Final()
256 sha512_block_data_order(sha, p, 1); in SHA512_Final()
259 memset(p + n, 0, sizeof(sha->u) - 16 - n); in SHA512_Final()
260 p[sizeof(sha->u) - 1] = (uint8_t)(sha->Nl); in SHA512_Final()
261 p[sizeof(sha->u) - 2] = (uint8_t)(sha->Nl >> 8); in SHA512_Final()
262 p[sizeof(sha->u) - 3] = (uint8_t)(sha->Nl >> 16); in SHA512_Final()
263 p[sizeof(sha->u) - 4] = (uint8_t)(sha->Nl >> 24); in SHA512_Final()
264 p[sizeof(sha->u) - 5] = (uint8_t)(sha->Nl >> 32); in SHA512_Final()
265 p[sizeof(sha->u) - 6] = (uint8_t)(sha->Nl >> 40); in SHA512_Final()
266 p[sizeof(sha->u) - 7] = (uint8_t)(sha->Nl >> 48); in SHA512_Final()
267 p[sizeof(sha->u) - 8] = (uint8_t)(sha->Nl >> 56); in SHA512_Final()
268 p[sizeof(sha->u) - 9] = (uint8_t)(sha->Nh); in SHA512_Final()
269 p[sizeof(sha->u) - 10] = (uint8_t)(sha->Nh >> 8); in SHA512_Final()
270 p[sizeof(sha->u) - 11] = (uint8_t)(sha->Nh >> 16); in SHA512_Final()
271 p[sizeof(sha->u) - 12] = (uint8_t)(sha->Nh >> 24); in SHA512_Final()
272 p[sizeof(sha->u) - 13] = (uint8_t)(sha->Nh >> 32); in SHA512_Final()
273 p[sizeof(sha->u) - 14] = (uint8_t)(sha->Nh >> 40); in SHA512_Final()
274 p[sizeof(sha->u) - 15] = (uint8_t)(sha->Nh >> 48); in SHA512_Final()
275 p[sizeof(sha->u) - 16] = (uint8_t)(sha->Nh >> 56); in SHA512_Final()
277 sha512_block_data_order(sha, p, 1); in SHA512_Final()
285 switch (sha->md_len) { in SHA512_Final()
289 uint64_t t = sha->h[n]; in SHA512_Final()
303 uint64_t t = sha->h[n]; in SHA512_Final()