lib/tapyrus/secp256k1/native.rb in tapyrus-0.2.3 vs lib/tapyrus/secp256k1/native.rb in tapyrus-0.2.4

- old
+ new

@@ -2,12 +2,12 @@ # https://github.com/lian/bitcoin-ruby/blob/master/COPYING module Tapyrus module Secp256k1 - # binding for secp256k1 (https://github.com/bitcoin/bitcoin/tree/v0.14.2/src/secp256k1) - # tag: v0.14.2 + # binding for secp256k1 (https://github.com/chaintope/tapyrus-core/tree/v0.4.0/src/secp256k1) + # tag: v0.4.0 # this is not included by default, to enable set shared object path to ENV['SECP256K1_LIB_PATH'] # for linux, ENV['SECP256K1_LIB_PATH'] = '/usr/local/lib/libsecp256k1.so' # for mac, module Native include ::FFI::Library @@ -195,10 +195,10 @@ raise 'priv_key invalid' unless secp256k1_ec_seckey_verify(context, secret) signature = FFI::MemoryPointer.new(:uchar, 64) msg32 = FFI::MemoryPointer.new(:uchar, 32).put_bytes(0, data) raise 'Failed to generate schnorr signature.' unless secp256k1_schnorr_sign(context, signature, msg32, secret, nil, nil) == 1 - signature.read_string + signature.read_string(64) end end def verify_ecdsa(data, sig, pub_key) with_context do |context|