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.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/lib/aez/version.rb +3 -1
- data/lib/aez.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4515b6053e1269a602f64d3450355ba374d2b0f7d56b4c7abe983c54e65d7f9
|
4
|
+
data.tar.gz: 6e136ab4ef0d0b24d22a498b36ef909f995bd4444c14f69a663187c023981249
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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,
|
49
|
+
plain_text = AEZ.decrypt(key, cipher_tex, ad, nonce, abyte)
|
48
50
|
```
|
data/lib/aez/version.rb
CHANGED
data/lib/aez.rb
CHANGED
@@ -13,7 +13,16 @@ module AEZ
|
|
13
13
|
|
14
14
|
extend FFI::Library
|
15
15
|
|
16
|
-
|
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
|