diff --git a/.github/workflows/any-pr.yml b/.github/workflows/any-pr.yml index adaff6b..c484702 100644 --- a/.github/workflows/any-pr.yml +++ b/.github/workflows/any-pr.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x, 18.x] + node-version: [18.x, 20.x, 22.x] os: [macos-latest, ubuntu-latest] # not include windows due to node-gyp bug steps: - uses: actions/checkout@v1 diff --git a/.github/workflows/push-master.yml b/.github/workflows/push-master.yml index a90f366..3181bf5 100644 --- a/.github/workflows/push-master.yml +++ b/.github/workflows/push-master.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: - node-version: 18.x + node-version: 22.x - uses: actions/setup-python@v4 with: python-version: "3.12" diff --git a/.github/workflows/push-release.yml b/.github/workflows/push-release.yml index ccbbe56..7e39fe0 100644 --- a/.github/workflows/push-release.yml +++ b/.github/workflows/push-release.yml @@ -13,7 +13,7 @@ jobs: runs-on: ${{matrix.os}} strategy: matrix: - node-version: [16.x, 18.x] + node-version: [18.x, 20.x, 22.x] os: [macos-latest, ubuntu-latest] # not include windows due to node-gyp bug steps: - uses: actions/checkout@v2 diff --git a/native/Cargo.lock b/native/Cargo.lock index 1444180..8ac316a 100644 --- a/native/Cargo.lock +++ b/native/Cargo.lock @@ -17,15 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - [[package]] name = "arrayref" version = "0.3.6" @@ -183,7 +174,7 @@ checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "synstructure", ] @@ -216,7 +207,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -242,7 +233,18 @@ checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -279,9 +281,19 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.126" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] [[package]] name = "memchr" @@ -300,44 +312,28 @@ dependencies = [ [[package]] name = "neon" -version = "0.10.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28e15415261d880aed48122e917a45e87bb82cf0260bb6db48bbab44b7464373" +checksum = "7d75440242411c87dc39847b0e33e961ec1f10326a9d8ecf9c1ea64a3b3c13dc" dependencies = [ - "neon-build", - "neon-runtime", + "getrandom 0.2.15", + "libloading", + "neon-macros", + "once_cell", "semver", + "send_wrapper", "smallvec", ] [[package]] -name = "neon-build" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bac98a702e71804af3dacfde41edde4a16076a7bbe889ae61e56e18c5b1c811" -dependencies = [ - "neon-sys", -] - -[[package]] -name = "neon-runtime" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676720fa8bb32c64c3d9f49c47a47289239ec46b4bdb66d0913cc512cb0daca" -dependencies = [ - "cfg-if", - "neon-sys", - "smallvec", -] - -[[package]] -name = "neon-sys" -version = "0.10.1" +name = "neon-macros" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ebc923308ac557184455b4aaa749470554cbac70eb4daa8b18cdc16bef7df6" +checksum = "c6813fde79b646e47e7ad75f480aa80ef76a5d9599e2717407961531169ee38b" dependencies = [ - "cc", - "regex", + "quote", + "syn 2.0.77", + "syn-mid", ] [[package]] @@ -351,7 +347,6 @@ dependencies = [ "ff-zeroize", "hkdf", "neon", - "neon-build", "pairing-plus", "rand 0.7.3", "sha2", @@ -396,6 +391,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + [[package]] name = "opaque-debug" version = "0.2.3" @@ -425,18 +426,18 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.20" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -460,7 +461,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.16", "libc", "rand_chacha", "rand_core 0.5.1", @@ -498,7 +499,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.16", ] [[package]] @@ -528,23 +529,6 @@ dependencies = [ "rand_core 0.3.1", ] -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - [[package]] name = "rustc-demangle" version = "0.1.21" @@ -553,18 +537,15 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "semver" -version = "0.9.0" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] -name = "semver-parser" -version = "0.7.0" +name = "send_wrapper" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" @@ -583,7 +564,7 @@ checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", ] [[package]] @@ -600,9 +581,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "subtle" @@ -621,6 +602,28 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-mid" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5dc35bb08dd1ca3dfb09dce91fd2d13294d6711c88897d9a9d60acf39bce049" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.77", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -629,7 +632,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "unicode-xid", ] @@ -657,6 +660,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "winapi" version = "0.3.9" @@ -679,6 +688,70 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "zeroize" version = "1.5.6" @@ -696,6 +769,6 @@ checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.98", "synstructure", ] diff --git a/native/Cargo.toml b/native/Cargo.toml index b7bcac5..9f6a36c 100644 --- a/native/Cargo.toml +++ b/native/Cargo.toml @@ -1,7 +1,6 @@ [package] name = "node-bbs-signatures" description = "A node wrapper for bbs-signatures" -build = "build.rs" edition = "2018" version = "0.1.0" @@ -9,16 +8,13 @@ version = "0.1.0" name = "node_bbs_signatures" crate-type = ["cdylib"] -[build-dependencies] -neon-build = "0.10.1" - [dependencies] arrayref = "0.3" bbs = { version = "0.4.1", default-features = false } bls_sigs_ref = "0.3" ff-zeroize = "0.6" hkdf = "0.8" -neon = "0.10.1" +neon = "1.0.0" pairing-plus = "0.19" rand = "0.7" sha2 = "0.8" diff --git a/native/build.rs b/native/build.rs deleted file mode 100644 index 7c57ae3..0000000 --- a/native/build.rs +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2020 - MATTR Limited - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -use neon_build; - -fn main() { - neon_build::setup(); - - // add project-specific build logic here... -} diff --git a/native/src/lib.rs b/native/src/lib.rs index 08b3fb3..79cf401 100644 --- a/native/src/lib.rs +++ b/native/src/lib.rs @@ -20,9 +20,14 @@ mod macros; use bbs::prelude::*; use neon::prelude::*; -use neon::register_module; use neon::result::Throw; -use pairing_plus::{bls12_381::{Fr, G1, G2, Bls12}, serdes::SerDes, hash_to_field::BaseFromRO, CurveProjective}; +use neon::types::buffer::TypedArray; +use pairing_plus::{ + bls12_381::{Bls12, Fr, G1, G2}, + hash_to_field::BaseFromRO, + serdes::SerDes, + CurveProjective, +}; use rand::{thread_rng, RngCore}; use std::collections::{BTreeMap, BTreeSet}; @@ -81,8 +86,18 @@ use std::collections::{BTreeMap, BTreeSet}; // g1 = b9c9058e8a44b87014f98be4e1818db718f8b2d5101fc89e6983625f321f14b84d7cf6e155004987a215ee426df173c9 // g2 = a963de2adfb1163cf4bed24d708ce47432742d2080b2573ebe2e19a8698f60c541cec000fcb19783e9be73341356df5f1191cddec7c476d7742bcc421afc5d505e63373c627ea01fda04f0e40159d25bdd12f45a010d8580a78f6a7d262272f3 -const BLINDING_G1: &'static [u8] = &[185, 201, 5, 142, 138, 68, 184, 112, 20, 249, 139, 228, 225, 129, 141, 183, 24, 248, 178, 213, 16, 31, 200, 158, 105, 131, 98, 95, 50, 31, 20, 184, 77, 124, 246, 225, 85, 0, 73, 135, 162, 21, 238, 66, 109, 241, 115, 201]; -const BLINDING_G2: &'static [u8] = &[169, 99, 222, 42, 223, 177, 22, 60, 244, 190, 210, 77, 112, 140, 228, 116, 50, 116, 45, 32, 128, 178, 87, 62, 190, 46, 25, 168, 105, 143, 96, 197, 65, 206, 192, 0, 252, 177, 151, 131, 233, 190, 115, 52, 19, 86, 223, 95, 17, 145, 205, 222, 199, 196, 118, 215, 116, 43, 204, 66, 26, 252, 93, 80, 94, 99, 55, 60, 98, 126, 160, 31, 218, 4, 240, 228, 1, 89, 210, 91, 221, 18, 244, 90, 1, 13, 133, 128, 167, 143, 106, 125, 38, 34, 114, 243]; +const BLINDING_G1: &[u8] = &[ + 185, 201, 5, 142, 138, 68, 184, 112, 20, 249, 139, 228, 225, 129, 141, 183, 24, 248, 178, 213, + 16, 31, 200, 158, 105, 131, 98, 95, 50, 31, 20, 184, 77, 124, 246, 225, 85, 0, 73, 135, 162, + 21, 238, 66, 109, 241, 115, 201, +]; +const BLINDING_G2: &[u8] = &[ + 169, 99, 222, 42, 223, 177, 22, 60, 244, 190, 210, 77, 112, 140, 228, 116, 50, 116, 45, 32, + 128, 178, 87, 62, 190, 46, 25, 168, 105, 143, 96, 197, 65, 206, 192, 0, 252, 177, 151, 131, + 233, 190, 115, 52, 19, 86, 223, 95, 17, 145, 205, 222, 199, 196, 118, 215, 116, 43, 204, 66, + 26, 252, 93, 80, 94, 99, 55, 60, 98, 126, 160, 31, 218, 4, 240, 228, 1, 89, 210, 91, 221, 18, + 244, 90, 1, 13, 133, 128, 167, 143, 106, 125, 38, 34, 114, 243, +]; /// Generate a blinded BLS key pair where secret key `x` and blinding factor `r` in Fp /// and public key `w` = `g2` ^ `x` * `blinding_g2` ^ `r` @@ -116,15 +131,18 @@ fn bls_generate_g1_key(cx: FunctionContext) -> JsResult { bls_generate_keypair::(cx, None) } -fn bls_generate_keypair<'a, 'b, G: CurveProjective + SerDes>(mut cx: FunctionContext<'a>, blinded: Option<&'b [u8]>) -> JsResult<'a, JsObject> { +fn bls_generate_keypair<'a, G: CurveProjective + SerDes>( + mut cx: FunctionContext<'a>, + blinded: Option<&[u8]>, +) -> JsResult<'a, JsObject> { let mut passed_seed = false; let seed = match cx.argument_opt(0) { Some(arg) => { - let arg: Handle = arg.downcast::().or_throw(&mut cx)?; - let seed_data = cx.borrow(&arg, |data| data.as_slice::()); + let arg: Handle = arg.downcast_or_throw(&mut cx)?; + let seed_data = arg.as_slice(&cx); passed_seed = true; seed_data.to_vec() - }, + } None => { let mut rng = thread_rng(); let mut seed_data = vec![0u8, 32]; @@ -137,27 +155,26 @@ fn bls_generate_keypair<'a, 'b, G: CurveProjective let mut pk = G::one(); pk.mul_assign(sk); - let r = - match blinded { - Some(g) => { - let mut data = g.to_vec(); - let mut gg = g.clone(); - if passed_seed { - data.extend_from_slice(seed.as_slice()); - } else { - let mut rng = thread_rng(); - let mut blinding_factor = vec![0u8, 32]; - rng.fill_bytes(blinding_factor.as_mut_slice()); - data.extend_from_slice(blinding_factor.as_slice()); - } - let mut blinding_g = G::deserialize(&mut gg, true).unwrap(); - let r = gen_sk(data.as_slice()); - blinding_g.mul_assign(r); - pk.add_assign(&blinding_g); - Some(r) - }, - None => None - }; + let r = match blinded { + Some(g) => { + let mut data = g.to_vec(); + let mut gg = g; + if passed_seed { + data.extend_from_slice(seed.as_slice()); + } else { + let mut rng = thread_rng(); + let mut blinding_factor = vec![0u8, 32]; + rng.fill_bytes(blinding_factor.as_mut_slice()); + data.extend_from_slice(blinding_factor.as_slice()); + } + let mut blinding_g = G::deserialize(&mut gg, true).unwrap(); + let r = gen_sk(data.as_slice()); + blinding_g.mul_assign(r); + pk.add_assign(&blinding_g); + Some(r) + } + None => None, + }; let mut sk_bytes = Vec::new(); let mut pk_bytes = Vec::new(); @@ -172,7 +189,7 @@ fn bls_generate_keypair<'a, 'b, G: CurveProjective if let Some(rr) = r { let mut r_bytes = Vec::new(); rr.serialize(&mut r_bytes, true).unwrap(); - let r_array = slice_to_js_array_buffer!(&r_bytes[..], cx); + let r_array = slice_to_js_array_buffer!(&r_bytes[..], cx); result.set(&mut cx, "blindingFactor", r_array)?; } @@ -180,7 +197,7 @@ fn bls_generate_keypair<'a, 'b, G: CurveProjective } fn gen_sk(msg: &[u8]) -> Fr { - use sha2::digest::generic_array::{GenericArray, typenum::U48}; + use sha2::digest::generic_array::{typenum::U48, GenericArray}; const SALT: &[u8] = b"BLS-SIG-KEYGEN-SALT-"; // copy of `msg` with appended zero byte let mut msg_prime = Vec::::with_capacity(msg.as_ref().len() + 1); @@ -297,8 +314,8 @@ fn bbs_sign(mut cx: FunctionContext) -> JsResult { let message_bytes = obj_field_to_vec!(&mut cx, js_obj, "messages"); let mut messages = Vec::new(); - for i in 0..message_bytes.len() { - let message = obj_field_to_field_elem!(&mut cx, message_bytes[i]); + for message_byte in message_bytes { + let message = obj_field_to_field_elem!(&mut cx, message_byte); messages.push(message); } @@ -343,8 +360,8 @@ fn bbs_verify(mut cx: FunctionContext) -> JsResult { let message_bytes = obj_field_to_vec!(&mut cx, js_obj, "messages"); let mut messages = Vec::new(); - for i in 0..message_bytes.len() { - let message = obj_field_to_field_elem!(&mut cx, message_bytes[i]); + for message_byte in message_bytes { + let message = obj_field_to_field_elem!(&mut cx, message_byte); messages.push(message); } @@ -453,12 +470,7 @@ fn extract_blinding_context(cx: &mut FunctionContext) -> Result JsResult JsResult = (0..public_key.message_count()).collect(); let message_count = public_key.message_count() as f64; - for i in 0..hidden.len() { - let index = cast_to_number!(cx, hidden[i]); + for hidden_value in hidden { + let index = cast_to_number!(&mut cx, hidden_value); if index < 0f64 || index > message_count { panic!( "Index is out of bounds. Must be between {} and {}: found {}", @@ -656,12 +663,7 @@ struct BlindSignContext { /// `return`: `ArrayBuffer` the unblinded signature fn bbs_get_unblinded_signature(mut cx: FunctionContext) -> JsResult { let sig = BlindSignature::from(arg_to_fixed_array!(cx, 0, 0, SIGNATURE_COMPRESSED_SIZE)); - let bf = SignatureBlinding::from(arg_to_fixed_array!( - cx, - 1, - 0, - FR_COMPRESSED_SIZE - )); + let bf = SignatureBlinding::from(arg_to_fixed_array!(cx, 1, 0, FR_COMPRESSED_SIZE)); let sig = sig.to_unblinded(&bf); @@ -688,21 +690,19 @@ fn bbs_create_proof(mut cx: FunctionContext) -> JsResult { let (mut bitvector, pcx) = extract_create_proof_context(&mut cx)?; let proof = generate_proof(pcx)?; bitvector.extend_from_slice(proof.to_bytes_compressed_form().as_slice()); - Ok(slice_to_js_array_buffer!( - bitvector.as_slice(), - cx - )) + Ok(slice_to_js_array_buffer!(bitvector.as_slice(), cx)) } fn generate_proof(pcx: CreateProofContext) -> Result { let pok = handle_err!(PoKOfSignature::init( &pcx.signature, &pcx.public_key, - &pcx.messages.as_slice() + pcx.messages.as_slice() )); let mut challenge_bytes = pok.to_bytes(); if let Some(b) = pcx.nonce { - challenge_bytes.extend_from_slice(&ProofNonce::hash(b.as_slice()).to_bytes_compressed_form()); + challenge_bytes + .extend_from_slice(&ProofNonce::hash(b.as_slice()).to_bytes_compressed_form()); } else { challenge_bytes.extend_from_slice(&[0u8; FR_COMPRESSED_SIZE]); } @@ -711,7 +711,9 @@ fn generate_proof(pcx: CreateProofContext) -> Result Ok(handle_err!(pok.gen_proof(&challenge_hash))) } -fn extract_create_proof_context(cx: &mut FunctionContext) -> Result<(Vec, CreateProofContext), Throw> { +fn extract_create_proof_context( + cx: &mut FunctionContext, +) -> Result<(Vec, CreateProofContext), Throw> { let js_obj = cx.argument::(0)?; let signature = Signature::from(obj_field_to_fixed_array!( @@ -733,8 +735,8 @@ fn extract_create_proof_context(cx: &mut FunctionContext) -> Result<(Vec, Cr let message_bytes = obj_field_to_vec!(cx, js_obj, "messages"); let mut revealed = BTreeSet::new(); - for i in 0..revealed_indices.len() { - let index = cast_to_number!(cx, revealed_indices[i]); + for revealed_indice in revealed_indices { + let index = cast_to_number!(cx, revealed_indice); if index < 0f64 || index as usize > message_bytes.len() { panic!( "Index is out of bounds. Must be between 0 and {}: {}", @@ -746,8 +748,8 @@ fn extract_create_proof_context(cx: &mut FunctionContext) -> Result<(Vec, Cr } let mut messages = Vec::new(); - for i in 0..message_bytes.len() { - let message = obj_field_to_field_elem!(cx, message_bytes[i]); + for (i, message_byte) in message_bytes.iter().enumerate() { + let message = obj_field_to_field_elem!(cx, *message_byte); if revealed.contains(&i) { messages.push(pm_revealed_raw!(message)); } else { @@ -758,12 +760,15 @@ fn extract_create_proof_context(cx: &mut FunctionContext) -> Result<(Vec, Cr let mut bitvector = (messages.len() as u16).to_be_bytes().to_vec(); bitvector.append(&mut revealed_to_bitvector(messages.len(), &revealed)); - Ok((bitvector, CreateProofContext { - signature, - public_key, - messages, - nonce, - })) + Ok(( + bitvector, + CreateProofContext { + signature, + public_key, + messages, + nonce, + }, + )) } struct CreateProofContext { @@ -829,8 +834,13 @@ fn verify_proof(vcx: VerifyProofContext) -> Result, Throw> let revealed = vcx.revealed.iter().collect::>(); let mut revealed_messages = BTreeMap::new(); - for i in 0..vcx.revealed.len() { - revealed_messages.insert(*revealed[i], vcx.messages[i].clone()); + for (i, revealed_index) in revealed + .iter() + .copied() + .enumerate() + .take(vcx.revealed.len()) + { + revealed_messages.insert(*revealed_index, vcx.messages[i]); } let signature_proof = SignatureProof { @@ -845,7 +855,10 @@ fn verify_proof(vcx: VerifyProofContext) -> Result, Throw> ))) } -fn extract_verify_proof_context(cx: &mut FunctionContext, is_bls: bool) -> Result { +fn extract_verify_proof_context( + cx: &mut FunctionContext, + is_bls: bool, +) -> Result { let js_obj = cx.argument::(0)?; let proof = obj_field_to_slice!(cx, js_obj, "proof"); @@ -854,7 +867,9 @@ fn extract_verify_proof_context(cx: &mut FunctionContext, is_bls: bool) -> Resul let offset = 2 + bitvector_length; let revealed = bitvector_to_revealed(&proof[2..offset]); - let proof = handle_err!(PoKOfSignatureProof::from_bytes_compressed_form(&proof[offset..])); + let proof = handle_err!(PoKOfSignatureProof::from_bytes_compressed_form( + &proof[offset..] + )); let nonce = obj_field_to_opt_slice!(cx, js_obj, "nonce"); // let revealed_indices = obj_field_to_vec!(cx, js_obj, "revealed"); @@ -866,8 +881,8 @@ fn extract_verify_proof_context(cx: &mut FunctionContext, is_bls: bool) -> Resul } let mut messages = Vec::new(); - for i in 0..message_bytes.len() { - let message = obj_field_to_field_elem!(cx, message_bytes[i]); + for message_byte in message_bytes { + let message = obj_field_to_field_elem!(cx, message_byte); messages.push(message); } @@ -942,7 +957,8 @@ fn bitvector_to_revealed(data: &[u8]) -> BTreeSet { revealed_messages } -register_module!(mut m, { +#[neon::main] +fn main(mut m: ModuleContext) -> NeonResult<()> { m.export_function("bls_generate_blinded_g2_key", bls_generate_blinded_g2_key)?; m.export_function("bls_generate_blinded_g1_key", bls_generate_blinded_g1_key)?; m.export_function("bls_generate_g2_key", bls_generate_g2_key)?; @@ -965,4 +981,4 @@ register_module!(mut m, { m.export_function("bbs_verify_proof", bbs_verify_proof)?; m.export_function("bls_verify_proof", bls_verify_proof)?; Ok(()) -}); +} diff --git a/native/src/macros.rs b/native/src/macros.rs index 5f9874d..e33b1f3 100644 --- a/native/src/macros.rs +++ b/native/src/macros.rs @@ -13,11 +13,7 @@ macro_rules! slice_to_js_array_buffer { ($slice:expr, $cx:expr) => {{ - let mut result = JsArrayBuffer::new(&mut $cx, $slice.len() as u32)?; - $cx.borrow_mut(&mut result, |d| { - let bytes = d.as_mut_slice::(); - bytes.copy_from_slice($slice); - }); + let result = JsArrayBuffer::from_slice(&mut $cx, $slice)?; result }}; } @@ -25,7 +21,8 @@ macro_rules! slice_to_js_array_buffer { macro_rules! arg_to_slice { ($cx:expr, $i:expr) => {{ let arg: Handle = $cx.argument::($i)?; - $cx.borrow(&arg, |d| d.as_slice::()).to_vec() + let slice = arg.as_slice(&$cx); + slice }}; } @@ -42,8 +39,7 @@ macro_rules! arg_to_fixed_array { macro_rules! obj_field_to_slice { ($cx:expr, $obj:expr, $field:expr) => {{ $obj.get::($cx, $field)? - .borrow(&$cx.lock()) - .as_slice() + .as_slice($cx) .to_vec() }}; } @@ -51,7 +47,7 @@ macro_rules! obj_field_to_slice { macro_rules! obj_field_to_fixed_array { ($cx:expr, $obj:expr, $field:expr, $start:expr, $end:expr) => {{ let handle = $obj.get::($cx, $field)?; - let array = handle.borrow(&$cx.lock()).as_slice(); + let array = handle.as_slice($cx); if array.len() != $end { panic!("Invalid length"); } @@ -63,7 +59,7 @@ macro_rules! obj_field_to_opt_slice { ($cx:expr, $obj:expr, $field:expr) => {{ match $obj.get::($cx, $field) { Err(_) => None, - Ok(arg) => Some(arg.borrow(&$cx.lock()).as_slice().to_vec()), + Ok(arg) => Some(arg.as_slice($cx).to_vec()), } }}; } @@ -72,8 +68,7 @@ macro_rules! obj_field_to_vec { ($cx:expr, $obj:expr, $field: expr) => {{ let v = $obj .get::($cx, $field)? - .downcast::() - .or_throw($cx)? + .downcast_or_throw::($cx)? .to_vec($cx)?; v }}; @@ -81,9 +76,9 @@ macro_rules! obj_field_to_vec { macro_rules! cast_to_number { ($cx:expr, $obj:expr) => { - $obj.downcast::() + $obj.downcast_or_throw::($cx) .unwrap_or($cx.number(-1)) - .value() + .value($cx) }; } @@ -95,18 +90,15 @@ macro_rules! handle_err { macro_rules! obj_field_to_field_elem { ($cx:expr, $d:expr) => {{ - let handle = $d.downcast::().or_throw($cx)?; - - $cx.borrow(&handle, |data| { - let slice = data.as_slice(); - SignatureMessage::hash(slice) - }) + let handle = $d.downcast_or_throw::($cx)?; + let slice = handle.as_slice($cx); + SignatureMessage::hash(slice) }}; } macro_rules! get_message_count { ($cx:expr, $obj:expr, $field:expr) => {{ - let message_count: f64 = $obj.get::($cx, $field)?.value(); + let message_count: f64 = $obj.get::($cx, $field)?.value($cx); if message_count < 0f64 { panic!("Message count cannot be negative: {}", message_count); diff --git a/native/tests/vectors.rs b/native/tests/vectors.rs index 0759dd7..a5bd18a 100644 --- a/native/tests/vectors.rs +++ b/native/tests/vectors.rs @@ -208,10 +208,7 @@ fn proof_with_10_messages() { assert!(res.is_ok()); let proved_messages = res.unwrap(); - assert_eq!( - proved_messages, - vec![SignatureMessage::hash(b"Message9")] - ) + assert_eq!(proved_messages, vec![SignatureMessage::hash(b"Message9")]) } #[test] @@ -258,18 +255,22 @@ fn proof_with_8_messages() { fn print() { let sk = SecretKey::try_from(base64::decode(SECRET_KEY).unwrap()).unwrap(); let dpk = DeterministicPublicKey::try_from(base64::decode(PUBLIC_KEY).unwrap()).unwrap(); - let messages: Vec = ["KnYAbm0fw3mlUA=="].iter().map(|m| SignatureMessage::hash(m.as_bytes())).collect(); + let messages: Vec = ["KnYAbm0fw3mlUA=="] + .iter() + .map(|m| SignatureMessage::hash(m.as_bytes())) + .collect(); let pk = dpk.to_public_key(messages.len()).unwrap(); let sig = Signature::new(messages.as_slice(), &sk, &pk).unwrap(); println!("pk = {}", base64::encode(pk.to_bytes_compressed_form())); - println!("sig = {}", base64::encode(sig.to_bytes_compressed_form().as_ref())); + println!( + "sig = {}", + base64::encode(sig.to_bytes_compressed_form().as_ref()) + ); let nonce = ProofNonce::hash(b"I03DvFXcpVdOPuOiyXgcBf4voAA="); let proof_request = Verifier::new_proof_request(&[0], &pk).unwrap(); // Sends `proof_request` and `nonce` to the prover - let proof_messages = vec![ - pm_revealed_raw!(messages[0]), - ]; + let proof_messages = vec![pm_revealed_raw!(messages[0])]; let pok = Prover::commit_signature_pok(&proof_request, proof_messages.as_slice(), &sig).unwrap(); @@ -285,12 +286,12 @@ fn print() { let proof = Prover::generate_signature_pok(pok, &challenge).unwrap(); let mut prefix = (messages.len() as u16).to_be_bytes().to_vec(); - prefix.append(&mut revealed_to_bitvector(messages.len(), &proof_request.revealed_messages)); + prefix.append(&mut revealed_to_bitvector( + messages.len(), + &proof_request.revealed_messages, + )); prefix.extend_from_slice(proof.proof.to_bytes_compressed_form().as_ref()); - println!( - "proof = {}", - base64::encode(&prefix) - ); + println!("proof = {}", base64::encode(&prefix)); let res = Verifier::verify_signature_pok(&proof_request, &proof, &nonce); diff --git a/package.json b/package.json index 1f2d0df..9eddde7 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "homepage": "https://github.com/mattrglobal/node-bbs-signatures", "main": "lib/index.js", "engines": { - "node": ">=16", + "node": ">=18", "yarn": "1.x" }, "directories": { @@ -35,9 +35,9 @@ "benchmark:stress": "ts-node ./bench/stress.ts", "build": "yarn build:neon && yarn build:ts", "build:ts": "tsc --pretty", - "build:neon": "neon build --release", + "build:neon": "cargo-cp-artifact -nc ./native/index.node -- cargo build --manifest-path ./native/Cargo.toml --message-format=json-render-diagnostics --release", "package": "node-pre-gyp package", - "clean": "rimraf lib/ && rimraf native/index.node && rimraf native/target && neon clean", + "clean": "rimraf lib/ && rimraf native/index.node && rimraf native/target && cargo clean --manifest-path ./native/Cargo.toml", "format": "prettier --write \"**/*.ts\" \"**/*.md\" \"!**/lib/**\"", "lint": "eslint . --ext .ts --color --format=table", "lint:fix": "yarn lint --fix", @@ -61,6 +61,7 @@ "@types/node": "12.7.2", "@typescript-eslint/eslint-plugin": "2.28.0", "@typescript-eslint/parser": "2.28.0", + "cargo-cp-artifact": "0.1.9", "conventional-changelog": "3.1.25", "conventional-changelog-cli": "2.2.2", "copyfiles": "2.2.0", @@ -79,13 +80,10 @@ "typescript": "4.3.3" }, "dependencies": { - "@mapbox/node-pre-gyp": "1.0.11", - "neon-cli": "0.10.1" + "@mapbox/node-pre-gyp": "1.0.11" }, "resolutions": { - "neon-cli/**/handlebars": "4.7.7", "conventional-changelog-cli/**/minimist": "1.2.6", - "conventional-changelog/**/minimist": "1.2.6", - "neon-cli/**/minimist": "1.2.6" + "conventional-changelog/**/minimist": "1.2.6" } } diff --git a/yarn.lock b/yarn.lock index d5b8705..ca38766 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1328,16 +1328,6 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -array-back@^3.0.1, array-back@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-3.1.0.tgz#b8859d7a508871c9a7b2cf42f99428f65e96bfb0" - integrity sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q== - -array-back@^4.0.1, array-back@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/array-back/-/array-back-4.0.2.tgz#8004e999a6274586beeb27342168652fdb89fa1e" - integrity sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg== - array-differ@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" @@ -1490,11 +1480,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -builtins@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/builtins/-/builtins-1.0.3.tgz#cb94faeb61c8696451db36534e1422f94f0aee88" - integrity sha512-uYBjakWipfaO/bXI7E8rq6kpwHRZK5cNYrUv2OzZSI/FvmdMyXJ2tG9dKcjEC5YHmHpUAwsargWIZNWdxb/bnQ== - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1524,6 +1509,11 @@ caniuse-lite@^1.0.30001349: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001356.tgz#cbf5fe7b33f90962bfbca532212ea478d4ec9de8" integrity sha512-/30854bktMLhxtjieIxsrJBfs2gTM1pel6MXKF3K+RdIVJZcsn2A2QdhsuR4/p9+R204fZw0zCBBhktX8xWuyQ== +cargo-cp-artifact@0.1.9: + version "0.1.9" + resolved "https://registry.yarnpkg.com/cargo-cp-artifact/-/cargo-cp-artifact-0.1.9.tgz#32264a0a48109e26c48da334daff9a1da9d9b7c8" + integrity sha512-6F+UYzTaGB+awsTXg0uSJA1/b/B3DDJzpKVRu0UmyI7DmNeaAl2RFHuTGIN6fEgpadRxoXGb7gbC1xo4C3IdyA== + chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" @@ -1635,33 +1625,6 @@ color-support@^1.1.2: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== -command-line-args@^5.1.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/command-line-args/-/command-line-args-5.2.1.tgz#c44c32e437a57d7c51157696893c5909e9cec42e" - integrity sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg== - dependencies: - array-back "^3.1.0" - find-replace "^3.0.0" - lodash.camelcase "^4.3.0" - typical "^4.0.0" - -command-line-commands@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/command-line-commands/-/command-line-commands-3.0.2.tgz#53872a1181db837f21906b1228e260a4eeb42ee4" - integrity sha512-ac6PdCtdR6q7S3HN+JiVLIWGHY30PRYIEl2qPo+FuEuzwAUk0UYyimrngrg7FvF/mCr4Jgoqv5ZnHZgads50rw== - dependencies: - array-back "^4.0.1" - -command-line-usage@^6.1.0: - version "6.1.3" - resolved "https://registry.yarnpkg.com/command-line-usage/-/command-line-usage-6.1.3.tgz#428fa5acde6a838779dfa30e44686f4b6761d957" - integrity sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw== - dependencies: - array-back "^4.0.2" - chalk "^2.4.2" - table-layout "^1.0.2" - typical "^5.2.0" - commander@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/commander/-/commander-7.2.0.tgz#a36cb57d0b501ce108e4d20559a150a391d97ab7" @@ -1963,11 +1926,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-extend@~0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" - integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== - deep-is@~0.1.3: version "0.1.4" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" @@ -2321,13 +2279,6 @@ fill-range@^7.1.1: dependencies: to-regex-range "^5.0.1" -find-replace@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/find-replace/-/find-replace-3.0.0.tgz#3e7e23d3b05167a76f770c9fbd5258b0def68c38" - integrity sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ== - dependencies: - array-back "^3.0.1" - find-up@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" @@ -2465,13 +2416,6 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -git-config@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/git-config/-/git-config-0.0.7.tgz#a9c8a3ef07a776c3d72261356d8b727b62202b28" - integrity sha512-LidZlYZXWzVjS+M3TEwhtYBaYwLeOZrXci1tBgqp/vDdZTBMl02atvwb6G35L64ibscYoPnxfbwwUS+VZAISLA== - dependencies: - iniparser "~1.0.5" - git-raw-commits@^2.0.11, git-raw-commits@^2.0.8: version "2.0.11" resolved "https://registry.yarnpkg.com/git-raw-commits/-/git-raw-commits-2.0.11.tgz#bc3576638071d18655e1cc60d7f524920008d723" @@ -2560,7 +2504,7 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== -handlebars@4.7.7, handlebars@^4.7.6, handlebars@^4.7.7: +handlebars@^4.7.7: version "4.7.7" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1" integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA== @@ -2695,12 +2639,7 @@ ini@^1.3.2, ini@^1.3.4: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -iniparser@~1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/iniparser/-/iniparser-1.0.5.tgz#836d6befe6dfbfcee0bccf1cf9f2acc7027f783d" - integrity sha512-i40MWqgTU6h/70NtMsDVVDLjDYWwcIR1yIEVDPfxZIJno9z9L4s83p/V7vAu2i48Vj0gpByrkGFub7ko9XvPrw== - -inquirer@^7.0.0, inquirer@^7.3.3: +inquirer@^7.0.0: version "7.3.3" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== @@ -3441,11 +3380,6 @@ make-error@1.x, make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== -make-promises-safe@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/make-promises-safe/-/make-promises-safe-5.1.0.tgz#dd9d311f555bcaa144f12e225b3d37785f0aa8f2" - integrity sha512-AfdZ49rtyhQR/6cqVKGoH7y4ql7XkS5HJI1lZm0/5N6CQosy1eYbBJ/qbhkKHzo17UH7M918Bysf6XB9f3kS1g== - makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -3621,26 +3555,6 @@ neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== -neon-cli@0.10.1: - version "0.10.1" - resolved "https://registry.yarnpkg.com/neon-cli/-/neon-cli-0.10.1.tgz#9705b7b860550faffe6344fc9ab6f6e389c95ed6" - integrity sha512-kOd9ELaYETe1J1nBEOYD7koAZVj6xR9TGwOPccAsWmwL5amkaXXXwXHCUHkBAWujlgSZY5f2pT+pFGkzoHExYQ== - dependencies: - chalk "^4.1.0" - command-line-args "^5.1.1" - command-line-commands "^3.0.1" - command-line-usage "^6.1.0" - git-config "0.0.7" - handlebars "^4.7.6" - inquirer "^7.3.3" - make-promises-safe "^5.1.0" - rimraf "^3.0.2" - semver "^7.3.2" - toml "^3.0.0" - ts-typed-json "^0.3.2" - validate-npm-package-license "^3.0.4" - validate-npm-package-name "^3.0.0" - nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -4087,11 +4001,6 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -reduce-flatten@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27" - integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w== - regexpp@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" @@ -4209,7 +4118,7 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@7.5.4, semver@7.x, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5: +semver@7.5.4, semver@7.x, semver@^7.3.4, semver@^7.3.5: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== @@ -4476,16 +4385,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -table-layout@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/table-layout/-/table-layout-1.0.2.tgz#c4038a1853b0136d63365a734b6931cf4fad4a04" - integrity sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A== - dependencies: - array-back "^4.0.1" - deep-extend "~0.6.0" - typical "^5.2.0" - wordwrapjs "^4.0.0" - table@^5.2.3: version "5.4.6" resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" @@ -4597,11 +4496,6 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -toml@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/toml/-/toml-3.0.0.tgz#342160f1af1904ec9d204d03a5d61222d762c5ee" - integrity sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w== - tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" @@ -4656,11 +4550,6 @@ ts-node@^10.8.1: v8-compile-cache-lib "^3.0.1" yn "3.1.1" -ts-typed-json@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/ts-typed-json/-/ts-typed-json-0.3.2.tgz#f4f20f45950bae0a383857f7b0a94187eca1b56a" - integrity sha512-Tdu3BWzaer7R5RvBIJcg9r8HrTZgpJmsX+1meXMJzYypbkj8NK2oJN0yvm4Dp/Iv6tzFa/L5jKRmEVTga6K3nA== - tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -4726,16 +4615,6 @@ typescript@4.3.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78" integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w== -typical@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4" - integrity sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw== - -typical@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/typical/-/typical-5.2.0.tgz#4daaac4f2b5315460804f0acf6cb69c52bb93066" - integrity sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg== - uglify-js@^3.1.4: version "3.16.1" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.16.1.tgz#0e7ec928b3d0b1e1d952bce634c384fd56377317" @@ -4787,7 +4666,7 @@ v8-to-istanbul@^9.0.0: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^1.6.0" -validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: +validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== @@ -4795,13 +4674,6 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" -validate-npm-package-name@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz#5fa912d81eb7d0c74afc140de7317f0ca7df437e" - integrity sha512-M6w37eVCMMouJ9V/sdPGnC5H4uDr73/+xdq0FBLO3TFFX1+7wiUY6Es328NN+y43tmY+doUdN9g9J21vqB7iLw== - dependencies: - builtins "^1.0.3" - vscode-oniguruma@^1.6.1: version "1.6.2" resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.2.tgz#aeb9771a2f1dbfc9083c8a7fdd9cccaa3f386607" @@ -4868,14 +4740,6 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -wordwrapjs@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/wordwrapjs/-/wordwrapjs-4.0.1.tgz#d9790bccfb110a0fc7836b5ebce0937b37a8b98f" - integrity sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA== - dependencies: - reduce-flatten "^2.0.0" - typical "^5.2.0" - wrap-ansi@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09"