jodid 0.0.3.pre → 0.0.4.pre
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/lib/jodid/cryptor.rb +5 -3
- data/lib/jodid/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82df1631d8769d3bef7ff7856e9da393a549df8e
|
4
|
+
data.tar.gz: 72658ec9fdf9f1145e42aed50177d4e2dae25448
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0eab9496874fb4693fced13d0215cd66104ae5450a69075e887bb960228f8cec642e7d704682c8a29fefa75d6143540161511d41be7264800e5c8feab3927879
|
7
|
+
data.tar.gz: e952b53e8ea2e9344ba75a964b88ba2c083fcd47609e918b675c7795d167559dd312983feca7753f9cd29a9c62fc84cd3a20839ef290c6b4a602ff87c35481f4
|
data/lib/jodid/cryptor.rb
CHANGED
@@ -37,7 +37,8 @@
|
|
37
37
|
|
38
38
|
def secretbox_open!(ciphertext, encoding = Encoding.default_external)
|
39
39
|
nonce = ciphertext.slice!(0...Crypto::SecretBox::NONCEBYTES)
|
40
|
-
Crypto::SecretBox
|
40
|
+
mac = ciphertext.slice!(0...Crypto::SecretBox::MACBYTES)
|
41
|
+
Crypto::SecretBox.open_detached!(ciphertext, mac, nonce,
|
41
42
|
@curve25519_sk, encoding)
|
42
43
|
end
|
43
44
|
|
@@ -93,12 +94,13 @@
|
|
93
94
|
def box_open!(ciphertext, encoding = Encoding.default_external)
|
94
95
|
public_key = ciphertext.slice!(0...Crypto::Sign::PUBLICKEYBYTES)
|
95
96
|
nonce = ciphertext.slice!(0...Crypto::Box::NONCEBYTES)
|
97
|
+
mac = ciphertext.slice!(0...Crypto::Box::MACBYTES)
|
96
98
|
if (shared_secret = @shared_secrets[public_key])
|
97
|
-
message = Crypto::SecretBox.
|
99
|
+
message = Crypto::SecretBox.open_detached!(ciphertext, mac, nonce,
|
98
100
|
shared_secret, encoding)
|
99
101
|
else
|
100
102
|
pk = Crypto::Sign::Ed25519.pk_to_curve25519(public_key)
|
101
|
-
message = Crypto::Box.
|
103
|
+
message = Crypto::Box.open_detached!(ciphertext, mac, nonce,
|
102
104
|
pk, @curve25519_sk, encoding)
|
103
105
|
@shared_secrets.store(public_key,
|
104
106
|
Crypto::Box.beforenm(pk, @curve25519_sk))
|
data/lib/jodid/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jodid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hendrik Beskow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi-libsodium
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.4.
|
19
|
+
version: 0.4.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: 0.4.
|
26
|
+
version: 0.4.7
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|