ffi-libsodium 0.0.4 → 0.0.5

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: 01cf5df0b9bcbcc100cc7acedb2a11b7f5a91b2c
4
- data.tar.gz: 7fda27dfaaed7e2f538e82d234ddfc254c5b25d5
3
+ metadata.gz: e3e68050c2be22e883d5a4b8d33e506716eb4832
4
+ data.tar.gz: 1b0db0b2e8deba32fe9d50b2541ec33dc4555d47
5
5
  SHA512:
6
- metadata.gz: d2fe21f487536468f00fde101b3a595c7f671a3f9a2854890db9eb046e40dca5f5bea4db7f7beaecfcdaad8299e31a021c151442dbca0ec86d4d0f32230db15c
7
- data.tar.gz: 0ba70b4e2983a644878bc186d16c0084c5195a40887de0efe1a66956f4a9b6471d0e336e5536d87e1731fea619e724a13cd71e1de035aec61c488af5f1bdee66
6
+ metadata.gz: 665970302f6c60c038d6c101976ac89609fb18c34c2c8527f18a7450f36c6368b31568aa526add077c02fb489025c8c0a665288e784593a6099ada95eb8f4a37
7
+ data.tar.gz: 3f952d79deca01a35f021c311d9c148192c058d486e5cd2dc7c4aa98e174831d1130028cec4610beebf33a2db2e17450864d95f5a0010849bd9aa5b9ad73d494
data/lib/crypto/box.rb CHANGED
@@ -80,7 +80,7 @@ module Crypto
80
80
  [public_key, secret_key]
81
81
  end
82
82
 
83
- def easy(message, nonce, public_key, secret_key)
83
+ def box(message, nonce, public_key, secret_key)
84
84
  message_len = get_size(message)
85
85
  check_length(nonce, NONCEBYTES, :Nonce)
86
86
  check_length(public_key, PUBLICKEYBYTES, :PublicKey)
@@ -94,11 +94,7 @@ module Crypto
94
94
  ciphertext
95
95
  end
96
96
 
97
- def box(*args)
98
- easy(*args)
99
- end
100
-
101
- def open_easy(ciphertext, nonce, public_key, secret_key)
97
+ def open(ciphertext, nonce, public_key, secret_key)
102
98
  ciphertext_len = get_size(ciphertext)
103
99
  check_length(nonce, NONCEBYTES, :Nonce)
104
100
  check_length(public_key, PUBLICKEYBYTES, :PublicKey)
@@ -115,10 +111,6 @@ module Crypto
115
111
  decrypted
116
112
  end
117
113
 
118
- def open(*args)
119
- open_easy(*args)
120
- end
121
-
122
114
  def easy_in_place(data, nonce, public_key, secret_key)
123
115
  message = get_string(data)
124
116
  check_length(nonce, NONCEBYTES, :Nonce)
@@ -161,7 +153,9 @@ module Crypto
161
153
  end
162
154
  end
163
155
 
164
- def self.box(*args)
165
- Box.easy(*args)
156
+ module_function
157
+
158
+ def box(*args)
159
+ Box.box(*args)
166
160
  end
167
161
  end
@@ -117,7 +117,9 @@ module Crypto
117
117
  end
118
118
  end
119
119
 
120
- def self.generichash(*args)
120
+ module_function
121
+
122
+ def generichash(*args)
121
123
  GenericHash.generichash(*args)
122
124
  end
123
125
  end
@@ -81,7 +81,9 @@ module Crypto
81
81
  end
82
82
  end
83
83
 
84
- def self.onetimeauth(*args)
84
+ module_function
85
+
86
+ def onetimeauth(*args)
85
87
  OneTimeAuth.onetimeauth(*args)
86
88
  end
87
89
  end
@@ -94,7 +94,9 @@ module Crypto
94
94
  end
95
95
  end
96
96
 
97
- def self.scryptsalsa208sha256(*args)
97
+ module_function
98
+
99
+ def scryptsalsa208sha256(*args)
98
100
  ScryptSalsa208SHA256.scryptsalsa208sha256(*args)
99
101
  end
100
102
  end
@@ -49,7 +49,9 @@ module Crypto
49
49
  end
50
50
  end
51
51
 
52
- def self.scalarmut(*args)
52
+ module_function
53
+
54
+ def scalarmut(*args)
53
55
  ScalarMult.scalarmut(*args)
54
56
  end
55
57
  end
@@ -30,7 +30,7 @@ module Crypto
30
30
  RandomBytes.buf(NONCEBYTES)
31
31
  end
32
32
 
33
- def easy(message, nonce, key)
33
+ def secretbox(message, nonce, key)
34
34
  message_len = get_size(message)
35
35
  check_length(nonce, NONCEBYTES, :Nonce)
36
36
  check_length(key, KEYBYTES, :SecretKey)
@@ -43,7 +43,7 @@ module Crypto
43
43
  ciphertext
44
44
  end
45
45
 
46
- def open_easy(ciphertext, nonce, key)
46
+ def open(ciphertext, nonce, key)
47
47
  ciphertext_len = get_size(ciphertext)
48
48
  check_length(nonce, NONCEBYTES, :Nonce)
49
49
  check_length(key, KEYBYTES, :SecretKey)
@@ -98,4 +98,10 @@ module Crypto
98
98
  ciphertext
99
99
  end
100
100
  end
101
+
102
+ module_function
103
+
104
+ def secretbox(*args)
105
+ SecretBox.secretbox(*args)
106
+ end
101
107
  end
@@ -35,7 +35,9 @@ module Crypto
35
35
  end
36
36
  end
37
37
 
38
- def self.shorthash(*args)
38
+ module_function
39
+
40
+ def shorthash(*args)
39
41
  ShortHash.shorthash(*args)
40
42
  end
41
43
  end
data/lib/crypto/sign.rb CHANGED
@@ -96,7 +96,9 @@ module Crypto
96
96
  end
97
97
  end
98
98
 
99
- def self.sign(*args)
99
+ module_function
100
+
101
+ def sign(*args)
100
102
  Sign.sign(*args)
101
103
  end
102
104
  end
@@ -1,3 +1,3 @@
1
1
  module Sodium
2
- VERSION = '0.0.4'.freeze
2
+ VERSION = '0.0.5'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffi-libsodium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hendrik Beskow