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.
- checksums.yaml +4 -4
- data/README.md +157 -0
- data/Rakefile +2 -0
- data/documentation/context.md +81 -0
- data/documentation/index.md +319 -0
- data/documentation/key_pair.md +28 -0
- data/documentation/private_key.md +25 -0
- data/documentation/public_key.md +32 -0
- data/documentation/recoverable_signature.md +30 -0
- data/documentation/secp256k1.md +19 -0
- data/documentation/shared_secret.md +16 -0
- data/documentation/signature.md +42 -0
- data/documentation/util.md +17 -0
- data/ext/rbsecp256k1/extconf.rb +11 -8
- data/ext/rbsecp256k1/rbsecp256k1.c +291 -297
- data/lib/rbsecp256k1.rb +3 -0
- data/lib/rbsecp256k1/context.rb +29 -0
- data/lib/rbsecp256k1/util.rb +2 -0
- data/lib/rbsecp256k1/version.rb +3 -1
- metadata +36 -11
data/lib/rbsecp256k1.rb
CHANGED
@@ -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
|
data/lib/rbsecp256k1/util.rb
CHANGED
data/lib/rbsecp256k1/version.rb
CHANGED
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:
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
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
|
-
|
145
|
-
rubygems_version: 2.7.6
|
170
|
+
rubygems_version: 3.0.1
|
146
171
|
signing_key:
|
147
172
|
specification_version: 4
|
148
|
-
summary:
|
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: []
|