enveloperb 0.1.1 → 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: 3de566264b463ee63b0024edeccc53cfc521facee9e1c5c73fe92f01757274af
4
- data.tar.gz: 4f9698390562b623fadb6553d33e453be7fc93f51f5b688c1de810db09a9d22b
3
+ metadata.gz: 0cbf9bca661a49920a4253d26b53558a0b24230bfdc1cc899999b6a8e833fdfa
4
+ data.tar.gz: aad2ec02767d93e9960f155b61f921bd81986c5536eaa0bbe2f50c14c9afb35f
5
5
  SHA512:
6
- metadata.gz: 366e625212f67799750deb1187a853f1eec0f1e03e4603f5cf37b8feb83f05f3372f52c578555b15de4be0559716f9d09feae5cafbe81d83c3b8a8dd5d781c89
7
- data.tar.gz: 9be09187a714dc4744bfaba126a1faa5ff806153c191c459033175f10893b5ce46138423572571f7f74716f14038cd3db002b65b7e505f32bd32db7def628259
6
+ metadata.gz: 4d693d44a7b3aedffdc7c2f64677f94b819e38304a8ae72723699e023b2769b2718655ff2b632a1e4c2785fdbe145da93b7df542d1cb82e3805c15e91615b35a
7
+ data.tar.gz: a8f4c7a5c759469ed45c29e0734966f9ac5db36428dac3a6cabd9870eb9afe3597f1aebaa21089962918b37ee7c61a51d0643b29856c753433dedd2a7a9c9c74
data/Cargo.toml CHANGED
@@ -6,7 +6,7 @@ edition = "2021"
6
6
  [dependencies]
7
7
  enveloper = { git = "https://github.com/cipherstash/enveloper", branch = "main" }
8
8
  lazy_static = "^0.2.2"
9
- rutie = "0.8.4"
9
+ rutie = { version = "0.8.4", features = ["no-link"] }
10
10
  tokio = { version = "^1.17.0", features = [ "rt-multi-thread" ] }
11
11
  aws-config = "0.10.1"
12
12
  aws-sdk-kms = "0.10.1"
data/README.md CHANGED
@@ -19,24 +19,22 @@ Except for testing purposes, it is not common to use envelope encryption in situ
19
19
 
20
20
  # Installation
21
21
 
22
- In order to build the `enveloperb` gem, you must have Rust 1.31.0 or later installed.
23
- On an ARM-based platform, you must use Rust nightly, for SIMD intrinsics support.
22
+ For the most common platforms, we provide "native" gems (which have the shared object that provides the cryptographic primitives pre-compiled).
23
+ At present, we provide native gems for:
24
24
 
25
- With that available, you should be able to install it like any other gem:
25
+ * Linux `x86_64` and `aarch64`
26
+ * macOS `x86_64` and `arm64`
26
27
 
27
- gem install enveloperb
28
+ On these platforms, you can just install the `enveloperb` gem via your preferred method, and it should "just work".
29
+ If it doesn't, please [report that as a bug](https://github.com/cipherstash/enveloperb/issues).
28
30
 
29
- There's also the wonders of [the Gemfile](http://bundler.io):
31
+ For other platforms, you will need to install the source gem, which requires that you have Rust 1.31.0 or later installed.
32
+ On ARM-based platforms, you must use Rust nightly, for SIMD intrinsics support.
30
33
 
31
- gem 'enveloperb'
34
+ ## Installing from Git
32
35
 
33
- If you're the sturdy type that likes to run from git:
34
-
35
- bundle install
36
- rake install
37
-
38
- Or, if you've eschewed the convenience of Rubygems entirely, then you
39
- presumably know what to do already.
36
+ If you have a burning need to install directly from a checkout of the git repository, you can do so by running `bundle install && rake install`.
37
+ As this is a source-based installation, you will need to have Rust installed, as described above.
40
38
 
41
39
 
42
40
  # Usage
data/enveloperb.gemspec CHANGED
@@ -21,14 +21,12 @@ Gem::Specification.new do |s|
21
21
  s.files = `git ls-files -z`.split("\0").reject { |f| f =~ /^(\.|G|spec|Rakefile)/ }
22
22
 
23
23
  s.extensions = ["ext/Rakefile"]
24
- s.require_paths = ["lib", "target"]
25
24
 
26
25
  s.required_ruby_version = ">= 2.7.0"
27
26
 
28
- s.add_runtime_dependency "rutie", "~> 0.0.4"
27
+ s.add_runtime_dependency 'fiddle', '~> 1.1'
29
28
 
30
29
  s.add_development_dependency 'bundler'
31
- s.add_development_dependency 'gem-compiler'
32
30
  s.add_development_dependency 'github-release'
33
31
  s.add_development_dependency 'guard-rspec'
34
32
  s.add_development_dependency 'rake', '~> 10.4', '>= 10.4.2'
data/ext/Rakefile CHANGED
@@ -1,5 +1,12 @@
1
1
  task :build do
2
- sh "cargo build --release"
2
+ extra_flags = if RbConfig::CONFIG["SOEXT"] == "dylib"
3
+ ["--", "-C", "link-args=-flat_namespace -undefined suppress"]
4
+ else
5
+ []
6
+ end
7
+
8
+ sh *(["cargo", "rustc", "--release"] + extra_flags)
9
+ mv "../target/release/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}", "../lib" rescue nil
3
10
  end
4
11
 
5
12
  task default: :build
data/lib/enveloperb.rb CHANGED
@@ -1,7 +1,13 @@
1
- require "rutie"
1
+ require "fiddle"
2
2
 
3
- module Enveloperb
4
- Rutie.new(:enveloperb).init 'Init_enveloperb', __dir__
3
+ begin
4
+ Fiddle::Function.new(Fiddle.dlopen("#{__dir__}/#{RbConfig::CONFIG["ruby_version"]}/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}")["Init_libenveloperb"], [], Fiddle::TYPE_VOIDP).call
5
+ rescue Fiddle::DLError
6
+ begin
7
+ Fiddle::Function.new(Fiddle.dlopen("#{__dir__}/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}")["Init_libenveloperb"], [], Fiddle::TYPE_VOIDP).call
8
+ rescue Fiddle::DLError
9
+ raise LoadError, "Failed to initialize libenveloperb.#{RbConfig::CONFIG["SOEXT"]}; either it hasn't been built, or was built incorrectly for your system"
10
+ end
5
11
  end
6
12
 
7
13
  require_relative "./enveloperb/encrypted_record"
data/src/lib.rs CHANGED
@@ -173,8 +173,8 @@ methods!(
173
173
 
174
174
  #[allow(non_snake_case)]
175
175
  #[no_mangle]
176
- pub extern "C" fn Init_enveloperb() {
177
- Module::from_existing("Enveloperb").define(|envmod| {
176
+ pub extern "C" fn Init_libenveloperb() {
177
+ Module::new("Enveloperb").define(|envmod| {
178
178
  envmod.define_nested_class("Simple", None).define(|klass| {
179
179
  klass.singleton_class().def_private("_new", enveloperb_simple_new);
180
180
  klass.def_private("_encrypt", enveloperb_simple_encrypt);
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enveloperb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Palmer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-29 00:00:00.000000000 Z
11
+ date: 2022-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rutie
14
+ name: fiddle
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.4
19
+ version: '1.1'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.4
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: gem-compiler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: github-release
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +183,6 @@ post_install_message:
197
183
  rdoc_options: []
198
184
  require_paths:
199
185
  - lib
200
- - target
201
186
  required_ruby_version: !ruby/object:Gem::Requirement
202
187
  requirements:
203
188
  - - ">="