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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4df307fcf2d926a7d97d8a67b446653314c41da2ba48daddabaa2db99a005f6c
4
- data.tar.gz: c753537e76da64402c0ccdbdd92c85ce5fe0a81ca6fc767462f80360e2da38ce
3
+ metadata.gz: 1e8f5a940bb3d63e741705dfbd7d13a94cf8d6320d836d93a32b4dcd4f486b84
4
+ data.tar.gz: 5acde5cb26d988c04cb9371376544e73390db472cdca2e5b5596c7fb9abe227c
5
5
  SHA512:
6
- metadata.gz: 15148d0a90cebfeb9db8169fbda4812374bf1f6e7a5f455225e4b84662e7d98f8f7f11e35ffa8534ba983a86109805af5738677a8ac21266ea7de9f723db8496
7
- data.tar.gz: d854f7d44f95b9711bcbd111fe91237056bf1772441f984df938171b4106cf1681bb7e354754009cc791e2dc1ab58e60cd958490fd6ebb2380bb0be42a1e3932
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, message, ad, nonce, abyte)
49
+ plain_text = AEZ.decrypt(key, cipher_tex, ad, nonce, abyte)
48
50
  ```
data/ext/aezv5/extconf.rb CHANGED
@@ -5,4 +5,4 @@ require 'mkmf'
5
5
  $CFLAGS << ' -march=native'
6
6
 
7
7
  # Create Makefile
8
- create_makefile('aezv5')
8
+ create_makefile('aez/aezv5')
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
- ffi_lib 'lib/aez/aezv5.so'
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module AEZ
2
- VERSION = "0.1.0"
4
+ VERSION = '0.1.5'
3
5
  end
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.0
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-05-31 00:00:00.000000000 Z
11
+ date: 2021-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi