Skip to content

Commit 8274bb6

Browse files
authored
#20 Upgrade to consume latest rerypt-rs version and bump to Rust 1.31 (#21)
1 parent e6bb827 commit 8274bb6

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: rust
22
rust:
3-
- 1.30.0
3+
- 1.31.0
44

55
# all unlabeled jobs run at test. Only if all "test" jobs finish, will the publish job run
66
stages:

RELEASING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Release Checklist
2+
=================
3+
4+
* Decide on the new version number and update it within the `package.json` file. This will be used as the NPM version number.
5+
* Write the CHANGELOG.md entry for the release by looking at the PRs.
6+
* Commit `package.json` (for version number) and `CHANGELOG.md`.
7+
* Push a tag for the version that exists in the `package.json` using `git tag {version}` and `git push origin {tag}`. Pushing this tag will cause Travis to build the Node bindings for all currently supported platforms to verify that they build correctly. If they do, it will then perform the NPM publish step within TravisCI via the `publish.js` script.

native/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ name = "recrypt_node"
88
crate-type = ["dylib"]
99

1010
[dependencies]
11-
rand = "0.5.5"
12-
#recrypt = "0.3.0"
13-
recrypt = { git = "https://github.com/IronCoreLabs/recrypt-rs"}
14-
neon = "0.2.0"
11+
rand = "~0.6.1"
12+
recrypt = { git = "https://github.com/IronCoreLabs/recrypt-rs", tag = "0.5.1"}
13+
neon = "~0.2.0"
1514

1615
[build-dependencies]
1716
neon-build = "0.2.0"

native/src/api256.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use recrypt::api::{
99
use util;
1010

1111
pub struct RecryptApi256 {
12-
api: Api<Sha256, Ed25519, RandomBytes<rand::ThreadRng>>,
12+
api: Api<Sha256, Ed25519, RandomBytes<rand::rngs::ThreadRng>>,
1313
}
1414

1515
declare_types! {
@@ -310,7 +310,8 @@ pub fn augment_public_key_256(mut cx: FunctionContext) -> JsResult<JsObject> {
310310
.augment(&util::js_object_to_public_key(
311311
&mut cx,
312312
other_public_key_obj,
313-
)).unwrap();
313+
))
314+
.unwrap();
314315

315316
Ok(util::public_key_to_js_object(&mut cx, &augmented_public_key)?.upcast())
316317
}

native/src/util.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ macro_rules! buffer_to_fixed_bytes { ($($fn_name: ident, $n: expr); *) => {
2828
///
2929
/// Create the various methods we need to convert buffers into fixed length bytes
3030
///
31-
buffer_to_fixed_bytes!{buffer_to_fixed_32_bytes, 32; buffer_to_fixed_64_bytes, 64; buffer_to_fixed_128_bytes, 128; buffer_to_fixed_384_bytes, 384}
31+
buffer_to_fixed_bytes! {buffer_to_fixed_32_bytes, 32; buffer_to_fixed_64_bytes, 64; buffer_to_fixed_128_bytes, 128; buffer_to_fixed_384_bytes, 384}
3232

3333
///
3434
/// Create a macro for converting JsBuffers to different types of signature objects which all have the same size
@@ -42,7 +42,7 @@ macro_rules! buffer_to_signature { ($($fn_name: ident, $sig_type: expr, $ret_typ
4242
///
4343
/// Create two methods from the macro for Schnorr and ED25519 signatures
4444
///
45-
buffer_to_signature!{buffer_to_schnorr_signature, SchnorrSignature::new, SchnorrSignature; buffer_to_ed25519_signature, Ed25519Signature::new, Ed25519Signature}
45+
buffer_to_signature! {buffer_to_schnorr_signature, SchnorrSignature::new, SchnorrSignature; buffer_to_ed25519_signature, Ed25519Signature::new, Ed25519Signature}
4646

4747
///
4848
/// Convert a JsBuffer handle of variable size into a vector
@@ -97,7 +97,8 @@ pub fn js_object_to_public_key<'a, T: Context<'a>>(
9797
PublicKey::new((
9898
buffer_to_fixed_32_bytes(cx, x, "publicKey.x"),
9999
buffer_to_fixed_32_bytes(cx, y, "publicKey.y"),
100-
)).unwrap()
100+
))
101+
.unwrap()
101102
}
102103

103104
///
@@ -167,7 +168,8 @@ pub fn js_object_to_transform_key<'a, T: Context<'a>>(
167168
cx,
168169
hashed_temp_key_buffer,
169170
"hashedTempKey",
170-
)).unwrap(),
171+
))
172+
.unwrap(),
171173
PublicSigningKey::new(buffer_to_fixed_32_bytes(
172174
cx,
173175
public_signing_key_buffer,
@@ -251,8 +253,10 @@ pub fn js_object_to_transform_blocks<'a, T: Context<'a>>(
251253
random_transform_encrypted_temp_key,
252254
"transformBlock.randomTransformEncryptedTempKey",
253255
)),
254-
).unwrap()
255-
}).collect();
256+
)
257+
.unwrap()
258+
})
259+
.collect();
256260

257261
NonEmptyVec::try_from(&blocks).unwrap()
258262
}

0 commit comments

Comments
 (0)