rbsecp256k1 3.0.1 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -5
- 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 -56
- data/ext/rbsecp256k1/rbsecp256k1.c +291 -297
- data/lib/rbsecp256k1/context.rb +29 -0
- data/lib/rbsecp256k1/util.rb +2 -0
- data/lib/rbsecp256k1/version.rb +3 -1
- data/lib/rbsecp256k1.rb +3 -0
- metadata +29 -19
@@ -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
data/lib/rbsecp256k1.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.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:
|
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.
|
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.
|
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.
|
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.
|
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: '
|
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: '
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
160
|
-
rubygems_version: 2.7.6
|
170
|
+
rubygems_version: 3.0.1
|
161
171
|
signing_key:
|
162
172
|
specification_version: 4
|
163
|
-
summary:
|
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: []
|