ffi-libsodium 0.2.7 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95e3d3e55b58d22b7d16193380dd64acf5b53795
4
- data.tar.gz: 75cacb7cf5499370e9e87b591450312c831f3748
3
+ metadata.gz: bf231bf8ed108114bdd026f20c6b297d2f18ecda
4
+ data.tar.gz: de5c7092f4c375780f3ccd8d0cfb277f1020a3aa
5
5
  SHA512:
6
- metadata.gz: 27dacc84385dff1c3c7759165a2e7ffd5fa9b440866088d3425318918aaff09ce6afd3433ce5ed481dfd798df7fa5a307b7833b738402b89d0c03bc8aa8d4960
7
- data.tar.gz: e1877366d0aa2ec42624c55ff64e5bf10a3ec951245577658b72e3842ae46b511477d8e8e3ddce904bfe0b38090ed9c4111412befa78300d18dc1ebc3ac9edc6
6
+ metadata.gz: bd2896b573f9f183f2f20d26a581f6d26541229c6e1865dbb86dbce8539ae0cdebc0c11f5d9e25edf99da6e21ce157646c1018d025ce757a24ead782e152fcfc
7
+ data.tar.gz: da3d3010caf1eb2d2aac3b432a26ad1a6438b95eae5838007f371d37568228057c2fda6a59ea3a92b3e28f6eb286cb0f16f4862bc4993136a6d108254f0dd689
data/lib/crypto/box.rb CHANGED
@@ -114,7 +114,7 @@ module Crypto
114
114
  secret_key.noaccess if secret_key.is_a?(Sodium::SecretBuffer)
115
115
  end
116
116
 
117
- def easy_in_place(data, nonce, public_key, secret_key)
117
+ def box!(data, nonce, public_key, secret_key)
118
118
  message = String(data)
119
119
  check_length(nonce, NONCEBYTES, :Nonce)
120
120
  check_length(public_key, PUBLICKEYBYTES, :PublicKey)
@@ -130,7 +130,7 @@ module Crypto
130
130
  secret_key.noaccess if secret_key.is_a?(Sodium::SecretBuffer)
131
131
  end
132
132
 
133
- def open_easy_in_place(data, nonce, public_key, secret_key, encoding = nil)
133
+ def open!(data, nonce, public_key, secret_key, encoding = nil)
134
134
  ciphertext = String(data)
135
135
  ciphertext_len = ciphertext.bytesize
136
136
  if (message_len = ciphertext_len - MACBYTES) >= 0
@@ -165,4 +165,8 @@ module Crypto
165
165
  def box(*args)
166
166
  Box.box(*args)
167
167
  end
168
+
169
+ def box!(*args)
170
+ Box.box!(*args)
171
+ end
168
172
  end
@@ -61,7 +61,7 @@ module Crypto
61
61
  key.noaccess if key.is_a?(Sodium::SecretBuffer)
62
62
  end
63
63
 
64
- def easy_in_place(data, nonce, key)
64
+ def secretbox!(data, nonce, key)
65
65
  message = String(data)
66
66
  check_length(nonce, NONCEBYTES, :Nonce)
67
67
  check_length(key, KEYBYTES, :SecretKey)
@@ -76,7 +76,7 @@ module Crypto
76
76
  key.noaccess if key.is_a?(Sodium::SecretBuffer)
77
77
  end
78
78
 
79
- def open_easy_in_place(data, nonce, key, encoding = nil)
79
+ def open!(data, nonce, key, encoding = nil)
80
80
  ciphertext = String(data)
81
81
  ciphertext_len = ciphertext.bytesize
82
82
  if (message_len = ciphertext_len - MACBYTES) >= 0
@@ -110,4 +110,8 @@ module Crypto
110
110
  def secretbox(*args)
111
111
  SecretBox.secretbox(*args)
112
112
  end
113
+
114
+ def secretbox!(*args)
115
+ SecretBox.secretbox!(*args)
116
+ end
113
117
  end
data/lib/sodium.rb CHANGED
@@ -72,7 +72,7 @@ module Sodium
72
72
  end
73
73
  end
74
74
 
75
- def hex2bin_in_place(hex, bin_maxlen, ignore = nil)
75
+ def hex2bin!(hex, bin_maxlen, ignore = nil)
76
76
  bin_len = FFI::MemoryPointer.new(:size_t)
77
77
  if sodium_hex2bin(hex, bin_maxlen, hex, hex.bytesize, ignore, bin_len, nil) == 0
78
78
  size = bin_len.size == 8 ? bin_len.read_uint64 : bin_len.read_uint32
@@ -1,3 +1,3 @@
1
1
  module Sodium
2
- VERSION = Gem::Version.new('0.2.7')
2
+ VERSION = Gem::Version.new('0.3.0')
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.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hendrik Beskow