Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
jshawl committed Feb 7, 2024
1 parent 6f9119c commit 713a414
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/minisign/private_key.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PrivateKey
def initialize(str, password = nil)
contents = str.split("\n")
decoded = Base64.decode64(contents.last)
@untrusted_comment = contents.first.split("untrusted comment: ").last
@untrusted_comment = contents.first.split('untrusted comment: ').last
bytes = decoded.bytes
@signature_algorithm, @kdf_algorithm, @cksum_algorithm =
[bytes[0..1], bytes[2..3], bytes[4..5]].map { |a| a.pack('U*') }
Expand All @@ -28,7 +28,7 @@ def initialize(str, password = nil)
@kdf_salt = bytes[6..37]
@kdf_opslimit = bytes[38..45].pack('V*').unpack('N*').sum
@kdf_memlimit = bytes[46..53].pack('V*').unpack('N*').sum
@keynum_sk = bytes[54..157].pack("C*")
@keynum_sk = bytes[54..157].pack('C*')
@key_data_bytes = if password
kdf_output = derive_key(password, @kdf_salt, @kdf_opslimit, @kdf_memlimit)
xor(kdf_output, bytes[54..157])
Expand Down
2 changes: 1 addition & 1 deletion spec/minisign/private_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
end

it 'can be written to a file' do
expect(@private_key.to_s).to eq(File.read("test/minisign.key"))
expect(@private_key.to_s).to eq(File.read('test/minisign.key'))
end
end

Expand Down

0 comments on commit 713a414

Please sign in to comment.