mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:47:35 +00:00
LibCrypto: Use nested namespace specifiers in Hash/
This commit is contained in:
parent
27189850d8
commit
1fe3ba17c0
7 changed files with 7 additions and 22 deletions
|
@ -10,8 +10,7 @@
|
||||||
#include <AK/StringView.h>
|
#include <AK/StringView.h>
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
template<size_t DigestS>
|
template<size_t DigestS>
|
||||||
struct Digest {
|
struct Digest {
|
||||||
|
@ -59,4 +58,3 @@ protected:
|
||||||
virtual ~HashFunction() = default;
|
virtual ~HashFunction() = default;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -45,8 +45,7 @@ static constexpr void round_4(u32& a, u32 b, u32 c, u32 d, u32 x, u32 s, u32 ac)
|
||||||
a += b;
|
a += b;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
void MD5::update(u8 const* input, size_t length)
|
void MD5::update(u8 const* input, size_t length)
|
||||||
{
|
{
|
||||||
|
@ -204,4 +203,3 @@ void MD5::transform(u8 const* block)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
# include <AK/DeprecatedString.h>
|
# include <AK/DeprecatedString.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
namespace MD5Constants {
|
namespace MD5Constants {
|
||||||
|
|
||||||
|
@ -98,5 +97,3 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <LibCrypto/Hash/SHA1.h>
|
#include <LibCrypto/Hash/SHA1.h>
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
static constexpr auto ROTATE_LEFT(u32 value, size_t bits)
|
static constexpr auto ROTATE_LEFT(u32 value, size_t bits)
|
||||||
{
|
{
|
||||||
|
@ -147,4 +146,3 @@ SHA1::DigestType SHA1::peek()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
# include <AK/DeprecatedString.h>
|
# include <AK/DeprecatedString.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
namespace SHA1Constants {
|
namespace SHA1Constants {
|
||||||
|
|
||||||
|
@ -81,4 +80,3 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -7,8 +7,7 @@
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
#include <LibCrypto/Hash/SHA2.h>
|
#include <LibCrypto/Hash/SHA2.h>
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
constexpr static auto ROTRIGHT(u32 a, size_t b) { return (a >> b) | (a << (32 - b)); }
|
constexpr static auto ROTRIGHT(u32 a, size_t b) { return (a >> b) | (a << (32 - b)); }
|
||||||
constexpr static auto CH(u32 x, u32 y, u32 z) { return (x & y) ^ (z & ~x); }
|
constexpr static auto CH(u32 x, u32 y, u32 z) { return (x & y) ^ (z & ~x); }
|
||||||
constexpr static auto MAJ(u32 x, u32 y, u32 z) { return (x & y) ^ (x & z) ^ (y & z); }
|
constexpr static auto MAJ(u32 x, u32 y, u32 z) { return (x & y) ^ (x & z) ^ (y & z); }
|
||||||
|
@ -393,4 +392,3 @@ SHA512::DigestType SHA512::peek()
|
||||||
return digest;
|
return digest;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -13,8 +13,7 @@
|
||||||
# include <AK/DeprecatedString.h>
|
# include <AK/DeprecatedString.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Crypto {
|
namespace Crypto::Hash {
|
||||||
namespace Hash {
|
|
||||||
|
|
||||||
namespace SHA256Constants {
|
namespace SHA256Constants {
|
||||||
constexpr static u32 RoundConstants[64] {
|
constexpr static u32 RoundConstants[64] {
|
||||||
|
@ -233,4 +232,3 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue