noise-ruby 0.12.0 → 0.13.0
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/.github/workflows/ruby.yml +2 -3
- data/.rubocop.yml +1 -1
- data/.ruby-version +1 -1
- data/Dockerfile +4 -5
- data/Gemfile +2 -2
- data/README.md +22 -15
- data/lib/noise/connection/base.rb +19 -4
- data/lib/noise/exceptions/message_too_long_error.rb +12 -3
- data/lib/noise/functions/dh/secp256k1.rb +77 -18
- data/lib/noise/state/handshake_state.rb +6 -0
- data/lib/noise/version.rb +1 -1
- data/lib/noise.rb +13 -7
- data/noise.gemspec +7 -8
- metadata +5 -36
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 326691ebec86a68d5b4978756edcd5752c7307e4eba85c615e08262f8133481e
|
|
4
|
+
data.tar.gz: 0626adc9ec4b0821211b04b3573a950684ca526edcd5e956450107d4d8c69ce0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2246a0d4be698a11efb560f6e9ddd70b50a926255c32877d8fd7346780e99e4d2950ac2e10ed81fb787ce9a61f626027e69136e94d680c9959e79c1702c73c47
|
|
7
|
+
data.tar.gz: fe3e968bbb464d11bd574750bdd97410b7ef5564328b327946654f76f8476fae4eadb7fbb8acebf4c4036b4f5edaa2d4a5b265c38705cc2ad33e25f310f78255
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
strategy:
|
|
20
20
|
matrix:
|
|
21
21
|
ruby:
|
|
22
|
-
- '
|
|
22
|
+
- '4.0'
|
|
23
23
|
steps:
|
|
24
24
|
- name: Checkout code
|
|
25
25
|
uses: actions/checkout@v4
|
|
@@ -37,11 +37,10 @@ jobs:
|
|
|
37
37
|
strategy:
|
|
38
38
|
matrix:
|
|
39
39
|
ruby:
|
|
40
|
-
- '3.0'
|
|
41
|
-
- '3.1'
|
|
42
40
|
- '3.2'
|
|
43
41
|
- '3.3'
|
|
44
42
|
- '3.4'
|
|
43
|
+
- '4.0'
|
|
45
44
|
steps:
|
|
46
45
|
- name: Checkout code
|
|
47
46
|
uses: actions/checkout@v4
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4.0.6
|
data/Dockerfile
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
FROM --platform=linux/amd64 ruby:3.3
|
|
1
|
+
# A Linux environment close to the CI runner, for checking a change against the Ruby version CI
|
|
2
|
+
# lints with. Nothing in the suite is architecture specific, so the image builds for the host
|
|
3
|
+
# architecture and needs no emulation.
|
|
4
|
+
FROM ruby:4.0
|
|
6
5
|
|
|
7
6
|
# libsodium: dlopen'd by rbnacl, which lib/noise.rb requires unconditionally.
|
|
8
7
|
# cargo: the blake3 gem is a Rust extension and is built at install time.
|
data/Gemfile
CHANGED
|
@@ -4,6 +4,6 @@ source 'https://rubygems.org'
|
|
|
4
4
|
|
|
5
5
|
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
|
6
6
|
|
|
7
|
-
# Specify your gem's dependencies in noise.gemspec. The optional
|
|
8
|
-
#
|
|
7
|
+
# Specify your gem's dependencies in noise.gemspec. The optional blake3 backend is a development
|
|
8
|
+
# dependency there, so the test suite covers it too.
|
|
9
9
|
gemspec
|
data/README.md
CHANGED
|
@@ -30,6 +30,9 @@ Supported Features:
|
|
|
30
30
|
|
|
31
31
|
## Installation
|
|
32
32
|
|
|
33
|
+
This gem requires Ruby 3.2 or later, and is tested on 3.2, 3.3, 3.4 and 4.0. Ruby 3.0 and 3.1 are
|
|
34
|
+
past end of life and are no longer supported; stay on noise-ruby 0.12.0 or earlier if you need them.
|
|
35
|
+
|
|
33
36
|
This gem needs libsodium library.
|
|
34
37
|
To install libsodium, see https://github.com/jedisct1/libsodium
|
|
35
38
|
|
|
@@ -47,21 +50,6 @@ Or install it yourself as:
|
|
|
47
50
|
|
|
48
51
|
$ gem install noise-ruby
|
|
49
52
|
|
|
50
|
-
If you use Secp256k1, you must install [libsecp256k1](https://github.com/bitcoin-core/secp256k1).
|
|
51
|
-
|
|
52
|
-
$ git clone https://github.com/bitcoin-core/secp256k1
|
|
53
|
-
$ cd secp256k1
|
|
54
|
-
$ ./autogen.sh
|
|
55
|
-
$ ./configure --enable-module-recovery --enable-experimental --enable-module-ecdh
|
|
56
|
-
$ make
|
|
57
|
-
$ sudo make install
|
|
58
|
-
|
|
59
|
-
and, add this line to your Gemfile:
|
|
60
|
-
|
|
61
|
-
```
|
|
62
|
-
gem 'secp256k1-ruby'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
53
|
If you use BLAKE3, you must install [Rust and Cargo](https://www.rust-lang.org/tools/install).
|
|
66
54
|
And add this line to your Gemfile:
|
|
67
55
|
|
|
@@ -75,6 +63,25 @@ Followings shows handshake protocol with "Noise_NN_25519_ChaChaPoly_BLAKE2b"
|
|
|
75
63
|
|
|
76
64
|
### Handshake
|
|
77
65
|
|
|
66
|
+
#### Supplying keys
|
|
67
|
+
|
|
68
|
+
Patterns other than `NN` need keys before the handshake starts. `Connection::Initiator.new` and
|
|
69
|
+
`Connection::Responder.new` take them in the `keypairs:` hash: `:s` is the local static private key,
|
|
70
|
+
`:rs` and `:re` are the remote party's static and ephemeral public keys.
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
initiator = Noise::Connection::Initiator.new("Noise_XX_25519_ChaChaPoly_SHA256", keypairs: { s: static_private_key })
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
`keypairs:` also accepts `:e`, the local ephemeral private key. **It exists only so that
|
|
77
|
+
`spec/vectors_spec.rb` can reproduce the official test vectors, which fix both sides' ephemeral keys
|
|
78
|
+
to make the output deterministic. Never set it in production.** A connection created with `:e` reuses
|
|
79
|
+
that ephemeral keypair instead of generating a fresh one per handshake, which destroys the forward
|
|
80
|
+
secrecy every pattern depends on: an attacker who recovers the key can decrypt every session that
|
|
81
|
+
used it, past and future. Nothing fails and no warning is printed - the handshake still succeeds and
|
|
82
|
+
your own tests still pass - so the loss is invisible. Leave `:e` unset and let the library generate
|
|
83
|
+
it.
|
|
84
|
+
|
|
78
85
|
#### initiator
|
|
79
86
|
|
|
80
87
|
```
|
|
@@ -13,6 +13,16 @@ module Noise
|
|
|
13
13
|
:cipher_state_encrypt, :cipher_state_decrypt, :cipher_state_handshake, :s, :rs
|
|
14
14
|
attr_accessor :psks, :prologue
|
|
15
15
|
|
|
16
|
+
# @param [String] name the protocol name, for example 'Noise_XX_25519_ChaChaPoly_SHA256'.
|
|
17
|
+
# @param [Hash] keypairs the keys the pattern needs, as private or public key strings.
|
|
18
|
+
# :s is the local static private key, :rs and :re the remote static and ephemeral public keys.
|
|
19
|
+
#
|
|
20
|
+
# :e sets the local ephemeral private key. It exists only so that spec/vectors_spec.rb can
|
|
21
|
+
# reproduce the official test vectors, which fix both sides' ephemeral keys to make the
|
|
22
|
+
# output deterministic. Never set it outside that use: HandshakeState#write_message reuses
|
|
23
|
+
# the keypair given here instead of generating a fresh one, and an ephemeral key reused
|
|
24
|
+
# across handshakes gives up the forward secrecy every pattern depends on. The handshake
|
|
25
|
+
# still succeeds, so nothing reports the loss.
|
|
16
26
|
def initialize(name, keypairs: { s: nil, e: nil, rs: nil, re: nil })
|
|
17
27
|
@protocol = Protocol.create(name)
|
|
18
28
|
|
|
@@ -64,8 +74,10 @@ module Noise
|
|
|
64
74
|
raise Noise::Exceptions::NoiseHandshakeError if @next_message != :write
|
|
65
75
|
raise Noise::Exceptions::NoiseHandshakeError if @handshake_finished
|
|
66
76
|
|
|
67
|
-
|
|
68
|
-
|
|
77
|
+
length = @handshake_state.expected_message_length(payload.bytesize)
|
|
78
|
+
if length > MAX_MESSAGE_LENGTH
|
|
79
|
+
raise Noise::Exceptions::MessageTooLongError,
|
|
80
|
+
"Message would be #{length} bytes, which exceeds the maximum of #{MAX_MESSAGE_LENGTH}."
|
|
69
81
|
end
|
|
70
82
|
|
|
71
83
|
@next_message = :read
|
|
@@ -79,8 +91,11 @@ module Noise
|
|
|
79
91
|
raise Noise::Exceptions::NoiseHandshakeError unless @handshake_started
|
|
80
92
|
raise Noise::Exceptions::NoiseHandshakeError if @next_message != :read
|
|
81
93
|
raise Noise::Exceptions::NoiseHandshakeError if @handshake_finished
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
|
|
95
|
+
if data.bytesize > MAX_MESSAGE_LENGTH
|
|
96
|
+
raise Noise::Exceptions::MessageTooLongError,
|
|
97
|
+
"Message is #{data.bytesize} bytes, which exceeds the maximum of #{MAX_MESSAGE_LENGTH}."
|
|
98
|
+
end
|
|
84
99
|
|
|
85
100
|
@next_message = :write
|
|
86
101
|
buffer = +''
|
|
@@ -2,9 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
module Noise
|
|
4
4
|
module Exceptions
|
|
5
|
-
# Raised when a
|
|
6
|
-
# specification places on every message.
|
|
7
|
-
#
|
|
5
|
+
# Raised when a message would exceed, or does exceed, the 65535 byte limit the Noise
|
|
6
|
+
# specification places on every message. Raised from the handshake and the transport paths
|
|
7
|
+
# alike, so that a caller handling "the peer sent something too long" rescues one class rather
|
|
8
|
+
# than one per phase.
|
|
9
|
+
#
|
|
10
|
+
# It covers over-long messages only, and the other framing errors keep their own classes: a
|
|
11
|
+
# truncated handshake message raises NoiseHandshakeError, and a transport message shorter than
|
|
12
|
+
# the authentication tag raises DecryptError. A caller that treats every framing error alike
|
|
13
|
+
# has to rescue all three.
|
|
14
|
+
#
|
|
15
|
+
# Kept apart from DecryptError so that a badly framed message can be told from a failed
|
|
16
|
+
# authentication, which has very different security meaning.
|
|
8
17
|
class MessageTooLongError < StandardError
|
|
9
18
|
end
|
|
10
19
|
end
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
Noise.require_optional 'secp256k1'
|
|
4
|
-
|
|
5
3
|
module Noise
|
|
6
4
|
module Functions
|
|
7
5
|
module DH
|
|
6
|
+
# The secp256k1 DH function, as the Lightning Network uses it in BOLT #8.
|
|
7
|
+
#
|
|
8
|
+
# The shared secret is SHA256 of the shared point in compressed form, not the raw X
|
|
9
|
+
# coordinate. That is what BOLT #8 specifies and what libsecp256k1's ecdh returned when this
|
|
10
|
+
# function was backed by that library, so the value on the wire is unchanged.
|
|
8
11
|
class Secp256k1
|
|
9
|
-
# Length of a compressed secp256k1 point.
|
|
10
|
-
#
|
|
12
|
+
# Length of a compressed secp256k1 point. The 65-byte uncompressed form encodes the same
|
|
13
|
+
# point, but Noise exchanges only the compressed one, so it is rejected.
|
|
11
14
|
DHLEN = 33
|
|
12
15
|
|
|
16
|
+
# Length of a secp256k1 scalar, which is what a private key is.
|
|
17
|
+
PRIVATE_KEY_LEN = 32
|
|
18
|
+
|
|
19
|
+
# The name OpenSSL knows the curve by.
|
|
20
|
+
CURVE = 'secp256k1'
|
|
21
|
+
|
|
22
|
+
# Builds the curve group once, because dh needs it on every call.
|
|
23
|
+
#
|
|
24
|
+
# secp256k1 is a builtin curve of OpenSSL 3, but an OpenSSL restricted to a FIPS provider
|
|
25
|
+
# does not offer it. That leaves the function unusable in the same way a missing system
|
|
26
|
+
# library did, so it is reported as MissingDependencyError rather than as an OpenSSL error
|
|
27
|
+
# raised in the middle of a handshake.
|
|
13
28
|
def initialize
|
|
14
|
-
|
|
29
|
+
@group = OpenSSL::PKey::EC::Group.new(CURVE)
|
|
30
|
+
rescue OpenSSL::PKey::EC::Group::Error => e
|
|
31
|
+
raise Noise::Exceptions::MissingDependencyError,
|
|
32
|
+
"OpenSSL does not offer the #{CURVE} curve: #{e.message}"
|
|
15
33
|
end
|
|
16
34
|
|
|
17
35
|
def generate_keypair
|
|
@@ -19,25 +37,29 @@ module Noise
|
|
|
19
37
|
private_key = 1 + SecureRandom.random_number(group.order - 1)
|
|
20
38
|
public_key = group.generator.multiply_by_scalar(private_key)
|
|
21
39
|
Noise::Key.new(
|
|
22
|
-
ECDSA::Format::IntegerOctetString.encode(private_key,
|
|
40
|
+
ECDSA::Format::IntegerOctetString.encode(private_key, PRIVATE_KEY_LEN),
|
|
23
41
|
ECDSA::Format::PointOctetString.encode(public_key, compression: true)
|
|
24
42
|
)
|
|
25
43
|
end
|
|
26
44
|
|
|
27
45
|
# Computes the ECDH shared secret for the given remote public key.
|
|
28
46
|
#
|
|
29
|
-
#
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
#
|
|
33
|
-
# ArgumentError raised for a malformed private key keeps propagating as itself.
|
|
47
|
+
# Every way a peer-supplied key can be unusable raises InvalidPublicKeyError, matching the
|
|
48
|
+
# other DH functions: a length other than DHLEN, and an encoding that names no point on the
|
|
49
|
+
# curve. A private key the caller owns is not the peer's fault, so a malformed one raises
|
|
50
|
+
# ArgumentError instead, as it did when the gem parsed it.
|
|
34
51
|
def dh(private_key, public_key)
|
|
35
52
|
raise Noise::Exceptions::InvalidPublicKeyError, public_key unless public_key.bytesize == DHLEN
|
|
36
53
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
scalar = OpenSSL::BN.new(self.class.decode_private_key(private_key))
|
|
55
|
+
shared = parse_public_key(public_key).mul(scalar)
|
|
56
|
+
# A backstop rather than a reachable case: secp256k1 has cofactor 1, so a point that
|
|
57
|
+
# parsed has order n, and the scalar is already known to be in [1, n-1]. It stays because
|
|
58
|
+
# the cost is one comparison and the failure it guards is severe - the compressed
|
|
59
|
+
# encoding of infinity is the single byte 0x00, whose SHA256 anyone can precompute.
|
|
60
|
+
raise Noise::Exceptions::InvalidPublicKeyError, public_key if shared.infinity?
|
|
61
|
+
|
|
62
|
+
OpenSSL::Digest.digest('SHA256', shared.to_octet_string(:compressed))
|
|
41
63
|
end
|
|
42
64
|
|
|
43
65
|
def dhlen
|
|
@@ -45,11 +67,48 @@ module Noise
|
|
|
45
67
|
end
|
|
46
68
|
|
|
47
69
|
def self.from_private(private_key)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
point = group.generator.multiply_by_scalar(scalar)
|
|
70
|
+
scalar = decode_private_key(private_key)
|
|
71
|
+
point = ECDSA::Group::Secp256k1.generator.multiply_by_scalar(scalar)
|
|
51
72
|
Noise::Key.new(private_key, ECDSA::Format::PointOctetString.encode(point, compression: true))
|
|
52
73
|
end
|
|
74
|
+
|
|
75
|
+
# Decodes a private key into the scalar it denotes, rejecting the values that cannot serve
|
|
76
|
+
# as one. Both entry points that take a private key go through this, so a key from_private
|
|
77
|
+
# accepts is one dh can use.
|
|
78
|
+
#
|
|
79
|
+
# Rejected are a length other than PRIVATE_KEY_LEN, zero, and anything at or above the
|
|
80
|
+
# group order: those scalars multiply every point to infinity, whose compressed encoding is
|
|
81
|
+
# the single byte 0x00. Without the check from_private would hand back a Noise::Key holding
|
|
82
|
+
# that one byte as its public key, and the handshake it is used in would fail only once the
|
|
83
|
+
# key reached the wire. A private key belongs to the caller rather than to the peer, so a
|
|
84
|
+
# bad one raises ArgumentError and not InvalidPublicKeyError.
|
|
85
|
+
def self.decode_private_key(private_key)
|
|
86
|
+
unless private_key.bytesize == PRIVATE_KEY_LEN
|
|
87
|
+
raise ArgumentError, "private key must be #{PRIVATE_KEY_LEN} bytes"
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
scalar = ECDSA::Format::IntegerOctetString.decode(private_key)
|
|
91
|
+
order = ECDSA::Group::Secp256k1.order
|
|
92
|
+
raise ArgumentError, 'private key is out of range' unless scalar.between?(1, order - 1)
|
|
93
|
+
|
|
94
|
+
scalar
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
private
|
|
98
|
+
|
|
99
|
+
# Decodes a public key into a point on the curve.
|
|
100
|
+
#
|
|
101
|
+
# The key is passed as a String, not as an OpenSSL::BN. OpenSSL then decodes it as an octet
|
|
102
|
+
# string and raises Point::Error for anything that is not a point on the curve, the
|
|
103
|
+
# all-zero key included: 0x00 introduces the encoding of infinity, which is one byte long,
|
|
104
|
+
# so 33 zero bytes are rejected as a malformed encoding. Handing over a BN instead would
|
|
105
|
+
# drop the leading zero byte and produce the point at infinity, whose shared secret is a
|
|
106
|
+
# constant that the sender of such a key could precompute.
|
|
107
|
+
def parse_public_key(public_key)
|
|
108
|
+
OpenSSL::PKey::EC::Point.new(@group, public_key)
|
|
109
|
+
rescue OpenSSL::PKey::EC::Point::Error
|
|
110
|
+
raise Noise::Exceptions::InvalidPublicKeyError, public_key
|
|
111
|
+
end
|
|
53
112
|
end
|
|
54
113
|
end
|
|
55
114
|
end
|
|
@@ -107,6 +107,12 @@ module Noise
|
|
|
107
107
|
pattern.each do |token|
|
|
108
108
|
case token
|
|
109
109
|
when Noise::Token::E
|
|
110
|
+
# A fresh keypair per handshake is what the pattern's forward secrecy rests on. Two
|
|
111
|
+
# things preset @e. Connection::Base#fallback carries the ephemeral of the aborted
|
|
112
|
+
# handshake into the new state, which the fallback patterns require: process_fallback
|
|
113
|
+
# mixes its public key as a pre-message. A caller passing keypairs[:e] to
|
|
114
|
+
# Connection::Base#initialize also presets it, and that is supported for reproducing
|
|
115
|
+
# the official test vectors and nothing else.
|
|
110
116
|
@e ||= @protocol.dh_fn.generate_keypair
|
|
111
117
|
message_buffer << @e.public_key
|
|
112
118
|
mix_e(@e.public_key)
|
data/lib/noise/version.rb
CHANGED
data/lib/noise.rb
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
require 'noise/version'
|
|
4
4
|
|
|
5
5
|
require 'ecdsa'
|
|
6
|
-
require 'logger'
|
|
7
6
|
require 'openssl'
|
|
8
7
|
require 'rbnacl'
|
|
9
8
|
require 'ruby_hmac'
|
|
@@ -27,18 +26,25 @@ module Noise
|
|
|
27
26
|
@unavailable_dependencies = {}
|
|
28
27
|
|
|
29
28
|
class << self
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
# Requires an optional backend gem and yields once it is loaded. A LoadError is not fatal:
|
|
30
|
+
# the reason is recorded so optional_dependency! can raise it later, and a warning goes to
|
|
31
|
+
# $stderr so the missing backend is visible at load time. Kernel#warn is used rather than a
|
|
32
|
+
# Logger because logger is no longer a default gem on Ruby 4.0, and this single message does
|
|
33
|
+
# not justify a runtime dependency on it.
|
|
34
34
|
def require_optional(name)
|
|
35
35
|
require name
|
|
36
|
-
yield if block_given?
|
|
37
36
|
rescue LoadError => e
|
|
38
37
|
@unavailable_dependencies[name] = e.message
|
|
39
|
-
|
|
38
|
+
warn("Optional dependency '#{name}' is unavailable: #{e.message}")
|
|
39
|
+
else
|
|
40
|
+
# The block runs outside the rescue on purpose: a LoadError raised by the block itself is
|
|
41
|
+
# about something other than this dependency, and swallowing it here would hide the cause.
|
|
42
|
+
yield if block_given?
|
|
40
43
|
end
|
|
41
44
|
|
|
45
|
+
# Raises MissingDependencyError if the named optional backend failed to load earlier. Call it
|
|
46
|
+
# from the entry point of a function that needs the backend, so the failure surfaces where the
|
|
47
|
+
# backend is used rather than at require time.
|
|
42
48
|
def optional_dependency!(name)
|
|
43
49
|
reason = @unavailable_dependencies[name]
|
|
44
50
|
return if reason.nil?
|
data/noise.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ require 'noise/version'
|
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'noise-ruby'
|
|
9
|
-
spec.required_ruby_version = '
|
|
9
|
+
spec.required_ruby_version = '>= 3.2'
|
|
10
10
|
spec.version = Noise::VERSION
|
|
11
11
|
spec.authors = ['Hajime Yamaguchi']
|
|
12
12
|
spec.email = ['gen.yamaguchi0@gmail.com']
|
|
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
|
|
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
23
23
|
spec.require_paths = ['lib']
|
|
24
24
|
|
|
25
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
26
25
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
|
27
26
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
28
27
|
|
|
@@ -31,16 +30,16 @@ Gem::Specification.new do |spec|
|
|
|
31
30
|
spec.add_development_dependency 'simplecov'
|
|
32
31
|
spec.add_development_dependency 'simplecov-json'
|
|
33
32
|
|
|
34
|
-
# Optional
|
|
35
|
-
#
|
|
36
|
-
#
|
|
33
|
+
# Optional backend. BLAKE3 is needed only when it appears in a protocol name, and it needs Rust
|
|
34
|
+
# to build, so it is not a runtime dependency. Add it to your own Gemfile if you need it; see the
|
|
35
|
+
# README.
|
|
37
36
|
spec.add_development_dependency 'blake3'
|
|
38
|
-
spec.add_development_dependency 'secp256k1-ruby'
|
|
39
37
|
|
|
40
38
|
spec.add_runtime_dependency 'ecdsa'
|
|
41
39
|
# The 448 DH function needs the raw key API (OpenSSL::PKey.new_raw_private_key and friends),
|
|
42
|
-
# which arrived in openssl 3.0.
|
|
43
|
-
#
|
|
40
|
+
# which arrived in openssl 3.0. Every supported interpreter bundles a newer default gem, but the
|
|
41
|
+
# floor is stated so an older openssl pinned in an application's Gemfile fails to resolve rather
|
|
42
|
+
# than failing at runtime.
|
|
44
43
|
spec.add_runtime_dependency 'openssl', '>= 3.0'
|
|
45
44
|
spec.add_runtime_dependency 'rbnacl'
|
|
46
45
|
spec.add_runtime_dependency 'ruby-hmac'
|
metadata
CHANGED
|
@@ -1,29 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: noise-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Hajime Yamaguchi
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
|
-
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: bundler
|
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
|
16
|
-
requirements:
|
|
17
|
-
- - "~>"
|
|
18
|
-
- !ruby/object:Gem::Version
|
|
19
|
-
version: '2.0'
|
|
20
|
-
type: :development
|
|
21
|
-
prerelease: false
|
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
-
requirements:
|
|
24
|
-
- - "~>"
|
|
25
|
-
- !ruby/object:Gem::Version
|
|
26
|
-
version: '2.0'
|
|
27
12
|
- !ruby/object:Gem::Dependency
|
|
28
13
|
name: rake
|
|
29
14
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,20 +107,6 @@ dependencies:
|
|
|
122
107
|
- - ">="
|
|
123
108
|
- !ruby/object:Gem::Version
|
|
124
109
|
version: '0'
|
|
125
|
-
- !ruby/object:Gem::Dependency
|
|
126
|
-
name: secp256k1-ruby
|
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - ">="
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '0'
|
|
132
|
-
type: :development
|
|
133
|
-
prerelease: false
|
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - ">="
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '0'
|
|
139
110
|
- !ruby/object:Gem::Dependency
|
|
140
111
|
name: ecdsa
|
|
141
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -259,23 +230,21 @@ files:
|
|
|
259
230
|
homepage: https://github.com/Yamaguchi/noise
|
|
260
231
|
licenses: []
|
|
261
232
|
metadata: {}
|
|
262
|
-
post_install_message:
|
|
263
233
|
rdoc_options: []
|
|
264
234
|
require_paths:
|
|
265
235
|
- lib
|
|
266
236
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
267
237
|
requirements:
|
|
268
|
-
- - "
|
|
238
|
+
- - ">="
|
|
269
239
|
- !ruby/object:Gem::Version
|
|
270
|
-
version: '3.
|
|
240
|
+
version: '3.2'
|
|
271
241
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
242
|
requirements:
|
|
273
243
|
- - ">="
|
|
274
244
|
- !ruby/object:Gem::Version
|
|
275
245
|
version: '0'
|
|
276
246
|
requirements: []
|
|
277
|
-
rubygems_version:
|
|
278
|
-
signing_key:
|
|
247
|
+
rubygems_version: 4.0.16
|
|
279
248
|
specification_version: 4
|
|
280
249
|
summary: A Ruby implementation of the Noise Protocol framework
|
|
281
250
|
test_files: []
|