| 32 | } |
| 33 | |
| 34 | void SHA::Final(byte *hash) |
| 35 | { |
| 36 | PadLastBlock(56); |
| 37 | CorrectEndianess(data, data, 56); |
| 38 | |
| 39 | data[(unsigned int)14] = countHi; |
| 40 | data[(unsigned int)15] = countLo; |
| 41 | |
| 42 | Transform(digest, data); |
| 43 | CorrectEndianess(digest, digest, DIGESTSIZE); |
| 44 | memcpy(hash, digest, DIGESTSIZE); |
| 45 | |
| 46 | Init(); // reinit for next use |
| 47 | } |
| 48 | |
| 49 | |
| 50 | /* The SHA f()-functions. The f1 and f3 functions can be optimized to |
no test coverage detected