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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08192fde458a54d683343aea5759667db9ccb7bc
4
- data.tar.gz: b590fb877d2c580e1866a8ec48a5426ce5bdf5c7
3
+ metadata.gz: 82df1631d8769d3bef7ff7856e9da393a549df8e
4
+ data.tar.gz: 72658ec9fdf9f1145e42aed50177d4e2dae25448
5
5
  SHA512:
6
- metadata.gz: cfbccc6504f8e48bc970424641c15bd83e517f4757aed753d9bf4ded12cbcca69b865ff9901fde32386cdfcdc39485fed811e67b00d4033aaf44bfeed5d936d1
7
- data.tar.gz: 0e20db7e42d7c0acf5c2c427ad4f21f6f076ad0b59251564be7e6d1c6155a92755b19e1176735abd80ce295310e9ed2866a6d725a7a5e58845e738f33ec6666f
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.open!(ciphertext, nonce,
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.open!(ciphertext, nonce,
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.open!(ciphertext, nonce,
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
@@ -1,3 +1,3 @@
1
1
  module Jodid
2
- VERSION = Gem::Version.new('0.0.3.pre')
2
+ VERSION = Gem::Version.new('0.0.4.pre')
3
3
  end
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.3.pre
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-01 00:00:00.000000000 Z
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.5
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.5
26
+ version: 0.4.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement