Browse Source

LibCrypto: Use nested namespace specifiers in Hash/

Nico Weber 2 years ago
parent
commit
1fe3ba17c0

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/HashFunction.h

@@ -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;
 };
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/MD5.cpp

@@ -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)
 }
 
 }
-}

+ 1 - 4
Userland/Libraries/LibCrypto/Hash/MD5.h

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

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/SHA1.cpp

@@ -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()
 }
 
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/SHA1.h

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

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/SHA2.cpp

@@ -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;
 }
 }
-}

+ 1 - 3
Userland/Libraries/LibCrypto/Hash/SHA2.h

@@ -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:
 };
 
 }
-}