LibCrypto: Use nested namespace specifiers in Hash/

This commit is contained in:
Nico Weber 2023-01-04 14:11:12 -05:00 committed by Andreas Kling
parent 27189850d8
commit 1fe3ba17c0
Notes: sideshowbarker 2024-07-17 02:11:01 +09:00
7 changed files with 7 additions and 22 deletions

View file

@ -10,8 +10,7 @@
#include <AK/StringView.h>
#include <AK/Types.h>
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
template<size_t DigestS>
struct Digest {
@ -59,4 +58,3 @@ protected:
virtual ~HashFunction() = default;
};
}
}

View file

@ -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;
}
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
void MD5::update(u8 const* input, size_t length)
{
@ -204,4 +203,3 @@ void MD5::transform(u8 const* block)
}
}
}

View file

@ -13,8 +13,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
namespace MD5Constants {
@ -98,5 +97,3 @@ private:
};
}
}

View file

@ -9,8 +9,7 @@
#include <AK/Types.h>
#include <LibCrypto/Hash/SHA1.h>
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
static constexpr auto ROTATE_LEFT(u32 value, size_t bits)
{
@ -147,4 +146,3 @@ SHA1::DigestType SHA1::peek()
}
}
}

View file

@ -12,8 +12,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
namespace SHA1Constants {
@ -81,4 +80,3 @@ private:
};
}
}

View file

@ -7,8 +7,7 @@
#include <AK/Types.h>
#include <LibCrypto/Hash/SHA2.h>
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
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 MAJ(u32 x, u32 y, u32 z) { return (x & y) ^ (x & z) ^ (y & z); }
@ -393,4 +392,3 @@ SHA512::DigestType SHA512::peek()
return digest;
}
}
}

View file

@ -13,8 +13,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
namespace SHA256Constants {
constexpr static u32 RoundConstants[64] {
@ -233,4 +232,3 @@ private:
};
}
}