rbsecp256k1 3.0.1 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'securerandom'
4
+
5
+ module Secp256k1
6
+ # Wrapper around a secp256k1_context object.
7
+ class Context
8
+ # Create a new randomized context.
9
+ #
10
+ # @return [Secp256k1::Context] randomized context
11
+ def self.create
12
+ new(context_randomization_bytes: SecureRandom.random_bytes(32))
13
+ end
14
+
15
+ # Create a new non-randomized context.
16
+ #
17
+ # @return [Secp256k1::Context] non-randomized context
18
+ def self.create_unrandomized
19
+ new
20
+ end
21
+
22
+ # Generates a new random key pair.
23
+ #
24
+ # @return [Secp256k1::KeyPair] public-private key pair.
25
+ def generate_key_pair
26
+ key_pair_from_private_key(SecureRandom.random_bytes(32))
27
+ end
28
+ end
29
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Secp256k1
2
4
  # Contains utility methods that complement the functionality of the library.
3
5
  module Util
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Secp256k1
2
- VERSION = '3.0.1'.freeze
4
+ VERSION = '5.1.0'
3
5
  end
data/lib/rbsecp256k1.rb CHANGED
@@ -1,7 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Wraps libsecp256k1 in a ruby module and provides object interfaces.
2
4
  module Secp256k1
3
5
  end
4
6
 
7
+ require 'rbsecp256k1/context'
5
8
  require 'rbsecp256k1/util'
6
9
  require 'rbsecp256k1/version'
7
10
  require 'rbsecp256k1/rbsecp256k1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbsecp256k1
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Scrivner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-04 00:00:00.000000000 Z
11
+ date: 2021-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_portile2
@@ -16,70 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.4'
19
+ version: '2.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.4'
26
+ version: '2.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: pkg-config
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.3'
33
+ version: '1.4'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.3'
40
+ version: '1.4'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rubyzip
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.2'
47
+ version: '2.3'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.2'
54
+ version: '2.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '12.3'
61
+ version: '13.0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '12.3'
68
+ version: '13.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake-compiler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.0'
75
+ version: '1.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.0'
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rspec
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -98,16 +98,16 @@ dependencies:
98
98
  name: rubocop
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: '0.61'
103
+ version: '0.78'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: '0.61'
110
+ version: '0.78'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: yard
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -131,9 +131,20 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - README.md
133
133
  - Rakefile
134
+ - documentation/context.md
135
+ - documentation/index.md
136
+ - documentation/key_pair.md
137
+ - documentation/private_key.md
138
+ - documentation/public_key.md
139
+ - documentation/recoverable_signature.md
140
+ - documentation/secp256k1.md
141
+ - documentation/shared_secret.md
142
+ - documentation/signature.md
143
+ - documentation/util.md
134
144
  - ext/rbsecp256k1/extconf.rb
135
145
  - ext/rbsecp256k1/rbsecp256k1.c
136
146
  - lib/rbsecp256k1.rb
147
+ - lib/rbsecp256k1/context.rb
137
148
  - lib/rbsecp256k1/util.rb
138
149
  - lib/rbsecp256k1/version.rb
139
150
  homepage: https://github.com/etscrivner/rbsecp256k1
@@ -156,10 +167,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
167
  - !ruby/object:Gem::Version
157
168
  version: '0'
158
169
  requirements: []
159
- rubyforge_project:
160
- rubygems_version: 2.7.6
170
+ rubygems_version: 3.0.1
161
171
  signing_key:
162
172
  specification_version: 4
163
- summary: Compiled, native ruby extension interfaces to libsecp256k1. In rbsecp256k1
173
+ summary: Native extension gem for secp256k1 ECDSA. Wraps libsecp256k1. In rbsecp256k1
164
174
  3.0.0 and later libsecp256k1 is bundled with the gem.
165
175
  test_files: []