From 2511eb060b571fe24b328985e40653508383aa15 Mon Sep 17 00:00:00 2001 From: Tim Hsu Date: Fri, 31 May 2024 09:28:05 +0000 Subject: [PATCH] Fix error --- lib/openpgp.rb | 2 ++ lib/openpgp/hash.rb | 16 ++++++++-------- lib/openpgp/keyring.rb | 2 +- lib/openpgp/{pkscs1.rb => pkcs1.rb} | 0 4 files changed, 11 insertions(+), 9 deletions(-) rename lib/openpgp/{pkscs1.rb => pkcs1.rb} (100%) diff --git a/lib/openpgp.rb b/lib/openpgp.rb index 373495b..f9efe93 100644 --- a/lib/openpgp.rb +++ b/lib/openpgp.rb @@ -24,8 +24,10 @@ module OpenPGP autoload :Digest, 'openpgp/digest' autoload :Engine, 'openpgp/engine' autoload :Hash, 'openpgp/hash' + autoload :KeyRing, 'openpgp/keyring' autoload :Message, 'openpgp/message' autoload :Packet, 'openpgp/packet' + autoload :PKCS1, 'openpgp/pkcs1' autoload :Random, 'openpgp/random' autoload :S2K, 'openpgp/s2k' autoload :VERSION, 'openpgp/version' diff --git a/lib/openpgp/hash.rb b/lib/openpgp/hash.rb index a630fd5..9165753 100644 --- a/lib/openpgp/hash.rb +++ b/lib/openpgp/hash.rb @@ -23,8 +23,8 @@ class SHA1 < Hash LENGTH = OpenSSL::Digest::SHA1.new.digest.length * 8 def initialize(data) - @hash = OpenSSL::Digest::SHA1.new - super(data) + @hash = OpenSSL::Digest::SHA1.new + super(data) end end @@ -32,8 +32,8 @@ class SHA256 < Hash LENGTH = OpenSSL::Digest::SHA256.new.digest.length * 8 def initialize(data) - @hash = OpenSSL::Digest::SHA256.new - super(data) + @hash = OpenSSL::Digest::SHA256.new + super(data) end end @@ -41,8 +41,8 @@ class SHA384 < Hash LENGTH = OpenSSL::Digest::SHA384.new.digest.length * 8 def initialize(data) - @hash = OpenSSL::Digest::SHA384.new - super(data) + @hash = OpenSSL::Digest::SHA384.new + super(data) end end @@ -50,8 +50,8 @@ class SHA512 < Hash LENGTH = OpenSSL::Digest::SHA512.new.digest.length * 8 def initialize(data) - @hash = OpenSSL::Digest::SHA512.new - super(data) + @hash = OpenSSL::Digest::SHA512.new + super(data) end end diff --git a/lib/openpgp/keyring.rb b/lib/openpgp/keyring.rb index 837108e..401e78d 100644 --- a/lib/openpgp/keyring.rb +++ b/lib/openpgp/keyring.rb @@ -294,4 +294,4 @@ def sign_binary(data, signer_key_id:, timestamp: Time.now.to_i, algo: OpenPGP::C [tag4, sig] end end -end \ No newline at end of file +end diff --git a/lib/openpgp/pkscs1.rb b/lib/openpgp/pkcs1.rb similarity index 100% rename from lib/openpgp/pkscs1.rb rename to lib/openpgp/pkcs1.rb