-
Notifications
You must be signed in to change notification settings - Fork 573
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 #4583 from iron-fish/staging
Staging -> Master
- Loading branch information
Showing
138 changed files
with
2,868 additions
and
956 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 |
---|---|---|
|
@@ -20,6 +20,7 @@ testdbs | |
.env.production.local | ||
*/**/yarn.lock | ||
.idea | ||
.vscode | ||
|
||
# logs | ||
npm-debug.log* | ||
|
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
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": "ironfish", | ||
"version": "1.16.0", | ||
"version": "1.17.0", | ||
"description": "CLI for running and interacting with an Iron Fish node", | ||
"author": "Iron Fish <[email protected]> (https://ironfish.network)", | ||
"main": "build/src/index.js", | ||
|
@@ -62,8 +62,8 @@ | |
"@aws-sdk/client-s3": "3", | ||
"@aws-sdk/client-secrets-manager": "3", | ||
"@aws-sdk/s3-request-presigner": "3", | ||
"@ironfish/rust-nodejs": "1.13.0", | ||
"@ironfish/sdk": "1.16.0", | ||
"@ironfish/rust-nodejs": "1.14.0", | ||
"@ironfish/sdk": "1.17.0", | ||
"@oclif/core": "1.23.1", | ||
"@oclif/plugin-help": "5.1.12", | ||
"@oclif/plugin-not-found": "2.3.1", | ||
|
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
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
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
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": "@ironfish/rust-nodejs-darwin-arm64", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"darwin" | ||
], | ||
|
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": "@ironfish/rust-nodejs-darwin-x64", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"darwin" | ||
], | ||
|
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": "@ironfish/rust-nodejs-linux-arm64-gnu", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"linux" | ||
], | ||
|
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": "@ironfish/rust-nodejs-linux-x64-gnu", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"linux" | ||
], | ||
|
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": "@ironfish/rust-nodejs-linux-x64-musl", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"linux" | ||
], | ||
|
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": "@ironfish/rust-nodejs-win32-x64-msvc", | ||
"version": "1.13.0", | ||
"version": "1.14.0", | ||
"os": [ | ||
"win32" | ||
], | ||
|
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */ | ||
|
||
use ironfish::{ | ||
frost::{ | ||
keys::KeyPackage, | ||
round2::{Randomizer, SignatureShare}, | ||
SigningPackage, | ||
}, | ||
frost_utils::{round_one::round_one as round_one_rust, round_two::round_two as round_two_rust}, | ||
serializing::{bytes_to_hex, hex_to_bytes, hex_to_vec_bytes}, | ||
}; | ||
use napi::bindgen_prelude::*; | ||
use napi_derive::napi; | ||
|
||
use crate::to_napi_err; | ||
|
||
#[napi(object)] | ||
pub struct RoundOneSigningData { | ||
pub nonce_hiding: String, | ||
pub nonce_binding: String, | ||
pub commitment_hiding: String, | ||
pub commitment_binding: String, | ||
} | ||
|
||
#[napi] | ||
pub fn round_one(key_package: String, seed: u32) -> Result<RoundOneSigningData> { | ||
let key_package = | ||
KeyPackage::deserialize(&hex_to_vec_bytes(&key_package).map_err(to_napi_err)?) | ||
.map_err(to_napi_err)?; | ||
let (nonce, commitment) = round_one_rust(&key_package, seed as u64); | ||
Ok(RoundOneSigningData { | ||
nonce_hiding: bytes_to_hex(&nonce.hiding().serialize()), | ||
nonce_binding: bytes_to_hex(&nonce.binding().serialize()), | ||
commitment_hiding: bytes_to_hex(&commitment.hiding().serialize()), | ||
commitment_binding: bytes_to_hex(&commitment.binding().serialize()), | ||
}) | ||
} | ||
|
||
pub fn round_two( | ||
signing_package: String, | ||
key_package: String, | ||
public_key_randomness: String, | ||
seed: u64, | ||
) -> Result<SignatureShare> { | ||
let key_package = | ||
KeyPackage::deserialize(&hex_to_vec_bytes(&key_package).map_err(to_napi_err)?[..]) | ||
.map_err(to_napi_err)?; | ||
let signing_package = | ||
SigningPackage::deserialize(&hex_to_vec_bytes(&signing_package).map_err(to_napi_err)?[..]) | ||
.map_err(to_napi_err)?; | ||
let randomizer = | ||
Randomizer::deserialize(&hex_to_bytes(&public_key_randomness).map_err(to_napi_err)?) | ||
.map_err(to_napi_err)?; | ||
round_two_rust(signing_package, key_package, randomizer, seed).map_err(to_napi_err) | ||
} |
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.