| 740 | } |
| 741 | |
| 742 | void CSHA256::Midstate(unsigned char hash[OUTPUT_SIZE], uint64_t* len, unsigned char *buffer) |
| 743 | { |
| 744 | WriteBE32(hash, s[0]); |
| 745 | WriteBE32(hash + 4, s[1]); |
| 746 | WriteBE32(hash + 8, s[2]); |
| 747 | WriteBE32(hash + 12, s[3]); |
| 748 | WriteBE32(hash + 16, s[4]); |
| 749 | WriteBE32(hash + 20, s[5]); |
| 750 | WriteBE32(hash + 24, s[6]); |
| 751 | WriteBE32(hash + 28, s[7]); |
| 752 | if (len) { |
| 753 | *len = bytes << 3; |
| 754 | } |
| 755 | if (buffer) { |
| 756 | memcpy(buffer, buf, bytes % 64); |
| 757 | } |
| 758 | } |
| 759 | |
| 760 | std::vector<unsigned char> CSHA256::Save() const { |
| 761 | size_t buf_size = bytes % 64; |
no test coverage detected