aez 0.1.0 → 0.1.1

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/aez/version.rb +3 -1
  4. data/lib/aez.rb +10 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4df307fcf2d926a7d97d8a67b446653314c41da2ba48daddabaa2db99a005f6c
4
- data.tar.gz: c753537e76da64402c0ccdbdd92c85ce5fe0a81ca6fc767462f80360e2da38ce
3
+ metadata.gz: e4515b6053e1269a602f64d3450355ba374d2b0f7d56b4c7abe983c54e65d7f9
4
+ data.tar.gz: 6e136ab4ef0d0b24d22a498b36ef909f995bd4444c14f69a663187c023981249
5
5
  SHA512:
6
- metadata.gz: 15148d0a90cebfeb9db8169fbda4812374bf1f6e7a5f455225e4b84662e7d98f8f7f11e35ffa8534ba983a86109805af5738677a8ac21266ea7de9f723db8496
7
- data.tar.gz: d854f7d44f95b9711bcbd111fe91237056bf1772441f984df938171b4106cf1681bb7e354754009cc791e2dc1ab58e60cd958490fd6ebb2380bb0be42a1e3932
6
+ metadata.gz: 1c5283ba76d609fcc2f6f25b8c95edb252e396ae9a71a126746dec18df84543a067d2320820568ce4ead1c04c45ab5022680c513727a311b2759dc7dd7d0db7a
7
+ data.tar.gz: 6d4f889d1f521dd424abbb7e9eda93a41ef581fe6a1df103ce6e7e305db6d161a4f940bfc3020d21b96ac3f7f6ecf9389ef7079e5984375051c75e80f78dec2e
data/README.md CHANGED
@@ -13,6 +13,8 @@ There are the following limitations from Ted Krovetz's C implementation:
13
13
  - Single AD (AEZ spec allows vector AD but this code doesn't)
14
14
  - Max 2^32-1 byte buffers allowed (due to using unsigned int)
15
15
 
16
+ Note: This code has not been formally audited. Use at your own risk.
17
+
16
18
  ## Installation
17
19
 
18
20
  Add this line to your application's Gemfile:
@@ -44,5 +46,5 @@ abyte = 16
44
46
  cipher_tex = AEZ.encrypt(key, message, ad, nonce, abyte)
45
47
 
46
48
  # Decryption
47
- plain_text = AEZ.decrypt(key, message, ad, nonce, abyte)
49
+ plain_text = AEZ.decrypt(key, cipher_tex, ad, nonce, abyte)
48
50
  ```
data/lib/aez/version.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AEZ
2
- VERSION = "0.1.0"
4
+ VERSION = '0.1.1'
3
5
  end
data/lib/aez.rb CHANGED
@@ -13,7 +13,16 @@ module AEZ
13
13
 
14
14
  extend FFI::Library
15
15
 
16
- ffi_lib 'lib/aez/aezv5.so'
16
+ lib_name = 'aezv5'
17
+ file_name =
18
+ case RbConfig::CONFIG['host_os'].downcase
19
+ when /darwin|mac os/
20
+ "#{lib_name}.dylib"
21
+ when /linux/
22
+ "#{lib_name}.so"
23
+ end
24
+
25
+ ffi_lib File.expand_path("aez/#{file_name}", __dir__)
17
26
 
18
27
  attach_function :aez_setup, [:pointer, :ulong_long, :pointer], :int
19
28
  attach_function :aez_encrypt, [:pointer, :pointer, :uint, :pointer, :uint, :uint, :pointer, :uint, :pointer], :int
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shigeyuki Azuchi