LibCrypto: Remove no longer needed output_size in Public Key class

It is a remnant of serenityos and doesn't make sense in non RSA
algorithms.
This commit is contained in:
Tete17
2025-11-22 21:43:10 +01:00
committed by Jelle Raaijmakers
parent 6c143049b3
commit 8bb52c7b67
3 changed files with 3 additions and 10 deletions

View File

@@ -239,8 +239,6 @@ public:
virtual ByteString class_name() const = 0;
virtual size_t output_size() const = 0;
protected:
virtual ~PKSystem() = default;

View File

@@ -184,11 +184,6 @@ public:
return "RSA";
}
virtual size_t output_size() const override
{
return m_public_key.length();
}
void import_public_key(ReadonlyBytes, bool pem = true);
void import_private_key(ReadonlyBytes, bool pem = true);

View File

@@ -134,7 +134,7 @@ c8yGzl89pYST
EXPECT_EQ(keypem, StringView(priv_pem));
ByteBuffer msg_buffer = {};
msg_buffer.resize(rsa_from_pair.output_size());
msg_buffer.resize(rsa_from_pair.public_key().length());
auto msg = msg_buffer.bytes();
msg.overwrite(0, "WellHelloFriends", 16);
@@ -151,7 +151,7 @@ TEST_CASE(test_RSA_encrypt_decrypt)
Crypto::PK::RSA rsa(keypair);
ByteBuffer msg_buffer = {};
msg_buffer.resize(rsa.output_size());
msg_buffer.resize(rsa.public_key().length());
auto msg = msg_buffer.bytes();
msg.overwrite(0, "WellHelloFriendsWellHelloFriendsWellHelloFriendsWellHelloFriends", 64);
@@ -168,7 +168,7 @@ TEST_CASE(test_RSA_sign_verify)
Crypto::PK::RSA rsa(keypair);
ByteBuffer msg_buffer = {};
msg_buffer.resize(rsa.output_size());
msg_buffer.resize(rsa.public_key().length());
auto msg = msg_buffer.bytes();
msg.overwrite(0, "WellHelloFriendsWellHelloFriendsWellHelloFriendsWellHelloFriends", 64);