Rename Hasher::BLOCK_SIZE_BYTES --> BlockSizeBytes.
This commit is contained in:
1 parent
dbadce83f0
commit
6efa81f315
5 files changed
+7
-7
No files matched your search
@@ -15,8 +15,8 @@ concept Hasher = requires(T hasher, uint8_t * begin, uint8_t * end)
|
|||||||
{
|
{
|
||||||
typename T::HashType;
|
typename T::HashType;
|
||||||
|
|
||||||
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::BLOCK_SIZE_BYTES)>>;
|
requires std::unsigned_integral<std::remove_cvref_t<decltype(T::BlockSizeBytes)>>;
|
||||||
typename std::integral_constant<decltype(T::BLOCK_SIZE_BYTES), T::BLOCK_SIZE_BYTES>;
|
typename std::integral_constant<decltype(T::BlockSizeBytes), T::BlockSizeBytes>;
|
||||||
|
|
||||||
hasher.Reset();
|
hasher.Reset();
|
||||||
hasher.Update(begin, end);
|
hasher.Update(begin, end);
|
||||||
|
|||||||
+1
-1
@@ -168,7 +168,7 @@ class Md4Hasher
|
|||||||
public:
|
public:
|
||||||
using HashType = Md4Hash;
|
using HashType = Md4Hash;
|
||||||
|
|
||||||
static constexpr size_t BLOCK_SIZE_BYTES = 64;
|
static constexpr size_t BlockSizeBytes = 64;
|
||||||
|
|
||||||
Md4Hasher()
|
Md4Hasher()
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -192,7 +192,7 @@ class Md5Hasher
|
|||||||
public:
|
public:
|
||||||
using HashType = Md5Hash;
|
using HashType = Md5Hash;
|
||||||
|
|
||||||
static constexpr size_t BLOCK_SIZE_BYTES = 64;
|
static constexpr size_t BlockSizeBytes = 64;
|
||||||
|
|
||||||
Md5Hasher()
|
Md5Hasher()
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -162,7 +162,7 @@ class Sha1Hasher
|
|||||||
public:
|
public:
|
||||||
using HashType = Sha1Hash;
|
using HashType = Sha1Hash;
|
||||||
|
|
||||||
static constexpr size_t BLOCK_SIZE_BYTES = 64;
|
static constexpr size_t BlockSizeBytes = 64;
|
||||||
|
|
||||||
Sha1Hasher()
|
Sha1Hasher()
|
||||||
{
|
{
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
using KeyType = std::array<uint8_t, HasherImpl::BLOCK_SIZE_BYTES>;
|
using KeyType = std::array<uint8_t, HasherImpl::BlockSizeBytes>;
|
||||||
|
|
||||||
static constexpr uint8_t OPAD_BYTE = 0x5c;
|
static constexpr uint8_t OPAD_BYTE = 0x5c;
|
||||||
static constexpr uint8_t IPAD_BYTE = 0x36;
|
static constexpr uint8_t IPAD_BYTE = 0x36;
|
||||||
@@ -94,7 +94,7 @@ private:
|
|||||||
keyHasher.Update(keyIt, keyEnd);
|
keyHasher.Update(keyIt, keyEnd);
|
||||||
|
|
||||||
auto digest = keyHasher.Finish().GetRawDigest();
|
auto digest = keyHasher.Finish().GetRawDigest();
|
||||||
static_assert(digest.size() <= HasherImpl::BLOCK_SIZE_BYTES);
|
static_assert(digest.size() <= HasherImpl::BlockSizeBytes);
|
||||||
|
|
||||||
key.fill(0);
|
key.fill(0);
|
||||||
idx = 0;
|
idx = 0;
|
||||||
|
|||||||
Reference in new issue
Block a user