mirror of
https://github.com/zebrajr/ladybird.git
synced 2026-01-15 12:15:15 +00:00
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:
committed by
Jelle Raaijmakers
parent
6c143049b3
commit
8bb52c7b67
@@ -239,8 +239,6 @@ public:
|
||||
|
||||
virtual ByteString class_name() const = 0;
|
||||
|
||||
virtual size_t output_size() const = 0;
|
||||
|
||||
protected:
|
||||
virtual ~PKSystem() = default;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user