1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 06:04:57 +00:00

Everywhere: Use nested namespace qualifiers

This commit is contained in:
Nico Weber 2023-07-11 13:49:08 -04:00 committed by Ali Mohammad Pur
parent a2f33fdcef
commit 66e210e406
27 changed files with 30 additions and 91 deletions

View file

@ -25,8 +25,7 @@ static void to_u8s(u8* b, u32 const* w)
}
namespace Crypto {
namespace Authentication {
namespace Crypto::Authentication {
GHash::TagType GHash::process(ReadonlyBytes aad, ReadonlyBytes cipher)
{
@ -118,4 +117,3 @@ void galois_multiply(u32 (&z)[4], const u32 (&_x)[4], const u32 (&_y)[4])
}
}
}

View file

@ -15,8 +15,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Authentication {
namespace Crypto::Authentication {
void galois_multiply(u32 (&z)[4], const u32 (&x)[4], const u32 (&y)[4]);
@ -62,5 +61,3 @@ private:
};
}
}

View file

@ -19,8 +19,7 @@
constexpr static auto IPAD = 0x36;
constexpr static auto OPAD = 0x5c;
namespace Crypto {
namespace Authentication {
namespace Crypto::Authentication {
template<typename HashT>
class HMAC {
@ -121,4 +120,3 @@ private:
};
}
}

View file

@ -8,8 +8,7 @@
#include <LibCrypto/Cipher/AES.h>
#include <LibCrypto/Cipher/AESTables.h>
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
template<typename T>
constexpr u32 get_key(T pt)
@ -405,4 +404,3 @@ void AESCipherBlock::overwrite(ReadonlyBytes bytes)
}
}
}

View file

@ -17,8 +17,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
struct AESCipherBlock : public CipherBlock {
public:
@ -132,4 +131,3 @@ protected:
};
}
}

View file

@ -11,8 +11,7 @@
#include <AK/Span.h>
#include <AK/Types.h>
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
enum class Intent {
Encryption,
@ -123,4 +122,3 @@ private:
PaddingMode m_padding_mode;
};
}
}

View file

@ -14,8 +14,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
template<typename T>
class CBC : public Mode<T> {
@ -126,5 +125,3 @@ private:
};
}
}

View file

@ -14,8 +14,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
/*
* Heads up: CTR is a *family* of modes, because the "counter" function is
@ -194,4 +193,3 @@ protected:
};
}
}

View file

@ -18,8 +18,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
using IncrementFunction = IncrementInplace;
@ -148,5 +147,3 @@ private:
};
}
}

View file

@ -10,8 +10,7 @@
#include <AK/Span.h>
#include <LibCrypto/Cipher/Cipher.h>
namespace Crypto {
namespace Cipher {
namespace Crypto::Cipher {
template<typename T>
class Mode {
@ -99,5 +98,3 @@ private:
T m_cipher;
};
}
}

View file

@ -14,8 +14,7 @@
#include <LibCrypto/Hash/SHA1.h>
#include <LibCrypto/Hash/SHA2.h>
namespace Crypto {
namespace Hash {
namespace Crypto::Hash {
enum class HashKind {
Unknown,
@ -219,4 +218,3 @@ private:
};
}
}

View file

@ -8,8 +8,7 @@
#include <LibCrypto/BigInt/Algorithms/UnsignedBigIntegerAlgorithms.h>
#include <LibCrypto/NumberTheory/ModularFunctions.h>
namespace Crypto {
namespace NumberTheory {
namespace Crypto::NumberTheory {
UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b)
{
@ -232,4 +231,3 @@ UnsignedBigInteger random_big_prime(size_t bits)
}
}
}

View file

@ -9,8 +9,7 @@
#include <AK/Random.h>
#include <LibCrypto/BigInt/UnsignedBigInteger.h>
namespace Crypto {
namespace NumberTheory {
namespace Crypto::NumberTheory {
UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b);
UnsignedBigInteger ModularPower(UnsignedBigInteger const& b, UnsignedBigInteger const& e, UnsignedBigInteger const& m);
@ -47,4 +46,3 @@ bool is_probably_prime(UnsignedBigInteger const& p);
UnsignedBigInteger random_big_prime(size_t bits);
}
}

View file

@ -9,8 +9,7 @@
#include <LibCrypto/Hash/HashFunction.h>
#include <LibCrypto/Verification.h>
namespace Crypto {
namespace PK {
namespace Crypto::PK {
template<typename HashFunction>
class Code {
@ -34,4 +33,3 @@ protected:
};
}
}

View file

@ -12,8 +12,7 @@
#include <LibCrypto/Hash/SHA2.h>
#include <LibCrypto/PK/Code/Code.h>
namespace Crypto {
namespace PK {
namespace Crypto::PK {
template<typename HashFunction>
class EMSA_PKCS1_V1_5 : public Code<HashFunction> {
@ -135,4 +134,3 @@ inline ReadonlyBytes EMSA_PKCS1_V1_5<Crypto::Hash::Manager>::hash_function_diges
}
}
}

View file

@ -13,8 +13,7 @@
#include <AK/Vector.h>
#include <LibCrypto/PK/Code/Code.h>
namespace Crypto {
namespace PK {
namespace Crypto::PK {
template<typename HashFunction, size_t SaltSize>
class EMSA_PSS : public Code<HashFunction> {
@ -168,4 +167,3 @@ private:
};
}
}

View file

@ -12,8 +12,7 @@
# include <AK/DeprecatedString.h>
#endif
namespace Crypto {
namespace PK {
namespace Crypto::PK {
// FIXME: Fixing name up for grabs
template<typename PrivKeyT, typename PubKeyT>
@ -50,4 +49,3 @@ protected:
};
}
}

View file

@ -12,8 +12,7 @@
#include <LibCrypto/ASN1/PEM.h>
#include <LibCrypto/PK/RSA.h>
namespace Crypto {
namespace PK {
namespace Crypto::PK {
static constexpr Array<int, 7> pkcs8_rsa_key_oid { 1, 2, 840, 113549, 1, 1, 1 };
@ -418,4 +417,3 @@ void RSA_PKCS1_EME::verify(ReadonlyBytes, Bytes&)
dbgln("FIXME: RSA_PKCS_EME::verify");
}
}
}

View file

@ -13,8 +13,8 @@
#include <LibCrypto/PK/Code/EMSA_PSS.h>
#include <LibCrypto/PK/PK.h>
namespace Crypto {
namespace PK {
namespace Crypto::PK {
template<typename Integer = UnsignedBigInteger>
class RSAPublicKey {
public:
@ -225,4 +225,3 @@ public:
}
};
}
}

View file

@ -8,8 +8,7 @@
#include <AK/Types.h>
namespace EDID {
namespace Definitions {
namespace EDID::Definitions {
struct [[gnu::packed]] StandardTimings {
u8 horizontal_8_pixels;
@ -157,4 +156,3 @@ struct [[gnu::packed]] ExtensionBlock {
static_assert(AssertSize<ExtensionBlock, 128>());
}
}

View file

@ -15,18 +15,14 @@
#include <LibGUI/UIDimensions.h>
#include <LibGfx/Forward.h>
namespace Core {
namespace Registration {
namespace Core::Registration {
extern Core::ObjectClassRegistration registration_Layout;
}
}
#define REGISTER_LAYOUT(namespace_, class_name) \
namespace Core { \
namespace Registration { \
namespace Core::Registration { \
Core::ObjectClassRegistration registration_##class_name( \
#namespace_ "::" #class_name##sv, []() { return static_ptr_cast<Core::Object>(namespace_::class_name::construct()); }, &registration_Layout); \
} \
}
namespace GUI {

View file

@ -27,18 +27,14 @@
#include <LibGfx/Rect.h>
#include <LibGfx/StandardCursor.h>
namespace Core {
namespace Registration {
namespace Core::Registration {
extern Core::ObjectClassRegistration registration_Widget;
}
}
#define REGISTER_WIDGET(namespace_, class_name) \
namespace Core { \
namespace Registration { \
namespace Core::Registration { \
Core::ObjectClassRegistration registration_##class_name( \
#namespace_ "::" #class_name##sv, []() -> ErrorOr<NonnullRefPtr<Core::Object>> { return static_ptr_cast<Core::Object>(TRY(namespace_::class_name::try_create())); }, &registration_Widget); \
} \
}
namespace GUI {

View file

@ -9,8 +9,7 @@
#include <AK/Types.h>
#include <LibLine/Style.h>
namespace Line {
namespace VT {
namespace Line::VT {
ErrorOr<void> save_cursor(Stream&);
ErrorOr<void> restore_cursor(Stream&);
@ -21,4 +20,3 @@ ErrorOr<void> move_absolute(u32 x, u32 y, Stream&);
ErrorOr<void> apply_style(Style const&, Stream&, bool is_starting = true);
}
}

View file

@ -6,8 +6,7 @@
#include <LibWeb/HTML/AttributeNames.h>
namespace Web {
namespace HTML {
namespace Web::HTML {
namespace AttributeNames {
#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name;
@ -73,4 +72,3 @@ bool is_boolean_attribute(DeprecatedFlyString const& attribute)
}
}
}

View file

@ -9,8 +9,7 @@
#include <AK/DeprecatedFlyString.h>
#include <AK/Error.h>
namespace Web {
namespace HTML {
namespace Web::HTML {
namespace AttributeNames {
#define ENUMERATE_HTML_ATTRIBUTES \
@ -250,4 +249,3 @@ ErrorOr<void> initialize_strings();
bool is_boolean_attribute(DeprecatedFlyString const& attribute);
}
}

View file

@ -7,8 +7,7 @@
#include <AK/StringView.h>
#include <LibWeb/HTML/Parser/Entities.h>
namespace Web {
namespace HTML {
namespace Web::HTML {
Optional<EntityMatch> code_points_from_entity(StringView entity)
{
@ -2278,4 +2277,3 @@ Optional<EntityMatch> code_points_from_entity(StringView entity)
}
}
}

View file

@ -9,8 +9,7 @@
#include <AK/StringView.h>
#include <AK/Vector.h>
namespace Web {
namespace HTML {
namespace Web::HTML {
struct EntityMatch {
Vector<u32, 2> code_points;
@ -20,4 +19,3 @@ struct EntityMatch {
Optional<EntityMatch> code_points_from_entity(StringView);
}
}