fix(SHA2Engine): cannot use HMACEngine with SHA2Engine #3421

This commit is contained in:
Alex Fabijanic
2022-04-18 17:58:31 +02:00
parent b901e6a19f
commit 4f5b7c1891
6 changed files with 427 additions and 7 deletions

View File

@@ -60,8 +60,11 @@ public:
/// The returned reference is valid until the next
/// time digest() is called, or the engine object is destroyed.
static std::string digestToHex(const Digest& bytes);
static std::string digestToHex(const Digest& bytes, std::size_t length = 0);
/// Converts a message digest into a string of hexadecimal numbers.
/// If length is greater than zero, the output is truncated to length
/// bytes. If size is greater than the length of untruncated output,
/// InvalidArgumentException is thrown.
static Digest digestFromHex(const std::string& digest);
/// Converts a string created by digestToHex back to its Digest presentation