enquo-core 0.2.0-aarch64-linux → 0.2.0.1.g790fccd-aarch64-linux

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: 61ec922194ca8649d0a315fa6fdd1d123f98bb1e85a1a2f1c26c5347132b8291
4
- data.tar.gz: 962d6e17ab24c2114e04b1e8634d05472a399b4081670fa5ccf6e6a902e2a7a4
3
+ metadata.gz: 80d97dbb5acdc74c0890e4b0044459f1e2cbfba647cff52340c15dd7f2e65621
4
+ data.tar.gz: 4d79f25e5d84cba8efd52da5619c1a9b4b0db73a91921c9bed81815d48c809b8
5
5
  SHA512:
6
- metadata.gz: fdbb8edb31d2a9001d480a2c0fadb6819f6a31a85b7071521409fe8279fd64a4d90dedd7397476fb2a7e2209c84794b552c9fa4929e592a4ba739a65946acbff
7
- data.tar.gz: c94bb1883b43f5217e6c69728f57c4d2d49346d11323813bf91c540d2e9f18264f17a65ee02d99dc4a6e2019c4ed6f0d0e2bf90f3b8995a8fd12ab96eb2ae1c0
6
+ metadata.gz: 7db93429bd9f918c42640ae3b73f1aae446c0e7e7f262f7a224a6de2ea79d17287d6dd5b2a6bd307e9fa982a144e7f03cd8fa407d26d6f8d38c89b51b8f2ce15
7
+ data.tar.gz: fc3c4d0291c078bb0314b0fc891f359138b224aaeb69bf3e029443af32e090f98f0e017df049e92bab894b93bef2db32ba566f159d13d1e9329645df7fc44b82
data/ext/enquo/src/lib.rs CHANGED
@@ -2,7 +2,7 @@
2
2
  extern crate rutie;
3
3
 
4
4
  use enquo_core::{Field, Root, I64};
5
- use rutie::{Boolean, Class, Integer, Module, Object, RString, VerifiedObject, VM};
5
+ use rutie::{Class, Integer, Module, Object, RString, Symbol, VerifiedObject, VM};
6
6
 
7
7
  class!(EnquoRoot);
8
8
  class!(EnquoRootKeyStatic);
@@ -81,18 +81,24 @@ impl VerifiedObject for EnquoRootKeyStatic {
81
81
  methods!(
82
82
  EnquoField,
83
83
  rbself,
84
- fn enquo_field_encrypt_i64(value: Integer, context: RString, unsafe_parts: Boolean) -> RString {
84
+ fn enquo_field_encrypt_i64(value: Integer, context: RString, mode: Symbol) -> RString {
85
85
  let i = value.unwrap().to_i64();
86
86
  let field = rbself.get_data(&*FIELD_WRAPPER);
87
+ let r_mode = mode.unwrap();
88
+ let s_mode = r_mode.to_str();
87
89
 
88
- let res = maybe_raise(
89
- if unsafe_parts.unwrap().to_bool() {
90
+ let mut res = maybe_raise(
91
+ if s_mode == "unsafe" {
90
92
  I64::new_with_unsafe_parts(i, &context.unwrap().to_vec_u8_unchecked(), field)
91
93
  } else {
92
94
  I64::new(i, &context.unwrap().to_vec_u8_unchecked(), field)
93
95
  },
94
96
  "Failed to create encrypted i64",
95
97
  );
98
+ if s_mode == "no_query" {
99
+ res.drop_ore_ciphertext();
100
+ }
101
+
96
102
  RString::new_utf8(&serde_json::to_string(&res).unwrap())
97
103
  },
98
104
  fn enquo_field_decrypt_i64(ciphertext: RString, context: RString) -> Integer {
data/lib/2.7/enquo.so CHANGED
Binary file
data/lib/3.0/enquo.so CHANGED
Binary file
data/lib/3.1/enquo.so CHANGED
Binary file
data/lib/enquo/field.rb CHANGED
@@ -4,7 +4,7 @@ module Enquo
4
4
  raise RuntimeError, "Enquo::Field cannot be instantiated directly; use Enquo::Crypto#field instead"
5
5
  end
6
6
 
7
- def encrypt_i64(i, ctx, safety: nil)
7
+ def encrypt_i64(i, ctx, safety: true, no_query: false)
8
8
  unless i.is_a?(Integer)
9
9
  raise ArgumentError, "Enquo::Field#encrypt_i64 can only encrypt integers"
10
10
  end
@@ -17,7 +17,7 @@ module Enquo
17
17
  raise ArgumentError, "Encryption context must be a string (got a #{ctx.class})"
18
18
  end
19
19
 
20
- _encrypt_i64(i, ctx, safety == :unsafe)
20
+ _encrypt_i64(i, ctx, no_query ? :no_query : safety == :unsafe ? :unsafe : :default)
21
21
  end
22
22
 
23
23
  def decrypt_i64(data, ctx)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enquo-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.0.1.g790fccd
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Matt Palmer
@@ -193,9 +193,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
193
  version: 3.2.dev
194
194
  required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  requirements:
196
- - - ">="
196
+ - - ">"
197
197
  - !ruby/object:Gem::Version
198
- version: '0'
198
+ version: 1.3.1
199
199
  requirements: []
200
200
  rubygems_version: 3.3.22
201
201
  signing_key: