forked from zeropoolnetwork/libzeropool-rs
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from zkBob/develop
Direct deposits, moving few libraries in zkBob domain
- Loading branch information
Showing
29 changed files
with
1,142 additions
and
229 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "libzkbob-rs-node" | ||
version = "0.2.2" | ||
version = "0.3.0" | ||
authors = ["Dmitry Vdovin <[email protected]>"] | ||
repository = "https://github.com/zkBob/libzkbob-rs/" | ||
license = "MIT OR Apache-2.0" | ||
|
@@ -11,12 +11,17 @@ exclude = ["index.node"] | |
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
libzkbob-rs = { version = "0.9.1", features = ["native"] } | ||
#libzkbob-rs = { path = "../libzkbob-rs", features = ["native"] } | ||
neon = { version = "0.10.0", default-features = false, features = ["channel-api", "napi-6", "promise-api"] } | ||
libzkbob-rs = { version = "0.10.0", features = ["native"] } | ||
#libzkbob-rs = { path = "../libzkbob-rs", features = ["native"] } | ||
neon = { version = "0.10.0", default-features = false, features = ["channel-api", "napi-6", "promise-api", "task-api"] } | ||
# FIXME: Using a random fork for now | ||
neon-serde = { git = "https://github.com/NZXTCorp/neon-serde.git", branch = "refactor/update-neon-0.10" } | ||
rayon = "1.5.3" | ||
neon-serde = { package = "neon-serde3", version = "0.10" } | ||
serde = "1.0.136" | ||
hex = "0.4.3" | ||
|
||
[dependencies.fawkes-crypto] | ||
git = "https://github.com/zkbob/fawkes-crypto" | ||
branch = "master" | ||
package = "fawkes-crypto-zkbob" | ||
version = "4.5.0" | ||
features = ["multicore"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "libzkbob-rs-node", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "Neon version of libzkbob-rs", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
|
@@ -11,9 +11,21 @@ | |
"install": "npm run build-release", | ||
"test": "cargo test" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts", | ||
"src", | ||
"Cargo.toml", | ||
"LICENSE_APACHE", | ||
"LICENSE_MIT", | ||
"README.md" | ||
], | ||
"author": "Dmitry Vdovin <[email protected]>", | ||
"license": "MIT OR Apache-2.0", | ||
"dependencies": { | ||
"cargo-cp-artifact": "^0.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "18.13.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::str::FromStr; | ||
|
||
use libzkbob_rs::{ | ||
keys::Keys, | ||
libzeropool::{fawkes_crypto::ff_uint::Num, POOL_PARAMS}, | ||
}; | ||
use neon::{ | ||
prelude::FunctionContext, | ||
result::JsResult, | ||
types::{JsString, JsValue}, | ||
}; | ||
|
||
pub fn keys_derive(mut cx: FunctionContext) -> JsResult<JsValue> { | ||
let sk_js = cx.argument::<JsString>(0)?; | ||
let sk_str = sk_js.value(&mut cx); | ||
let sk = Num::from_str(&sk_str).unwrap(); | ||
let keys = Keys::derive(sk, &*POOL_PARAMS); | ||
let res = neon_serde::to_value(&mut cx, &keys).unwrap(); | ||
|
||
Ok(res) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.