enveloperb 0.1.0 → 0.1.4

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: 6b0676435524bd794dcb704475b172eb666a606f3304ae613664cf65e7353586
4
- data.tar.gz: ece01252f8f7edf6268c257756ab1c43718d479945099a3945b43a329bf053c7
3
+ metadata.gz: 1ba53e0a6672ecc675655f6d0e4d6fbee843d335c58a65a4af4ad8d4eaa66f73
4
+ data.tar.gz: 290a0c2823e0ac04ccef3327d373d3705e2e030829106b7ab24587117a9258aa
5
5
  SHA512:
6
- metadata.gz: 66138ce0bff29dc43d6480f0b6eb263bb7374792e42d9da245f7956178a9b694e6b79bfc76ed30291d0a20b349fcf167b118e6044163d000656e461564a6c2e6
7
- data.tar.gz: 72feaff2dedb3ae33482d1e1ccd4caa60d42789e07cb8b2c79415dc02aa184177c8f64c4f248158af5d5ab9fdcdedb2a20b742737b75994b64c256ff834cb3ef
6
+ metadata.gz: a8ef6e0b3a551e1a6f8a7baff17498529f42ba63864539035e49d121b11f569363d28285e92f23a7d955d2e7a9dd77c8c05918fd5c001094b687bfee7c4e5092
7
+ data.tar.gz: cc563953876a6690d9ccf859e2bc6329a6cf1711c71972e107031a9245d74a3ed26c548c221ca7869e123f5e4fae025e67e25baefe9c207d60465d630cf3daad
data/Cargo.toml CHANGED
@@ -4,9 +4,9 @@ version = "0.0.0"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
7
- enveloper = { git = "ssh://git@github.com/cipherstash/enveloper", branch = "main" }
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,6 @@
1
1
  task :build do
2
2
  sh "cargo build --release"
3
+ mv "../target/release/libenveloperb.#{RbConfig::CONFIG["SOEXT"]}", "../lib"
3
4
  end
4
5
 
5
6
  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.0
4
+ version: 0.1.4
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
  - - ">="