rbsecp256k1 3.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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'
@@ -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.0'.freeze
4
+ VERSION = '5.0.1'
3
5
  end
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.0
4
+ version: 5.0.1
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-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mini_portile2
@@ -24,20 +24,34 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '2.4'
27
+ - !ruby/object:Gem::Dependency
28
+ name: pkg-config
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.3'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.3'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: rubyzip
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
45
  - - "~>"
32
46
  - !ruby/object:Gem::Version
33
- version: '1.2'
47
+ version: '2.0'
34
48
  type: :runtime
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
52
  - - "~>"
39
53
  - !ruby/object:Gem::Version
40
- version: '1.2'
54
+ version: '2.0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -84,16 +98,16 @@ dependencies:
84
98
  name: rubocop
85
99
  requirement: !ruby/object:Gem::Requirement
86
100
  requirements:
87
- - - "~>"
101
+ - - '='
88
102
  - !ruby/object:Gem::Version
89
- version: '0.61'
103
+ version: '0.78'
90
104
  type: :development
91
105
  prerelease: false
92
106
  version_requirements: !ruby/object:Gem::Requirement
93
107
  requirements:
94
- - - "~>"
108
+ - - '='
95
109
  - !ruby/object:Gem::Version
96
- version: '0.61'
110
+ version: '0.78'
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: yard
99
113
  requirement: !ruby/object:Gem::Requirement
@@ -115,10 +129,22 @@ extensions:
115
129
  - ext/rbsecp256k1/extconf.rb
116
130
  extra_rdoc_files: []
117
131
  files:
132
+ - README.md
118
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
119
144
  - ext/rbsecp256k1/extconf.rb
120
145
  - ext/rbsecp256k1/rbsecp256k1.c
121
146
  - lib/rbsecp256k1.rb
147
+ - lib/rbsecp256k1/context.rb
122
148
  - lib/rbsecp256k1/util.rb
123
149
  - lib/rbsecp256k1/version.rb
124
150
  homepage: https://github.com/etscrivner/rbsecp256k1
@@ -141,10 +167,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
167
  - !ruby/object:Gem::Version
142
168
  version: '0'
143
169
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.7.6
170
+ rubygems_version: 3.0.1
146
171
  signing_key:
147
172
  specification_version: 4
148
- summary: Compiled, native ruby extension interfaces to libsecp256k1. In rbsecp256k1
173
+ summary: Native extension gem for secp256k1 ECDSA. Wraps libsecp256k1. In rbsecp256k1
149
174
  3.0.0 and later libsecp256k1 is bundled with the gem.
150
175
  test_files: []