Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 48 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/crypto-layer-node/src/fromjs/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,13 @@ pub(crate) fn from_wrapped_key_spec(
let cipher_js = js_result(wrapped.get(cx, "cipher"))?;
let signing_hash_js = js_result(wrapped.get(cx, "signing_hash"))?;
let ephemeral_js = js_result(wrapped.get::<JsBoolean, _, _>(cx, "ephemeral"))?;
let non_exportable_js = js_result(wrapped.get::<JsBoolean, _, _>(cx, "non_exportable"))?;

Ok(KeySpec {
cipher: from_wrapped_simple_enum(cx, cipher_js)?,
signing_hash: from_wrapped_simple_enum(cx, signing_hash_js)?,
ephemeral: ephemeral_js.value(cx),
non_exportable: non_exportable_js.value(cx),
})
}

Expand Down
5 changes: 1 addition & 4 deletions crates/crypto-layer-node/src/keypairhandle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ pub fn export_delete(mut cx: FunctionContext) -> JsResult<JsPromise> {
///
/// # Arguments
/// * **data**: `Uint8Array`
/// * **signature**: `Uint8Array`
///
/// # Returns
/// * `boolean` - on success
Expand All @@ -129,13 +128,11 @@ pub fn export_encrypt_data(mut cx: FunctionContext) -> JsResult<JsPromise> {
let handle_arc = (**cx.this::<JsKeyPairHandle>()?).clone();
let data_js = cx.argument::<JsUint8Array>(0)?;
let data = vec_from_uint_8_array(&mut cx, data_js);
let iv_js = cx.argument::<JsUint8Array>(1)?;
let iv = vec_from_uint_8_array(&mut cx, iv_js);

spawn_promise(&mut cx, move |channel, deferred| {
let handle = arc_or_poisoned_error_deferred!(&channel, deferred, handle_arc.read());

let encrypted_data = handle.encrypt_data(&data, &iv);
let encrypted_data = handle.encrypt_data(&data);

deferred.settle_with(&channel, |mut cx| {
let encrypted_data = unwrap_or_throw!(cx, encrypted_data);
Expand Down
2 changes: 2 additions & 0 deletions crates/crypto-layer-node/src/tojs/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ pub fn wrap_key_spec<'a>(cx: &mut impl Context<'a>, spec: KeySpec) -> JsResult<'
insert_as_js_str_into_obj!(cx, obj, spec.signing_hash);
let ephemeral_js = cx.boolean(spec.ephemeral);
obj.set(cx, "ephemeral", ephemeral_js)?;
let non_exportable_js = cx.boolean(spec.non_exportable);
obj.set(cx, "non_exportable", non_exportable_js)?;

Ok(obj)
}
Expand Down
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nmshd/rs-crypto-node",
"version": "0.12.1",
"version": "0.13.0",
"description": "crypto layer ts interface for nodejs",
"homepage": "https://enmeshed.eu",
"repository": "github:nmshd/crypto-layer-node",
Expand Down Expand Up @@ -62,12 +62,12 @@
},
"dependencies": {
"@neon-rs/load": "^0.1.73",
"@nmshd/rs-crypto-types": "^0.9.0"
"@nmshd/rs-crypto-types": "^0.10.0"
},
"optionalDependencies": {
"@nmshd/rs-crypto-node-darwin-arm64": "0.12.1",
"@nmshd/rs-crypto-node-darwin-x64": "0.12.1",
"@nmshd/rs-crypto-node-linux-x64-gnu": "0.12.1",
"@nmshd/rs-crypto-node-win32-x64-msvc": "0.12.1"
"@nmshd/rs-crypto-node-darwin-arm64": "0.13.0",
"@nmshd/rs-crypto-node-darwin-x64": "0.13.0",
"@nmshd/rs-crypto-node-linux-x64-gnu": "0.13.0",
"@nmshd/rs-crypto-node-win32-x64-msvc": "0.13.0"
}
}
2 changes: 1 addition & 1 deletion platforms/darwin-arm64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nmshd/rs-crypto-node-darwin-arm64",
"description": "Prebuilt binary package for `rs-crypto-node` on `darwin-arm64`.",
"repository": "github:nmshd/crypto-layer-node",
"version": "0.12.1",
"version": "0.13.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion platforms/darwin-x64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nmshd/rs-crypto-node-darwin-x64",
"description": "Prebuilt binary package for `rs-layer-ts` on `darwin-x64`.",
"repository": "github:nmshd/crypto-layer-node",
"version": "0.12.1",
"version": "0.13.0",
"os": [
"darwin"
],
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nmshd/rs-crypto-node-linux-arm64-gnu",
"description": "Prebuilt binary package for `rs-layer-ts` on `linux-arm64-gnu`.",
"repository": "github:nmshd/crypto-layer-node",
"version": "0.12.1",
"version": "0.13.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux-x64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nmshd/rs-crypto-node-linux-x64-gnu",
"description": "Prebuilt binary package for `rs-layer-ts` on `linux-x64-gnu`.",
"repository": "github:nmshd/crypto-layer-node",
"version": "0.12.1",
"version": "0.13.0",
"os": [
"linux"
],
Expand Down
2 changes: 1 addition & 1 deletion platforms/win32-x64-msvc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@nmshd/rs-crypto-node-win32-x64-msvc",
"description": "Prebuilt binary package for `rs-layer-ts` on `win32-x64-msvc`.",
"repository": "github:nmshd/crypto-layer-node",
"version": "0.12.1",
"version": "0.13.0",
"os": [
"win32"
],
Expand Down
Loading
Loading