enveloperb 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.toml +1 -1
- data/README.md +11 -13
- data/enveloperb.gemspec +1 -2
- data/ext/Rakefile +1 -0
- data/lib/enveloperb.rb +9 -3
- data/src/lib.rs +2 -2
- metadata +5 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ba53e0a6672ecc675655f6d0e4d6fbee843d335c58a65a4af4ad8d4eaa66f73
|
4
|
+
data.tar.gz: 290a0c2823e0ac04ccef3327d373d3705e2e030829106b7ab24587117a9258aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8ef6e0b3a551e1a6f8a7baff17498529f42ba63864539035e49d121b11f569363d28285e92f23a7d955d2e7a9dd77c8c05918fd5c001094b687bfee7c4e5092
|
7
|
+
data.tar.gz: cc563953876a6690d9ccf859e2bc6329a6cf1711c71972e107031a9245d74a3ed26c548c221ca7869e123f5e4fae025e67e25baefe9c207d60465d630cf3daad
|
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
|
-
|
23
|
-
|
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
|
-
|
25
|
+
* Linux `x86_64` and `aarch64`
|
26
|
+
* macOS `x86_64` and `arm64`
|
26
27
|
|
27
|
-
|
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
|
-
|
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
|
-
|
34
|
+
## Installing from Git
|
32
35
|
|
33
|
-
If you
|
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
@@ -24,10 +24,9 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.required_ruby_version = ">= 2.7.0"
|
26
26
|
|
27
|
-
s.add_runtime_dependency
|
27
|
+
s.add_runtime_dependency 'fiddle', '~> 1.1'
|
28
28
|
|
29
29
|
s.add_development_dependency 'bundler'
|
30
|
-
s.add_development_dependency 'gem-compiler'
|
31
30
|
s.add_development_dependency 'github-release'
|
32
31
|
s.add_development_dependency 'guard-rspec'
|
33
32
|
s.add_development_dependency 'rake', '~> 10.4', '>= 10.4.2'
|
data/ext/Rakefile
CHANGED
data/lib/enveloperb.rb
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
require "
|
1
|
+
require "fiddle"
|
2
2
|
|
3
|
-
|
4
|
-
|
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
|
177
|
-
Module::
|
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.
|
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-
|
11
|
+
date: 2022-05-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: fiddle
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
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:
|
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
|