aez 0.1.0 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/ext/aezv5/extconf.rb +1 -1
- data/lib/aez.rb +11 -2
- data/lib/aez/version.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e8f5a940bb3d63e741705dfbd7d13a94cf8d6320d836d93a32b4dcd4f486b84
|
4
|
+
data.tar.gz: 5acde5cb26d988c04cb9371376544e73390db472cdca2e5b5596c7fb9abe227c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c39eff6146ed8999cd1e201d9d7f73295e0df40a5207233e257cb263844e9f77faf477064f9268afe0c526fe9a9c9d8e6c62a533a7c1082c6898c77892d63c74
|
7
|
+
data.tar.gz: 135d32546203fc119e027038f85ac6d84f85d2fb669ffe5078e14aaa1591f62eaf0d72f1d25496302de2557821feac422cbaa50bcbe9fb85ce080def8990f125
|
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/ext/aezv5/extconf.rb
CHANGED
data/lib/aez.rb
CHANGED
@@ -7,13 +7,22 @@ require 'ffi'
|
|
7
7
|
# [AEZv5](https://web.cs.ucdavis.edu/~rogaway/aez)
|
8
8
|
module AEZ
|
9
9
|
|
10
|
-
class Error; end
|
10
|
+
class Error < StandardError; end
|
11
11
|
|
12
12
|
MAX_CIPHER_TXT_LENGTH = 2**32 - 1
|
13
13
|
|
14
14
|
extend FFI::Library
|
15
15
|
|
16
|
-
|
16
|
+
suffix = case RbConfig::CONFIG['host_os'].downcase
|
17
|
+
when /darwin/
|
18
|
+
'bundle'
|
19
|
+
when /windows|cygwin|msys|mingw|mswin/
|
20
|
+
'dll'
|
21
|
+
else
|
22
|
+
'so'
|
23
|
+
end
|
24
|
+
|
25
|
+
ffi_lib File.expand_path("aez/aezv5.#{suffix}", __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
|
data/lib/aez/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aez
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shigeyuki Azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|