bitcoin-secp256k1 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/secp256k1/c.rb +4 -0
- data/lib/secp256k1/key.rb +1 -5
- data/lib/secp256k1/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6035dfb23c9b97f481f98bf2bdee8aa281776cb0
|
4
|
+
data.tar.gz: 31d82871124f52d7f3e8cbbd21ff35756ffca425
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab2b773ca043cfb475f83f46b7e81496ec6c9c582408ea598a4da3ef9a14d090758680f3e78ea048a5d25250fd866f25424279e94052cb081cbd45f1e784280
|
7
|
+
data.tar.gz: 3ac36d282caf5d578121f209fdfd2937483bdbc7126c74bdedea1cd955610724ef1554231378aef4f7ec9a5e43c92dcd3e46f0d930f1c4725bae67773fbe1990
|
data/Gemfile.lock
CHANGED
data/lib/secp256k1/c.rb
CHANGED
@@ -34,6 +34,9 @@ module Secp256k1
|
|
34
34
|
# secp256k1_context* secp256k1_context_create(unsigned int flags)
|
35
35
|
attach_function :secp256k1_context_create, [:uint], :pointer
|
36
36
|
|
37
|
+
# void secp256k1_context_destroy(secp256k1_context* ctx)
|
38
|
+
attach_function :secp256k1_context_destroy, [:pointer], :void
|
39
|
+
|
37
40
|
# int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pubkey, const unsigned char *input, size_t inputlen)
|
38
41
|
attach_function :secp256k1_ec_pubkey_parse, [:pointer, :pointer, :pointer, :size_t], :int
|
39
42
|
|
@@ -81,5 +84,6 @@ module Secp256k1
|
|
81
84
|
|
82
85
|
# int secp256k1_ecdsa_recoverable_signature_convert(const secp256k1_context *ctx, secp256k1_ecdsa_signature *sig, const secp256k1_ecdsa_recoverable_signature *sigin)
|
83
86
|
attach_function :secp256k1_ecdsa_recoverable_signature_convert, [:pointer, :pointer, :pointer], :int
|
87
|
+
|
84
88
|
end
|
85
89
|
end
|
data/lib/secp256k1/key.rb
CHANGED
@@ -10,16 +10,12 @@ module Secp256k1
|
|
10
10
|
|
11
11
|
unless ctx
|
12
12
|
raise ArgumentError, "invalid flags" unless [NO_FLAGS, FLAG_SIGN, FLAG_VERIFY, ALL_FLAGS].include?(flags)
|
13
|
-
ctx = C.secp256k1_context_create
|
13
|
+
ctx = FFI::AutoPointer.new C.secp256k1_context_create(flags), C.method(:secp256k1_context_destroy)
|
14
14
|
@destroy = true
|
15
15
|
end
|
16
16
|
|
17
17
|
@flags = flags
|
18
18
|
@ctx = ctx
|
19
|
-
|
20
|
-
ObjectSpace.define_finalizer(self) do |id|
|
21
|
-
C.secp256k1_context_destroy @ctx if @destroy
|
22
|
-
end
|
23
19
|
end
|
24
20
|
end
|
25
21
|
|
data/lib/secp256k1/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bitcoin-secp256k1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Xie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|