summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-02-15 21:36:46 +0200
committerAndreas Kling <kling@serenityos.org>2022-02-16 22:21:37 +0100
commitc8db8d61527830bad820b568c0f76169abaf1709 (patch)
tree3f227bb327e92535f772fb2c34073899a0fdee29 /Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
parent6959e7f778683d5f24c947f09e0abccc9eb4e4a4 (diff)
downloadserenity-c8db8d61527830bad820b568c0f76169abaf1709.zip
LibCrypto: Exclude class_name() methods from the Kernel
These are only used by Userland and contain infallible String allocations, so let's just ifdef them out of the Kernel.
Diffstat (limited to 'Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h')
-rw-r--r--Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
index d5cb048ba9..b50713bd69 100644
--- a/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
+++ b/Userland/Libraries/LibCrypto/Cipher/Mode/GCM.h
@@ -7,13 +7,16 @@
#pragma once
#include <AK/OwnPtr.h>
-#include <AK/String.h>
#include <AK/StringBuilder.h>
#include <AK/StringView.h>
#include <LibCrypto/Authentication/GHash.h>
#include <LibCrypto/Cipher/Mode/CTR.h>
#include <LibCrypto/Verification.h>
+#ifndef KERNEL
+# include <AK/String.h>
+#endif
+
namespace Crypto {
namespace Cipher {
@@ -40,6 +43,7 @@ public:
m_ghash = Authentication::GHash(m_auth_key);
}
+#ifndef KERNEL
virtual String class_name() const override
{
StringBuilder builder;
@@ -47,8 +51,12 @@ public:
builder.append("_GCM");
return builder.build();
}
+#endif
- virtual size_t IV_length() const override { return IVSizeInBits / 8; }
+ virtual size_t IV_length() const override
+ {
+ return IVSizeInBits / 8;
+ }
// FIXME: This overload throws away the auth stuff, think up a better way to return more than a single bytebuffer.
virtual void encrypt(ReadonlyBytes in, Bytes& out, ReadonlyBytes ivec = {}, Bytes* = nullptr) override