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 +4 -4
- data/lib/crypto/box.rb +6 -12
- data/lib/crypto/generic_hash.rb +3 -1
- data/lib/crypto/one_time_auth.rb +3 -1
- data/lib/crypto/pw_hash/scrypt_salsa208_sha256.rb +3 -1
- data/lib/crypto/scalar_mult.rb +3 -1
- data/lib/crypto/secret_box.rb +8 -2
- data/lib/crypto/short_hash.rb +3 -1
- data/lib/crypto/sign.rb +3 -1
- data/lib/sodium/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3e68050c2be22e883d5a4b8d33e506716eb4832
|
4
|
+
data.tar.gz: 1b0db0b2e8deba32fe9d50b2541ec33dc4555d47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
165
|
-
|
156
|
+
module_function
|
157
|
+
|
158
|
+
def box(*args)
|
159
|
+
Box.box(*args)
|
166
160
|
end
|
167
161
|
end
|
data/lib/crypto/generic_hash.rb
CHANGED
data/lib/crypto/one_time_auth.rb
CHANGED
data/lib/crypto/scalar_mult.rb
CHANGED
data/lib/crypto/secret_box.rb
CHANGED
@@ -30,7 +30,7 @@ module Crypto
|
|
30
30
|
RandomBytes.buf(NONCEBYTES)
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
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
|
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
|
data/lib/crypto/short_hash.rb
CHANGED
data/lib/crypto/sign.rb
CHANGED
data/lib/sodium/version.rb
CHANGED