tdutils: sha512

GitOrigin-RevId: c6875d59d840abff58cd4da5abd59517ce00ab02
This commit is contained in:
Arseny Smirnov 2018-03-21 13:12:39 +03:00
parent a92860a046
commit 40b314f60d
2 changed files with 8 additions and 0 deletions

View File

@ -340,6 +340,12 @@ void sha256(Slice data, MutableSlice output) {
CHECK(result == output.ubegin());
}
void sha512(Slice data, MutableSlice output) {
CHECK(output.size() >= 64);
auto result = SHA512(data.ubegin(), data.size(), output.ubegin());
CHECK(result == output.ubegin());
}
struct Sha256StateImpl {
SHA256_CTX ctx;
};

View File

@ -48,6 +48,8 @@ void sha1(Slice data, unsigned char output[20]);
void sha256(Slice data, MutableSlice output);
void sha512(Slice data, MutableSlice output);
struct Sha256StateImpl;
struct Sha256State {