Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eth.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |spec|
spec.require_paths = ["lib"]
spec.test_files = spec.files.grep %r{^(test|spec|features)/}

spec.add_dependency 'keccak', '~> 1.3'
spec.add_dependency 'keccak256'
spec.add_dependency 'ffi', '~> 1.15'
spec.add_dependency 'money-tree', '~> 0.10'
spec.add_dependency 'rlp', '~> 0.7'
Expand Down
2 changes: 1 addition & 1 deletion lib/eth.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require 'digest/keccak'
require 'keccak256'
require 'ffi'
require 'money-tree'
require 'rlp'
Expand Down
4 changes: 2 additions & 2 deletions lib/eth/open_ssl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class OpenSsl
extend FFI::Library

if FFI::Platform.windows?
ffi_lib 'libeay32', 'ssleay32'
ffi_lib 'libeay32', 'libssl-1_1-x64'
else
ffi_lib [
'libssl.so.1.1.0', 'libssl.so.1.1',
'libssl.so.1.0.0', 'libssl.so.10',
'ssl'
'ssl'
]
end

Expand Down
5 changes: 3 additions & 2 deletions lib/eth/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ def sha256(x)
end

def keccak256(x)
Digest::Keccak.new(256).digest(x)
Digest::Keccak256.new.hexdigest(x)
end

def keccak512(x)
Digest::Keccak.new(512).digest(x)
puts "keccak512 is broken in this version"
#Digest::Keccak.new(512).digest(x)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to switch the keccak gem?

end

def keccak256_rlp(x)
Expand Down