diff options
author | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-12-02 11:31:25 +0300 |
commit | b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806 (patch) | |
tree | 2a23209faf0fea5586a6d4b9cee60d1b318d29fe /library/cpp/openssl/crypto/sha.h | |
parent | 559174a9144de40d6bb3997ea4073c82289b4974 (diff) | |
download | ydb-b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806.tar.gz |
remove kikimr/driver DEPENDS
Diffstat (limited to 'library/cpp/openssl/crypto/sha.h')
-rw-r--r-- | library/cpp/openssl/crypto/sha.h | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/library/cpp/openssl/crypto/sha.h b/library/cpp/openssl/crypto/sha.h deleted file mode 100644 index dbc2dfa526..0000000000 --- a/library/cpp/openssl/crypto/sha.h +++ /dev/null @@ -1,78 +0,0 @@ -#pragma once - -#include <util/generic/ptr.h> -#include <util/generic/strbuf.h> -#include <util/system/types.h> - -#include <array> - -struct SHAstate_st; -struct SHA256state_st; - -namespace NOpenSsl::NSha1 { - constexpr size_t DIGEST_LENGTH = 20; - using TDigest = std::array<ui8, DIGEST_LENGTH>; - - // not fragmented input - TDigest Calc(const void* data, size_t dataSize); - - inline TDigest Calc(TStringBuf s) { - return Calc(s.data(), s.length()); - } - - // fragmented input - class TCalcer { - public: - TCalcer(); - ~TCalcer(); - void Update(const void* data, size_t dataSize); - - void Update(TStringBuf s) { - Update(s.data(), s.length()); - } - - template <typename T> - void UpdateWithPodValue(const T& value) { - Update(&value, sizeof(value)); - } - - TDigest Final(); - - private: - THolder<SHAstate_st> Context; - }; -} - -namespace NOpenSsl::NSha256 { - constexpr size_t DIGEST_LENGTH = 32; - using TDigest = std::array<ui8, DIGEST_LENGTH>; - - // not fragmented input - TDigest Calc(const void* data, size_t dataSize); - - inline TDigest Calc(TStringBuf s) { - return Calc(s.data(), s.length()); - } - - // fragmented input - class TCalcer { - public: - TCalcer(); - ~TCalcer(); - void Update(const void* data, size_t dataSize); - - void Update(TStringBuf s) { - Update(s.data(), s.length()); - } - - template <typename T> - void UpdateWithPodValue(const T& value) { - Update(&value, sizeof(value)); - } - - TDigest Final(); - - private: - THolder<SHA256state_st> Context; - }; -} |