diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..2b783e3 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,84 @@ +version: 2.1 + +jobs: + build_ios: + macos: + xcode: 14.0.1 + environment: + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - checkout + - run: + name: Install Rust for MacOS + command: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + - run: + name: Add aarch64-apple-ios Target + command: rustup target add aarch64-apple-ios + - run: + name: Build for aarch64 iOS Debug + command: | + cd gotham-client + cargo rustc --crate-type staticlib --target aarch64-apple-ios --lib + - run: + name: Build for iOS Release + command: | + cd gotham-client + cargo rustc --crate-type staticlib --target aarch64-apple-ios --release --lib + - store_artifacts: + path: target/aarch64-apple-ios/debug/libclient_lib.a + destination: gotham-ios-debug/libclient_lib.a + - store_artifacts: + path: target/aarch64-apple-ios/release/libclient_lib.a + destination: gotham-ios-release/libclient_lib.a + + build_android_docker_image: + machine: + image: ubuntu-2204:2022.07.1 + steps: + - checkout + - run: + name: Build Docker Image + command: docker build -t gotham_android gotham-client/docker_images/android/ + - run: + name: Login to docker registry + command: docker login --username "${DOCKER_REG_USERNAME}" --password "${DOCKER_REG_PASSWORD}" "${DOCKER_REG_HOST}" + - run: + name: Set Tags + command: docker tag gotham_android:latest "${DOCKER_REG_HOST}"/"$DOCKER_REG_USERNAME"/gotham_android:latest + - run: + name: Push Image + command: docker image push --all-tags "${DOCKER_REG_HOST}"/"$DOCKER_REG_USERNAME"/gotham_android + + build_android: + docker: + - image: matanzengo/gotham_android:latest + resource_class: xlarge + steps: + - checkout + - run: + name: Build Debug Version + command: | + cd gotham-client + cargo ndk -p "${MIN_SDK_VERSION}" -t arm64-v8a -t armeabi-v7a -t x86_64 -o ./jniLibs_debug build + - run: + name: Build Release Version + command: | + cd gotham-client + cargo ndk -p "${MIN_SDK_VERSION}" -t arm64-v8a -t armeabi-v7a -t x86_64 -o ./jniLibs build --release + - store_artifacts: + path: gotham-client/jniLibs + destination: gotham-android-release + - store_artifacts: + path: gotham-client/jniLibs_debug + destination: gotham-android-debug + +workflows: + build_docker_image: + jobs: + - build_android_docker_image + build_ios: + jobs: + - build_ios + build_android: + jobs: + - build_android \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/-bug--bug-report.md b/.github/ISSUE_TEMPLATE/-bug--bug-report.md new file mode 100644 index 0000000..3722847 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/-bug--bug-report.md @@ -0,0 +1,34 @@ +--- +name: ":bug: Bug Report" +about: Create a bug report to help us improve the repo +title: "[BUG]:" +labels: bug, enhancement +assignees: '' + +--- + +## Description + +Please provide a clear and concise description of the bug. + +### Reproduce + +Please list the steps to reproduce the issue. + +## Expected Behavior + +Please provide a clear and concise description of what you expected to happen. + +## Environment + +Please complete the following information: + +OS + Version: + +Cargo Version: + +HW type: + +## Additional context + +Please provide any additional context that may be helpful in confirming and resolving this issue. diff --git a/.github/ISSUE_TEMPLATE/-sparkles--feature-request.md b/.github/ISSUE_TEMPLATE/-sparkles--feature-request.md new file mode 100644 index 0000000..ebfe905 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/-sparkles--feature-request.md @@ -0,0 +1,16 @@ +--- +name: ":sparkles: Feature Request" +about: Request the inclusion of a new feature or functionality +title: "[FEAT]: " +labels: enhancement +assignees: '' + +--- + +## Description + +Please provide a clear and concise description of the feature you would like included. + +## Motivation + +Please provide a clear and concise description of the motivation for adding this feature. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..243815a --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,29 @@ +## What type of PR is this? (check all applicable) + +- [ ] πŸ• Feature +- [ ] πŸ› Bug Fix +- [ ] πŸ“ Documentation Update +- [ ] πŸ§‘β€πŸ’» Code Refactor +- [ ] πŸ”₯ Performance Improvements +- [ ] βœ… Test +- [ ] πŸ” CI/CD +- [ ] πŸ“¦ Chore (Release) +- [ ] ⏩ Revert + +## Description + + + +## Related Tickets +Fixes # (issue) + + +## Added tests? + +- [ ] πŸ‘ yes +- [ ] πŸ™… no, because they aren't needed +- [ ] πŸ™‹ no, because I need help + diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..909d753 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +# Basic set up for two package managers + +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + + # Maintain dependencies for cargo + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/gotham-server-tests.yml b/.github/workflows/gotham-server-tests.yml new file mode 100644 index 0000000..6ba6b6a --- /dev/null +++ b/.github/workflows/gotham-server-tests.yml @@ -0,0 +1,64 @@ +name: Continuous Integration + +on: + push: + branches: + - master + paths: + - "gotham-server/**" + - "gotham-utilities/**" + - "integration-tests/**" + - "gotham-client/Cargo.toml" + - "Cargo.toml" + + pull_request: + branches: + - master + paths: + - "gotham-server/**" + - "gotham-utilities/**" + - "integration-tests/**" + - "gotham-client/Cargo.toml" + - "Cargo.toml" + + +jobs: + lints: + name: Lints + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + build-and-test: + name: Test Suite + runs-on: ubuntu-latest + needs: lints + steps: + - name: Checkout sources + uses: actions/checkout@v2 + + - name: Install stable toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable +# - run: cargo build --release + + - name: Unit tests + run: cargo test --all -- --nocapture + + + diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..b2b21c5 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,19 @@ +on: + push: + branches: + - master + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + with: + release-type: simple + package-name: gotham-city diff --git a/.gitignore b/.gitignore index cc96bb3..c48a67c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ Cargo.lock # These are backup files generated by rustfmt **/*.rs.bk .idea +.history \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 895a8bd..0000000 --- a/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: rust -cache: cargo -rust: - - nightly-2021-05-10 - -script: - - cd integration-tests - - cargo test --verbose diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..be81a25 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,24 @@ +[workspace] +members = [ + "gotham-server", + "gotham-client", + "integration-tests", +] + +[workspace.dependencies] +gotham-server = { path = "gotham-server" } +gotham-client = { path = "gotham-client" } +serde = { version = "1", features = ["serde_derive"] } +serde_json = "1" +log = "0.4" +reqwest = "0.9.5" +failure = "0.1" +floating-duration = "0.1.2" +rocket = { version = "0.5.0-rc.1", default-features = false, features=["json"]} +config = "0.9.2" +uuid = { version = "0.7", features = ["v4"] } +jsonwebtoken = "8" +hex = "0.4" + +two-party-ecdsa = { git = "https://github.com/ZenGo-X/two-party-ecdsa.git" } +kms = { git = "https://github.com/ZenGo-X/kms-secp256k1.git", branch = "2.0" } diff --git a/LICENSE b/LICENSE index f288702..9e650ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,674 +1,8 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 +Copyright Β© 2023 ZenGo Ltd. All rights reserved. - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. +The source code of this program is intended solely for review purposes, subject to the express restrictions set forth below: - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. +No license or permission is granted for any use of this code. +Any unauthorized use or reproduction of the code is strictly prohibited. +Unless expellee permitted otherwise in writing by Zengo Ltd., you may not use, adapt, translate, copy, convert, rent, lease, loan, disassemble, decompile, reverse engineer, sell, license, sublicense, publish, display, distribute, disseminate, assign, provide access to, copy, make available for copy, reproduce, transfer or otherwise make any action on or in all and any part of the program. +You may not alter, remove, or obscure any copyright, trade secret, patent, trademark, logo, proprietary and/or other legal notices on or in the program, or use ZenGo’s name, trade names, logos, or other trademarks of ZenGo or any of its affiliates or licensors in any advertising, promotional literature or any other material. \ No newline at end of file diff --git a/gotham-client/Cargo.toml b/gotham-client/Cargo.toml index 91e509f..d726d3f 100644 --- a/gotham-client/Cargo.toml +++ b/gotham-client/Cargo.toml @@ -1,61 +1,32 @@ [package] name = "gotham-client" -version = "0.1.4" +version = "0.1.0" authors = [ "gbenattar ", "Oded Leiba PrivateShare { +pub fn get_master_key(client_shim: &ClientShim) -> PrivateShare { let start = Instant::now(); let (id, kg_party_one_first_message): (String, party_one::KeyGenFirstMsg) = - requests::post(client_shim, &format!("{}/first", KG_PATH_PRE)).unwrap(); + client_shim.post(&format!("{}/first", KG_PATH_PRE)).unwrap(); let (kg_party_two_first_message, kg_ec_key_pair_party2) = MasterKey2::key_gen_first_message(); let body = &kg_party_two_first_message.d_log_proof; - let kg_party_one_second_message: party1::KeyGenParty1Message2 = - requests::postb(client_shim, &format!("{}/{}/second", KG_PATH_PRE, id), body).unwrap(); + let kg_party_one_second_message: party1::KeyGenParty1Message2 = client_shim + .postb(&format!("{}/{}/second", KG_PATH_PRE, id), body) + .unwrap(); let key_gen_second_message = MasterKey2::key_gen_second_message( &kg_party_one_first_message, &kg_party_one_second_message, - SALT_STRING, ); - let (_, party_two_paillier) = + let (party_two_second_message, party_two_paillier, party_two_pdl_chal) = key_gen_second_message.unwrap(); - let cc_party_one_first_message: Party1FirstMessage = requests::post( - client_shim, - &format!("{}/{}/chaincode/first", KG_PATH_PRE, id), + let body = &party_two_second_message.pdl_first_message; + + let party_one_third_message: party_one::PDLFirstMessage = client_shim + .postb(&format!("{}/{}/third", KG_PATH_PRE, id), body) + .unwrap(); + + let pdl_decom_party2 = MasterKey2::key_gen_third_message(&party_two_pdl_chal); + + let party_2_pdl_second_message = pdl_decom_party2; + + let body = &party_2_pdl_second_message; + + let party_one_pdl_second_message: party_one::PDLSecondMessage = client_shim + .postb(&format!("{}/{}/fourth", KG_PATH_PRE, id), body) + .unwrap(); + + MasterKey2::key_gen_fourth_message( + &party_two_pdl_chal, + &party_one_third_message, + &party_one_pdl_second_message, ) - .unwrap(); + .expect("pdl error party1"); + + let cc_party_one_first_message: Party1FirstMessage = client_shim + .post(&format!("{}/{}/chaincode/first", KG_PATH_PRE, id)) + .unwrap(); let (cc_party_two_first_message, cc_ec_key_pair2) = chain_code::party2::ChainCode2::chain_code_first_message(); let body = &cc_party_two_first_message.d_log_proof; - let cc_party_one_second_message: Party1SecondMessage = requests::postb( - client_shim, - &format!("{}/{}/chaincode/second", KG_PATH_PRE, id), - body, - ) - .unwrap(); + let cc_party_one_second_message: Party1SecondMessage = client_shim + .postb(&format!("{}/{}/chaincode/second", KG_PATH_PRE, id), body) + .unwrap(); let cc_party_two_second_message = chain_code::party2::ChainCode2::chain_code_second_message( &cc_party_one_first_message, @@ -92,23 +115,28 @@ pub fn get_master_key(client_shim: &ClientShim) -> PrivateShare { &party_two_paillier, ); - println!("(id: {}) Took: {}", id, TimeFormat(start.elapsed())); + println!("(id: {}) Took: {:?}", id, TimeFormat(start.elapsed())); PrivateShare { id, master_key } } +/// # Safety +/// +/// - This function should only be called with valid C pointers. +/// - Arguments are accessed in arbitrary locations. +/// - Strings should be null terminated array of bytes. #[no_mangle] -pub extern "C" fn get_client_master_key( +pub unsafe extern "C" fn get_client_master_key( c_endpoint: *const c_char, c_auth_token: *const c_char, ) -> *mut c_char { - let raw_endpoint = unsafe { CStr::from_ptr(c_endpoint) }; + let raw_endpoint = CStr::from_ptr(c_endpoint); let endpoint = match raw_endpoint.to_str() { Ok(s) => s, Err(_) => panic!("Error while decoding raw endpoint"), }; - let raw_auth_token = unsafe { CStr::from_ptr(c_auth_token) }; + let raw_auth_token = CStr::from_ptr(c_auth_token); let auth_token = match raw_auth_token.to_str() { Ok(s) => s, Err(_) => panic!("Error while decoding auth token"), @@ -123,7 +151,91 @@ pub extern "C" fn get_client_master_key( Err(_) => panic!("Error while performing keygen to endpoint {}", endpoint), }; - CString::new(private_share_json.to_owned()) - .unwrap() - .into_raw() + CString::new(private_share_json).unwrap().into_raw() +} + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_getClientMasterKey( + env: JNIEnv, + // this is the class that owns our + // static method. Not going to be + // used, but still needs to have an + // argument slot + _class: JClass, + j_endpoint: JString, + j_auth_token: JString, +) -> jstring { + // Convert j_endpoint JString to &str + let JavaStr_endpoint = match env.get_string(j_endpoint) { + Ok(java_endpoint) => java_endpoint, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in getClientMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let endpoint = match JavaStr::deref(&JavaStr_endpoint).to_str() { + Ok(endpoint) => endpoint, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in getClientMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + // Convert j_auth_token JString to &str + let JavaStr_auth_token = match env.get_string(j_auth_token) { + Ok(java_auth_token) => java_auth_token, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in getClientMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + let auth_token = match JavaStr::deref(&JavaStr_auth_token).to_str() { + Ok(auth_token) => auth_token, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in getClientMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let client_shim = ClientShim::new(endpoint.to_string(), Some(auth_token.to_string())); + + let private_share: PrivateShare = get_master_key(&client_shim); + + let private_share_json = match serde_json::to_string(&private_share) { + Ok(share) => share.to_owned(), + Err(e) => { + return env + .new_string(format!( + "Error from Rust in getClientMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + env.new_string(private_share_json).unwrap().into_inner() } diff --git a/gotham-client/src/ecdsa/mod.rs b/gotham-client/src/ecdsa/mod.rs index 815beba..a77a1c3 100644 --- a/gotham-client/src/ecdsa/mod.rs +++ b/gotham-client/src/ecdsa/mod.rs @@ -7,12 +7,10 @@ // version 3 of the License, or (at your option) any later version. // pub mod keygen; -pub mod rotate; +pub mod recover; pub mod sign; pub mod types; -pub mod recover; pub use keygen::get_master_key; -pub use rotate::rotate_master_key; pub use sign::sign; pub use types::PrivateShare; diff --git a/gotham-client/src/ecdsa/recover.rs b/gotham-client/src/ecdsa/recover.rs index 9ba26c5..cc675dc 100644 --- a/gotham-client/src/ecdsa/recover.rs +++ b/gotham-client/src/ecdsa/recover.rs @@ -8,36 +8,45 @@ // use kms::ecdsa::two_party::{MasterKey1, MasterKey2}; -use serde_json; -use centipede::juggling::segmentation::Msegmentation; -use centipede::juggling::proof_system::Helgamalsegmented; -use curv::elliptic::curves::traits::{ECScalar, ECPoint}; -use crate::curv::arithmetic::{Converter, Modulo}; -use curv::elliptic::curves::secp256_k1::{FE, GE}; -use curv::BigInt; use serde_json::Error; +use two_party_ecdsa::centipede::juggling::proof_system::Helgamalsegmented; +use two_party_ecdsa::centipede::juggling::segmentation::Msegmentation; +use two_party_ecdsa::curv::arithmetic::traits::{Converter, Modulo}; +use two_party_ecdsa::curv::elliptic::curves::secp256_k1::{FE, GE}; +use two_party_ecdsa::curv::elliptic::curves::traits::{ECPoint, ECScalar}; +use two_party_ecdsa::curv::BigInt; // iOS bindings use std::ffi::{CStr, CString}; use std::os::raw::c_char; +//Android bindings +#[cfg(target_os = "android")] +use jni::{ + objects::{JClass, JString}, + strings::JavaStr, + sys::{jint, jstring}, + JNIEnv, +}; +use std::ops::Deref; + #[no_mangle] #[allow(non_snake_case)] pub extern "C" fn decrypt_party_one_master_key( c_master_key_two_json: *const c_char, c_helgamal_segmented_json: *const c_char, - c_private_key: *const c_char + c_private_key: *const c_char, ) -> *mut c_char { let segment_size = 8; // This is hardcoded on both client and server side let G: GE = GE::generator(); - let party_two_master_key: MasterKey2 = serde_json::from_str( - &get_str_from_c_char(c_master_key_two_json)).unwrap(); + let party_two_master_key: MasterKey2 = + serde_json::from_str(&get_str_from_c_char(c_master_key_two_json)).unwrap(); - let encryptions_secret_party1 : Helgamalsegmented = serde_json::from_str( - &get_str_from_c_char(c_helgamal_segmented_json)).unwrap(); + let encryptions_secret_party1: Helgamalsegmented = + serde_json::from_str(&get_str_from_c_char(c_helgamal_segmented_json)).unwrap(); - let y_b : Result = serde_json::from_str(&get_str_from_c_char(c_private_key)); + let y_b: Result = serde_json::from_str(&get_str_from_c_char(c_private_key)); if y_b.is_err() { // Invalid BigInt Private key return CString::new("").unwrap().into_raw(); @@ -45,17 +54,16 @@ pub extern "C" fn decrypt_party_one_master_key( let y: FE = ECScalar::from(&y_b.unwrap()); - let r = Msegmentation::decrypt( - &encryptions_secret_party1, &G, &y, &segment_size); + let r = Msegmentation::decrypt(&encryptions_secret_party1, &G, &y, &segment_size); - if r.is_ok() { - let party_one_master_key_recovered = party_two_master_key - .counter_master_key_from_recovered_secret(r.unwrap().clone()); + if let Ok(v) = r { + let party_one_master_key_recovered = + party_two_master_key.counter_master_key_from_recovered_secret(v); let s = serde_json::to_string(&party_one_master_key_recovered).unwrap(); - return CString::new(s).unwrap().into_raw(); + CString::new(s).unwrap().into_raw() } else { - return CString::new("").unwrap().into_raw(); + CString::new("").unwrap().into_raw() } } @@ -63,10 +71,10 @@ pub extern "C" fn decrypt_party_one_master_key( pub extern "C" fn get_child_mk1( c_master_key_one_json: *const c_char, c_x_pos: i32, - c_y_pos: i32 + c_y_pos: i32, ) -> *mut c_char { - let party_one_master_key: MasterKey1 = serde_json::from_str( - &get_str_from_c_char(c_master_key_one_json)).unwrap(); + let party_one_master_key: MasterKey1 = + serde_json::from_str(&get_str_from_c_char(c_master_key_one_json)).unwrap(); let x: BigInt = BigInt::from(c_x_pos); @@ -79,17 +87,17 @@ pub extern "C" fn get_child_mk1( Err(_) => panic!("Error while get_child_mk1"), }; - CString::new(derived_mk1_json.to_owned()).unwrap().into_raw() + CString::new(derived_mk1_json).unwrap().into_raw() } #[no_mangle] pub extern "C" fn get_child_mk2( c_master_key_two_json: *const c_char, c_x_pos: i32, - c_y_pos: i32 + c_y_pos: i32, ) -> *mut c_char { - let party_two_master_key: MasterKey2 = serde_json::from_str( - &get_str_from_c_char(c_master_key_two_json)).unwrap(); + let party_two_master_key: MasterKey2 = + serde_json::from_str(&get_str_from_c_char(c_master_key_two_json)).unwrap(); let x: BigInt = BigInt::from(c_x_pos); @@ -102,17 +110,17 @@ pub extern "C" fn get_child_mk2( Err(_) => panic!("Error while get_child_mk1"), }; - CString::new(derived_mk2_json.to_owned()).unwrap().into_raw() + CString::new(derived_mk2_json).unwrap().into_raw() } #[no_mangle] pub extern "C" fn construct_single_private_key( c_mk1_x1: *const c_char, - c_mk2_x2: *const c_char + c_mk2_x2: *const c_char, ) -> *mut c_char { - let mk1_x1: BigInt = BigInt::from_hex(&get_str_from_c_char(c_mk1_x1)).unwrap(); + let mk1_x1: BigInt = BigInt::from_hex(&get_str_from_c_char(c_mk1_x1)); - let mk2_x2: BigInt = BigInt::from_hex(&get_str_from_c_char(c_mk2_x2)).unwrap(); + let mk2_x2: BigInt = BigInt::from_hex(&get_str_from_c_char(c_mk2_x2)); let sk = BigInt::mod_mul(&mk1_x1, &mk2_x2, &FE::q()); @@ -121,7 +129,7 @@ pub extern "C" fn construct_single_private_key( Err(_) => panic!("Error while construct_single_private_key"), }; - CString::new(sk_json.to_owned()).unwrap().into_raw() + CString::new(sk_json).unwrap().into_raw() } fn get_str_from_c_char(c: *const c_char) -> String { @@ -133,3 +141,248 @@ fn get_str_from_c_char(c: *const c_char) -> String { s.to_string() } + +//Android extern functions + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_decryptPartyOneMasterKey( + env: JNIEnv, + _class: JClass, + j_master_key_two_json: JString, + j_helgamal_segmented_json: JString, + j_private_key: JString, +) -> jstring { + let segment_size = 8; // This is hardcoded on both client and server side + + let G: GE = GE::generator(); + + let master_key_two = match get_String_from_JString(&env, j_master_key_two_json) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in decryptPartyOneMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let party_two_master_key: MasterKey2 = serde_json::from_str(&master_key_two).unwrap(); + + let helgamal_segmented = match get_String_from_JString(&env, j_helgamal_segmented_json) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in decryptPartyOneMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let encryptions_secret_party1: Helgamalsegmented = + serde_json::from_str(&helgamal_segmented).unwrap(); + + let private_key = match get_String_from_JString(&env, j_private_key) { + Ok(s) => s.to_owned(), + Err(e) => { + return env + .new_string(format!( + "Error from Rust in decryptPartyOneMasterKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let y_b: Result = serde_json::from_str(&private_key); + if y_b.is_err() { + // Invalid BigInt Private key + return env + .new_string(format!("Error from Rust in decryptPartyOneMasterKey: ")) + .unwrap() + .into_inner(); + } + + let y: FE = ECScalar::from(&y_b.unwrap()); + + let r = Msegmentation::decrypt(&encryptions_secret_party1, &G, &y, &segment_size); + + if r.is_ok() { + let party_one_master_key_recovered = + party_two_master_key.counter_master_key_from_recovered_secret(r.unwrap().clone()); + + let s = serde_json::to_string(&party_one_master_key_recovered).unwrap(); + return env.new_string(s).unwrap().into_inner(); + } else { + return env + .new_string(format!("Error from Rust in decryptPartyOneMasterKey: ")) + .unwrap() + .into_inner(); + } +} + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_getChildMk2( + env: JNIEnv, + _class: JClass, + j_master_key_two_json: JString, + j_x_pos: jint, + j_y_pos: jint, +) -> jstring { + let master_key_two = match get_String_from_JString(&env, j_master_key_two_json) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in get_child_mk2: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let party_two_master_key: MasterKey2 = serde_json::from_str(&master_key_two).unwrap(); + + let x: BigInt = BigInt::from(j_x_pos); + + let y: BigInt = BigInt::from(j_y_pos); + + let derived_mk2 = party_two_master_key.get_child(vec![x, y]); + + let derived_mk2_json = match serde_json::to_string(&derived_mk2) { + Ok(share) => share, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in get_child_mk2: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + env.new_string(derived_mk2_json).unwrap().into_inner() +} + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_getChildMk1( + env: JNIEnv, + _class: JClass, + j_master_key_one_json: JString, + j_x_pos: jint, + j_y_pos: jint, +) -> jstring { + let master_key_one = match get_String_from_JString(&env, j_master_key_one_json) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in get_child_mk1: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + let party_one_master_key: MasterKey1 = serde_json::from_str(&master_key_one).unwrap(); + + let x: BigInt = BigInt::from(j_x_pos); + + let y: BigInt = BigInt::from(j_y_pos); + + let derived_mk1 = party_one_master_key.get_child(vec![x, y]); + + let derived_mk1_json = match serde_json::to_string(&derived_mk1) { + Ok(share) => share, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in get_child_mk1: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + + env.new_string(derived_mk1_json).unwrap().into_inner() +} + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_constructSinglePrivateKey( + env: JNIEnv, + _class: JClass, + j_mk1_x1: JString, + j_mk2_x2: JString, +) -> jstring { + let mk1_x1_string = match get_String_from_JString(&env, j_mk1_x1) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in constructSinglePrivateKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + let mk2_x2_string = match get_String_from_JString(&env, j_mk2_x2) { + Ok(s) => s, + Err(e) => { + return env + .new_string(format!( + "Error from Rust in constructSinglePrivateKey: {}", + e.to_string() + )) + .unwrap() + .into_inner() + } + }; + let mk1_x1 = BigInt::from_hex(&mk1_x1_string); + let mk2_x2 = BigInt::from_hex(&mk2_x2_string); + let sk = BigInt::mod_mul(&mk1_x1, &mk2_x2, &FE::q()); + + let sk_json = match serde_json::to_string(&sk) { + Ok(share) => share, + Err(e) => format!( + "Error from Rust in constructSinglePrivateKey: {}", + e.to_string() + ), + }; + + env.new_string(sk_json).unwrap().into_inner() +} + +#[cfg(target_os = "android")] +#[allow(non_snake_case)] +fn get_String_from_JString(env: &JNIEnv, j_string: JString) -> Result { + let java_str_string = match env.get_string(j_string) { + Ok(java_string) => java_string, + Err(e) => unimplemented!(), + }; + + let string_ref = match JavaStr::deref(&java_str_string).to_str() { + Ok(string_ref) => string_ref, + Err(e) => unimplemented!(), + }; + + Ok(string_ref.to_string()) +} diff --git a/gotham-client/src/ecdsa/rotate.rs b/gotham-client/src/ecdsa/rotate.rs index d846e53..cadaccf 100644 --- a/gotham-client/src/ecdsa/rotate.rs +++ b/gotham-client/src/ecdsa/rotate.rs @@ -7,23 +7,21 @@ // version 3 of the License, or (at your option) any later version. // use super::types::PrivateShare; -use super::super::utilities::requests; use super::super::wallet; use super::super::ClientShim; use curv::cryptographic_primitives::twoparty::coin_flip_optimal_rounds; -use curv::elliptic::curves::secp256_k1::GE; - +use kms::ecdsa::two_party::MasterKey2; use kms::ecdsa::two_party::*; use kms::rotation::two_party::party2::Rotation2; -use zk_paillier::zkproofs::SALT_STRING; +use multi_party_ecdsa::protocols::two_party_ecdsa::lindell_2017::*; use std::collections::HashMap; const ROT_PATH_PRE: &str = "ecdsa/rotate"; -pub fn rotate_master_key(wallet: wallet::Wallet, client_shim: &ClientShim) -> wallet::Wallet { +pub fn rotate_master_key(wallet: wallet::Wallet, client_shim: &ClientShim) -> wallet::Wallet { let id = &wallet.private_share.id.clone(); - let coin_flip_party1_first_message: coin_flip_optimal_rounds::Party1FirstMessage = - requests::post(client_shim, &format!("{}/{}/first", ROT_PATH_PRE, id)).unwrap(); + let coin_flip_party1_first_message: coin_flip_optimal_rounds::Party1FirstMessage = + client_shim.post(&format!("{}/{}/first", ROT_PATH_PRE, id)).unwrap(); let coin_flip_party2_first_message = Rotation2::key_rotate_first_message(&coin_flip_party1_first_message); @@ -31,11 +29,10 @@ pub fn rotate_master_key(wallet: wallet::Wallet, client_shim: &ClientShim) -> wa let body = &coin_flip_party2_first_message; let (coin_flip_party1_second_message, rotation_party1_first_message): ( - coin_flip_optimal_rounds::Party1SecondMessage, + coin_flip_optimal_rounds::Party1SecondMessage, party1::RotationParty1Message1, - ) = requests::postb( - client_shim, - &format!("{}/{}/second", ROT_PATH_PRE, id.clone()), + ) = client_shim.postb( + &format!("{}/{}/second", ROT_PATH_PRE, id), body, ) .unwrap(); @@ -46,16 +43,48 @@ pub fn rotate_master_key(wallet: wallet::Wallet, client_shim: &ClientShim) -> wa &coin_flip_party1_first_message, ); - let result_masterkey2_new = wallet + let result_rotate_party_one_first_message = wallet .private_share .master_key - .rotate_first_message(&random2, &rotation_party1_first_message, SALT_STRING); - if result_masterkey2_new.is_err() { + .rotate_first_message(&random2, &rotation_party1_first_message); + if result_rotate_party_one_first_message.is_err() { + panic!("rotation failed"); + } + + let (rotation_party_two_first_message, party_two_pdl_chal, party_two_paillier) = + result_rotate_party_one_first_message.unwrap(); + + let body = &rotation_party_two_first_message; + + let rotation_party1_second_message: party_one::PDLFirstMessage = client_shim.postb( + &format!("{}/{}/third", ROT_PATH_PRE, id), + body, + ) + .unwrap(); + + let rotation_party_two_second_message = MasterKey2::rotate_second_message(&party_two_pdl_chal); + + let body = &rotation_party_two_second_message; + + let rotation_party1_third_message: party_one::PDLSecondMessage = client_shim.postb( + &format!("{}/{}/fourth", ROT_PATH_PRE, id), + body, + ) + .unwrap(); + + let result_rotate_party_one_third_message = + wallet.private_share.master_key.rotate_third_message( + &random2, + &party_two_paillier, + &party_two_pdl_chal, + &rotation_party1_second_message, + &rotation_party1_third_message, + ); + if result_rotate_party_one_third_message.is_err() { panic!("rotation failed"); } - let party_two_master_key_rotated = - result_masterkey2_new.unwrap(); + let party_two_master_key_rotated = result_rotate_party_one_third_message.unwrap(); let private_share = PrivateShare { id: wallet.private_share.id.clone(), @@ -67,7 +96,7 @@ pub fn rotate_master_key(wallet: wallet::Wallet, client_shim: &ClientShim) -> wa id: wallet.id.clone(), network: wallet.network.clone(), private_share, - last_derived_pos: wallet.last_derived_pos.clone(), + last_derived_pos: wallet.last_derived_pos, addresses_derivation_map, }; wallet_after_rotate.derived(); diff --git a/gotham-client/src/ecdsa/sign.rs b/gotham-client/src/ecdsa/sign.rs index 1f3f4b9..509644a 100644 --- a/gotham-client/src/ecdsa/sign.rs +++ b/gotham-client/src/ecdsa/sign.rs @@ -1,17 +1,21 @@ -use curv::BigInt; -use kms::ecdsa::two_party::party2; -use kms::ecdsa::two_party::MasterKey2; -use multi_party_ecdsa::protocols::two_party_ecdsa::lindell_2017::party_one; -use multi_party_ecdsa::protocols::two_party_ecdsa::lindell_2017::party_two; - -use super::super::utilities::requests; -use super::super::utilities::error_to_c_string; -use super::super::Result; -use super::super::ClientShim; - +use failure::format_err; +use kms::ecdsa::two_party::{party2, MasterKey2}; +use serde::{Deserialize, Serialize}; +use two_party_ecdsa::{curv::BigInt, party_one, party_two}; // iOS bindings use std::ffi::{CStr, CString}; use std::os::raw::c_char; +//Android bindings +#[cfg(target_os = "android")] +use jni::{ + objects::{JClass, JString}, + strings::JavaStr, + sys::{jint, jstring}, + JNIEnv, +}; +use std::ops::Deref; + +use crate::{utilities::error_to_c_string, Client, ClientShim, Result}; #[derive(Serialize, Deserialize, Debug)] pub struct SignSecondMsgRequest { @@ -21,27 +25,27 @@ pub struct SignSecondMsgRequest { pub y_pos_child_key: BigInt, } -pub fn sign( - client_shim: &ClientShim, +pub fn sign( + client_shim: &ClientShim, message: BigInt, mk: &MasterKey2, x_pos: BigInt, y_pos: BigInt, - id: &String, + id: &str, ) -> Result { let (eph_key_gen_first_message_party_two, eph_comm_witness, eph_ec_key_pair_party2) = MasterKey2::sign_first_message(); let request: party_two::EphKeyGenFirstMsg = eph_key_gen_first_message_party_two; let sign_party_one_first_message: party_one::EphKeyGenFirstMsg = - match requests::postb(client_shim, &format!("/ecdsa/sign/{}/first", id), &request) { + match client_shim.postb(&format!("/ecdsa/sign/{}/first", id), &request) { Some(s) => s, - None => return Err(failure::err_msg("party1 sign first message request failed")) + None => return Err(failure::err_msg("party1 sign first message request failed")), }; let party_two_sign_message = mk.sign_second_message( &eph_ec_key_pair_party2, - eph_comm_witness.clone(), + eph_comm_witness, &sign_party_one_first_message, &message, ); @@ -52,22 +56,22 @@ pub fn sign( party_two_sign_message, x_pos, y_pos, - &id, + id, ) { Ok(s) => s, - Err(e) => return Err(format_err!("ecdsa::get_signature failed failed: {}", e)) + Err(e) => return Err(format_err!("ecdsa::get_signature failed failed: {}", e)), }; Ok(signature) } -fn get_signature( - client_shim: &ClientShim, +fn get_signature( + client_shim: &ClientShim, message: BigInt, party_two_sign_message: party2::SignMessage, x_pos_child_key: BigInt, y_pos_child_key: BigInt, - id: &String, + id: &str, ) -> Result { let request: SignSecondMsgRequest = SignSecondMsgRequest { message, @@ -77,16 +81,25 @@ fn get_signature( }; let signature: party_one::SignatureRecid = - match requests::postb(client_shim, &format!("/ecdsa/sign/{}/second", id), &request) { + match client_shim.postb(&format!("/ecdsa/sign/{}/second", id), &request) { Some(s) => s, - None => return Err(failure::err_msg("party1 sign second message request failed")) + None => { + return Err(failure::err_msg( + "party1 sign second message request failed", + )) + } }; Ok(signature) } +/// # Safety +/// +/// - This function should only be called with valid C pointers. +/// - Arguments are accessed in arbitrary locations. +/// - Strings should be null terminated array of bytes. #[no_mangle] -pub extern "C" fn sign_message( +pub unsafe extern "C" fn sign_message( c_endpoint: *const c_char, c_auth_token: *const c_char, c_message_le_hex: *const c_char, @@ -95,34 +108,36 @@ pub extern "C" fn sign_message( c_y_pos: i32, c_id: *const c_char, ) -> *mut c_char { - let raw_endpoint = unsafe { CStr::from_ptr(c_endpoint) }; + let raw_endpoint = CStr::from_ptr(c_endpoint); let endpoint = match raw_endpoint.to_str() { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw endpoint failed: {}", e)) + Err(e) => return error_to_c_string(format_err!("decoding raw endpoint failed: {}", e)), }; - let raw_auth_token = unsafe { CStr::from_ptr(c_auth_token) }; + let raw_auth_token = CStr::from_ptr(c_auth_token); let auth_token = match raw_auth_token.to_str() { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw auth_token failed: {}", e)) + Err(e) => return error_to_c_string(format_err!("decoding raw auth_token failed: {}", e)), }; - let raw_message_hex = unsafe { CStr::from_ptr(c_message_le_hex) }; + let raw_message_hex = CStr::from_ptr(c_message_le_hex); let message_hex = match raw_message_hex.to_str() { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw message_hex failed: {}", e)) + Err(e) => return error_to_c_string(format_err!("decoding raw message_hex failed: {}", e)), }; - let raw_master_key_json = unsafe { CStr::from_ptr(c_master_key_json) }; + let raw_master_key_json = CStr::from_ptr(c_master_key_json); let master_key_json = match raw_master_key_json.to_str() { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw master_key_json failed: {}", e)) + Err(e) => { + return error_to_c_string(format_err!("decoding raw master_key_json failed: {}", e)) + } }; - let raw_id = unsafe { CStr::from_ptr(c_id) }; + let raw_id = CStr::from_ptr(c_id); let id = match raw_id.to_str() { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw id failed: {}", e)) + Err(e) => return error_to_c_string(format_err!("decoding raw id failed: {}", e)), }; let x: BigInt = BigInt::from(c_x_pos); @@ -137,22 +152,188 @@ pub extern "C" fn sign_message( let message: BigInt = serde_json::from_str(message_hex).unwrap(); - let sig = match sign( - &client_shim, - message, - &mk_child, - x, - y, - &id.to_string(), - ) { + let sig = match sign(&client_shim, message, &mk_child, x, y, id) { + Ok(s) => s, + Err(e) => { + return error_to_c_string(format_err!( + "signing to endpoint {} failed: {}", + endpoint, + e + )) + } + }; + + let signature_json = match serde_json::to_string(&sig) { + Ok(share) => share, + Err(e) => { + return error_to_c_string(format_err!( + "signing to endpoint {} failed: {}", + endpoint, + e + )) + } + }; + + CString::new(signature_json).unwrap().into_raw() +} + +#[cfg(target_os = "android")] +#[no_mangle] +#[allow(non_snake_case)] +pub extern "C" fn Java_com_zengo_components_kms_gotham_ECDSA_signMessage( + env: JNIEnv, + // this is the class that owns our + // static method. Not going to be + // used, but still needs to have an + // argument slot + _class: JClass, + j_endpoint: JString, + j_auth_token: JString, + j_message_le_hex: JString, + j_master_key_json: JString, + j_x_pos: jint, + j_y_pos: jint, + j_id: JString, +) -> jstring { + /************************ START CONVERSION ************************/ + + //Convert endpoint + let JavaStr_endpoint = match env.get_string(j_endpoint) { + Ok(java_endpoint) => java_endpoint, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + let endpoint = match JavaStr::deref(&JavaStr_endpoint).to_str() { + Ok(endpoint) => endpoint, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + //Convert auth_token + let JavaStr_auth_token = match env.get_string(j_auth_token) { + Ok(java_auth_token) => java_auth_token, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + let auth_token = match JavaStr::deref(&JavaStr_auth_token).to_str() { + Ok(auth_token) => auth_token, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + //Convert message_le_hex + let JavaStr_message_le_hex = match env.get_string(j_message_le_hex) { + Ok(java_message_le_hex) => java_message_le_hex, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + let message_le_hex = match JavaStr::deref(&JavaStr_message_le_hex).to_str() { + Ok(message_le_hex) => message_le_hex, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + //Convert master_key_json + let JavaStr_master_key_json = match env.get_string(j_master_key_json) { + Ok(java_master_key_json) => java_master_key_json, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + let master_key_json = match JavaStr::deref(&JavaStr_master_key_json).to_str() { + Ok(master_key_json) => master_key_json, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + //Convert x_pos + let x: BigInt = BigInt::from(j_x_pos); + + //Convert y_pos + let y: BigInt = BigInt::from(j_y_pos); + + //Convert id + let JavaStr_id = match env.get_string(j_id) { + Ok(java_id) => java_id, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + let id = match JavaStr::deref(&JavaStr_id).to_str() { + Ok(id) => id, + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } + }; + + /************************ END CONVERSION ************************/ + + let client_shim = ClientShim::new(endpoint.to_string(), Some(auth_token.to_string())); + + let mk: MasterKey2 = serde_json::from_str(master_key_json).unwrap(); + + let mk_child: MasterKey2 = mk.get_child(vec![x.clone(), y.clone()]); + + let message: BigInt = serde_json::from_str(message_le_hex).unwrap(); + + let sig = match sign(&client_shim, message, &mk_child, x, y, &id.to_string()) { Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("signing to endpoint {} failed: {}", endpoint, e)) + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } }; let signature_json = match serde_json::to_string(&sig) { Ok(share) => share, - Err(e) => return error_to_c_string(format_err!("signing to endpoint {} failed: {}", endpoint, e)), + Err(e) => { + return env + .new_string(format!("Error from Rust in signMessage: {}", e.to_string())) + .unwrap() + .into_inner() + } }; - CString::new(signature_json.to_owned()).unwrap().into_raw() + env.new_string(signature_json).unwrap().into_inner() } diff --git a/gotham-client/src/ecdsa/types.rs b/gotham-client/src/ecdsa/types.rs index 7a59840..241afa4 100644 --- a/gotham-client/src/ecdsa/types.rs +++ b/gotham-client/src/ecdsa/types.rs @@ -1,10 +1,11 @@ use kms::ecdsa::two_party::MasterKey2; -use curv::BigInt; +use serde::{Deserialize, Serialize}; +use two_party_ecdsa::curv::BigInt; #[derive(Serialize, Deserialize)] pub struct PrivateShare { pub id: String, - pub master_key: MasterKey2 + pub master_key: MasterKey2, } impl PrivateShare { @@ -12,7 +13,7 @@ impl PrivateShare { let child_key = self.master_key.get_child(path); PrivateShare { id: self.id.clone(), - master_key: child_key + master_key: child_key, } } -} \ No newline at end of file +} diff --git a/gotham-client/src/eddsa/keygen.rs b/gotham-client/src/eddsa/keygen.rs deleted file mode 100644 index 8500177..0000000 --- a/gotham-client/src/eddsa/keygen.rs +++ /dev/null @@ -1,76 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// - -use super::super::utilities::requests; -use super::super::Result; -use super::super::ClientShim; - -use curv::elliptic::curves::ed25519::{FE, GE}; -use curv::BigInt; -// iOS bindings -use std::ffi::{CStr, CString}; -use std::os::raw::c_char; - -use multi_party_eddsa::protocols::aggsig::*; - -const PARTY2_INDEX: usize = 1; // client (self) - -pub fn generate_key(client_shim: &ClientShim) -> Result<(KeyPair, KeyAgg, String)> { - let party2_key_pair: KeyPair = KeyPair::create(); - let (id, mut party1_public_key): (String, GE) = requests::postb( - client_shim, - &format!("eddsa/keygen"), - &party2_key_pair.public_key) - .unwrap(); - let eight: FE = ECScalar::from(&BigInt::from(8)); - let eight_inverse: FE = eight.invert(); - party1_public_key = party1_public_key * &eight_inverse; - - // compute apk: - let mut pks: Vec = Vec::new(); - pks.push(party1_public_key.clone()); - pks.push(party2_key_pair.public_key.clone()); - let key_agg = KeyPair::key_aggregation_n(&pks, &PARTY2_INDEX); - - Ok((party2_key_pair, key_agg, id)) -} - -#[no_mangle] -pub extern "C" fn generate_client_key( - c_endpoint: *const c_char, - c_auth_token: *const c_char, -) -> *mut c_char { - let raw_endpoint = unsafe { CStr::from_ptr(c_endpoint) }; - let endpoint = match raw_endpoint.to_str() { - Ok(s) => s, - Err(_) => panic!("Error while decoding raw endpoint"), - }; - - let raw_auth_token = unsafe { CStr::from_ptr(c_auth_token) }; - let auth_token = match raw_auth_token.to_str() { - Ok(s) => s, - Err(_) => panic!("Error while decoding auth token"), - }; - - let client_shim = ClientShim::new(endpoint.to_string(), Some(auth_token.to_string())); - - let key: (KeyPair, KeyAgg, String) = match generate_key(&client_shim) { - Ok(k) => k, - Err(_) => panic!("Error while performing keygen to endpoint {}", endpoint), - }; - - let key_json = match serde_json::to_string(&key) { - Ok(kj) => kj, - Err(_) => panic!("Error while encoding key"), - }; - - CString::new(key_json.to_owned()) - .unwrap() - .into_raw() -} diff --git a/gotham-client/src/eddsa/mod.rs b/gotham-client/src/eddsa/mod.rs deleted file mode 100644 index 5083bfa..0000000 --- a/gotham-client/src/eddsa/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// - -mod keygen; -mod sign; -mod types; - -pub use keygen::generate_key; -pub use sign::sign; -pub use types::*; diff --git a/gotham-client/src/eddsa/sign.rs b/gotham-client/src/eddsa/sign.rs deleted file mode 100644 index 37b9244..0000000 --- a/gotham-client/src/eddsa/sign.rs +++ /dev/null @@ -1,163 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// - -use super::super::utilities::requests; -use super::super::utilities::error_to_c_string; -use super::super::Result; -use super::super::ClientShim; - -// iOS bindings -use std::ffi::{CStr, CString}; -use std::os::raw::c_char; - -use curv::elliptic::curves::ed25519::{FE, GE}; -use curv::BigInt; -use multi_party_eddsa::protocols::aggsig::*; - -#[allow(non_snake_case)] -pub fn sign( - client_shim: &ClientShim, - message: BigInt, - party2_key_pair: &KeyPair, - key_agg: &KeyAgg, - id: &String -) -> Result { - // round 1: send commitments to ephemeral public keys - let (party2_ephemeral_key, party2_sign_first_msg, party2_sign_second_msg) = - Signature::create_ephemeral_key_and_commit( - &party2_key_pair, - BigInt::to_bytes(&message).as_slice(), - ); - - let party1_sign_first_msg: SignFirstMsg = match requests::postb( - client_shim, - &format!("eddsa/sign/{}/first", id), - &(party2_sign_first_msg, message.clone())) { - Some(s) => s, - None => return Err(failure::err_msg("party1 sign first message request failed")) - }; - - // round 2: send ephemeral public keys and check commitments. - // in the two-party setting, the counterparty can immediately return its local signature. - let (mut party1_sign_second_msg, mut s1): (SignSecondMsg, Signature) = match requests::postb( - client_shim, - &format!("eddsa/sign/{}/second", id), - &party2_sign_second_msg) { - Some(s) => s, - None => return Err(failure::err_msg("party1 sign second message request failed")) - }; - - let eight: FE = ECScalar::from(&BigInt::from(8)); - let eight_inverse: FE = eight.invert(); - party1_sign_second_msg.R = party1_sign_second_msg.R * &eight_inverse; - s1.R = s1.R * &eight_inverse; - assert!(test_com( - &party1_sign_second_msg.R, - &party1_sign_second_msg.blind_factor, - &party1_sign_first_msg.commitment - )); - - // round 3: - // compute R' = sum(Ri): - let mut Ri: Vec = Vec::new(); - Ri.push(party1_sign_second_msg.R.clone()); - Ri.push(party2_sign_second_msg.R.clone()); - // each party i should run this: - let R_tot = Signature::get_R_tot(Ri); - let k = Signature::k(&R_tot, &key_agg.apk, BigInt::to_bytes(&message).as_slice()); - let s2 = Signature::partial_sign( - &party2_ephemeral_key.r, - &party2_key_pair, - &k, - &key_agg.hash, - &R_tot, - ); - - let mut s: Vec = Vec::new(); - s.push(s1); - s.push(s2); - let signature = Signature::add_signature_parts(s); - - // verify: - verify(&signature, BigInt::to_bytes(&message).as_slice(), &key_agg.apk) - .or_else(|e| Err(format_err!("verifying signature failed: {}", e))) - .and_then(|_| Ok(signature)) -} - -#[no_mangle] -pub extern "C" fn sign_message_eddsa( - c_endpoint: *const c_char, - c_auth_token: *const c_char, - c_message_le_hex: *const c_char, - c_key_pair_json: *const c_char, - c_key_agg_json: *const c_char, - c_id: *const c_char, -) -> *mut c_char { - let raw_endpoint = unsafe { CStr::from_ptr(c_endpoint) }; - let endpoint = match raw_endpoint.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw endpoint failed: {}", e)), - }; - - let raw_auth_token = unsafe { CStr::from_ptr(c_auth_token) }; - let auth_token = match raw_auth_token.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw auth_token failed: {}", e)), - }; - - let raw_message_hex = unsafe { CStr::from_ptr(c_message_le_hex) }; - let message_hex = match raw_message_hex.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw message_hex failed: {}", e)), - }; - - let raw_key_pair_json = unsafe { CStr::from_ptr(c_key_pair_json) }; - let key_pair_json = match raw_key_pair_json.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw key_pair_json failed: {}", e)), - }; - - let raw_key_agg_json = unsafe { CStr::from_ptr(c_key_agg_json) }; - let key_agg_json = match raw_key_agg_json.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw key_agg_json failed: {}", e)), - }; - - let raw_id = unsafe { CStr::from_ptr(c_id) }; - let id = match raw_id.to_str() { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("decoding raw id failed: {}", e)), - }; - - let client_shim = ClientShim::new(endpoint.to_string(), Some(auth_token.to_string())); - - let message: BigInt = serde_json::from_str(message_hex).unwrap(); - - let mut key_pair: KeyPair = serde_json::from_str(key_pair_json).unwrap(); - - let mut key_agg: KeyAgg = serde_json::from_str(key_agg_json).unwrap(); - - let eight: FE = ECScalar::from(&BigInt::from(8)); - let eight_inverse: FE = eight.invert(); - - key_pair.public_key = key_pair.public_key * &eight_inverse; - key_agg.apk = key_agg.apk * &eight_inverse; - - let sig = match sign(&client_shim, message, &key_pair, &key_agg, &id.to_string()) { - Ok(s) => s, - Err(e) => return error_to_c_string(format_err!("signing to endpoint {} failed: {}", endpoint, e)) - }; - - let signature_json = match serde_json::to_string(&sig) { - Ok(share) => share, - Err(e) => return error_to_c_string(format_err!("encoding signature failed: {}", e)), - }; - - CString::new(signature_json.to_owned()).unwrap().into_raw() -} diff --git a/gotham-client/src/eddsa/types.rs b/gotham-client/src/eddsa/types.rs deleted file mode 100644 index 538f2d4..0000000 --- a/gotham-client/src/eddsa/types.rs +++ /dev/null @@ -1 +0,0 @@ -pub use multi_party_eddsa::protocols::aggsig::{KeyAgg, KeyPair}; diff --git a/gotham-client/src/escrow/mod.rs b/gotham-client/src/escrow/mod.rs index 6838e00..3215df1 100644 --- a/gotham-client/src/escrow/mod.rs +++ b/gotham-client/src/escrow/mod.rs @@ -7,11 +7,9 @@ // version 3 of the License, or (at your option) any later version. // -use curv::elliptic::curves::secp256_k1::{FE, GE}; -use curv::elliptic::curves::traits::ECPoint; -use curv::elliptic::curves::traits::ECScalar; +use two_party_ecdsa::curv::elliptic::curves::secp256_k1::{FE, GE}; +use two_party_ecdsa::curv::elliptic::curves::traits::{ECPoint, ECScalar}; -use serde_json; use std::fs; const ESCROW_SK_FILENAME: &str = "escrow/escrow-sk.json"; @@ -24,14 +22,20 @@ pub struct Escrow { public: GE, } +impl Default for Escrow { + fn default() -> Self { + Self::new() + } +} + impl Escrow { pub fn new() -> Escrow { let secret: FE = ECScalar::new_random(); let g: GE = ECPoint::generator(); - let public: GE = g * &secret; + let public: GE = g * secret; fs::write( ESCROW_SK_FILENAME, - serde_json::to_string(&(secret.clone(), public.clone())).unwrap(), + serde_json::to_string(&(secret, public)).unwrap(), ) .expect("Unable to save escrow secret!"); @@ -41,17 +45,14 @@ impl Escrow { pub fn load() -> Escrow { let sec_data = fs::read_to_string(ESCROW_SK_FILENAME).expect("Unable to load wallet!"); let (secret, public): (FE, GE) = serde_json::from_str(&sec_data).unwrap(); - Escrow { - secret: secret.clone(), - public: public.clone(), - } + Escrow { secret, public } } pub fn get_public_key(&self) -> GE { - self.public.clone() + self.public } pub fn get_private_key(&self) -> FE { - self.secret.clone() + self.secret } } diff --git a/gotham-client/src/lib.rs b/gotham-client/src/lib.rs index 6ba79a3..7b7f32c 100644 --- a/gotham-client/src/lib.rs +++ b/gotham-client/src/lib.rs @@ -6,53 +6,26 @@ // License as published by the Free Software Foundation, either // version 3 of the License, or (at your option) any later version. // - -extern crate centipede; -extern crate config; -extern crate curv; -extern crate kms; -extern crate multi_party_ecdsa; -extern crate reqwest; -extern crate zk_paillier; - -#[macro_use] -extern crate serde_derive; -extern crate serde; -extern crate serde_json; - -#[macro_use] -extern crate log; - -#[macro_use] -extern crate failure; - -extern crate bitcoin; -extern crate electrumx_client; -extern crate hex; -extern crate itertools; -extern crate uuid; - +use floating_duration::TimeFormat; +use log::info; +use serde::{de::DeserializeOwned, Serialize}; +use std::time::Instant; pub mod ecdsa; pub mod escrow; -pub mod wallet; - -pub mod eddsa; -pub mod schnorr; mod utilities; -mod tests; type Result = std::result::Result; #[derive(Debug)] -pub struct ClientShim { - pub client: reqwest::Client, +pub struct ClientShim { + pub client: C, pub auth_token: Option, pub endpoint: String, } -impl ClientShim { - pub fn new(endpoint: String, auth_token: Option) -> ClientShim { +impl ClientShim { + pub fn new(endpoint: String, auth_token: Option) -> ClientShim { let client = reqwest::Client::new(); ClientShim { client, @@ -62,5 +35,66 @@ impl ClientShim { } } -pub use curv::{BigInt, arithmetic::traits::Converter}; -pub use multi_party_eddsa::protocols::aggsig::*; +impl ClientShim { + pub fn new_with_client(endpoint: String, auth_token: Option, client: C) -> Self { + Self { + client, + auth_token, + endpoint, + } + } + pub fn post(&self, path: &str) -> Option + where + V: serde::de::DeserializeOwned, + { + let start = Instant::now(); + let res = self + .client + .post(&self.endpoint, path, self.auth_token.clone(), "{}"); + info!("(req {}, took: {:?})", path, TimeFormat(start.elapsed())); + res + } + + pub fn postb(&self, path: &str, body: T) -> Option + where + T: serde::ser::Serialize, + V: serde::de::DeserializeOwned, + { + let start = Instant::now(); + let res = self + .client + .post(&self.endpoint, path, self.auth_token.clone(), body); + info!("(req {}, took: {:?})", path, TimeFormat(start.elapsed())); + res + } +} + +pub trait Client: Sized { + fn post( + &self, + endpoint: &str, + uri: &str, + bearer_token: Option, + body: T, + ) -> Option; +} + +impl Client for reqwest::Client { + fn post( + &self, + endpoint: &str, + uri: &str, + bearer_token: Option, + body: T, + ) -> Option { + let mut b = self.post(&format!("{}/{}", endpoint, uri)); + if let Some(token) = bearer_token { + b = b.bearer_auth(token); + } + let value = b.json(&body).send().ok()?.text().ok()?; + serde_json::from_str(value.as_str()).ok() + } +} + +pub use two_party_ecdsa::curv::{arithmetic::traits::Converter, BigInt}; +// pub use multi_party_eddsa::protocols::aggsig::*; diff --git a/gotham-client/src/main.rs b/gotham-client/src/main.rs deleted file mode 100644 index 5b98d88..0000000 --- a/gotham-client/src/main.rs +++ /dev/null @@ -1,124 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// - -#[macro_use] -extern crate clap; -use clap::App; - -use client_lib::ClientShim; -use client_lib::escrow; -use client_lib::wallet; -use std::time::Instant; -use floating_duration::TimeFormat; - -use std::collections::HashMap; - -fn main() { - let yaml = load_yaml!("../cli.yml"); - let matches = App::from_yaml(yaml).get_matches(); - - let mut settings = config::Config::default(); - settings - // Add in `./Settings.toml` - .merge(config::File::with_name("Settings")) - .unwrap() - // Add in settings from the environment (with prefix "APP") - // Eg.. `APP_DEBUG=1 ./target/app` would set the `debug` key - .merge(config::Environment::new()) - .unwrap(); - let hm = settings.try_into::>().unwrap(); - let endpoint = hm.get("endpoint").unwrap(); - - let client_shim = ClientShim::new(endpoint.to_string(), None); - - let network = "testnet".to_string(); - - if let Some(_matches) = matches.subcommand_matches("create-wallet") { - println!("Network: [{}], Creating wallet", network); - let wallet = wallet::Wallet::new(&client_shim, &network); - wallet.save(); - println!("Network: [{}], Wallet saved to disk", &network); - - let _escrow = escrow::Escrow::new(); - println!("Network: [{}], Escrow initiated", &network); - } else if let Some(matches) = matches.subcommand_matches("wallet") { - let mut wallet: wallet::Wallet = wallet::Wallet::load(); - - if matches.is_present("new-address") { - let address = wallet.get_new_bitcoin_address(); - println!("Network: [{}], Address: [{}]", network, address.to_string()); - wallet.save(); - } else if matches.is_present("get-balance") { - let balance = wallet.get_balance(); - println!( - "Network: [{}], Balance: [balance: {}, pending: {}]", - network, balance.confirmed, balance.unconfirmed - ); - } else if matches.is_present("list-unspent") { - let unspent = wallet.list_unspent(); - let hashes: Vec = unspent.into_iter().map(|u| u.tx_hash).collect(); - - println!( - "Network: [{}], Unspent tx hashes: [\n{}\n]", - network, - hashes.join("\n") - ); - } else if matches.is_present("backup") { - let escrow = escrow::Escrow::load(); - - println!("Backup private share pending (it can take some time)..."); - - let start = Instant::now(); - wallet.backup(escrow); - - println!("Backup key saved in escrow (Took: {})", TimeFormat(start.elapsed())); - } else if matches.is_present("verify") { - let escrow = escrow::Escrow::load(); - - println!("verify encrypted backup (it can take some time)..."); - - let start = Instant::now(); - wallet.verify_backup(escrow); - - println!(" (Took: {})", TimeFormat(start.elapsed())); - } else if matches.is_present("restore") { - let escrow = escrow::Escrow::load(); - - println!("backup recovery in process πŸ“² (it can take some time)..."); - - let start = Instant::now(); - wallet::Wallet::recover_and_save_share(escrow, &network, &client_shim); - - println!(" Backup recovered πŸ’Ύ(Took: {})", TimeFormat(start.elapsed())); - } else if matches.is_present("rotate") { - println!("Rotating secret shares"); - - let start = Instant::now(); - let wallet = wallet.rotate(&client_shim); - wallet.save(); - - println!("key rotation complete, (Took: {})", TimeFormat(start.elapsed())); - } else if matches.is_present("send") { - if let Some(matches) = matches.subcommand_matches("send") { - let to: &str = matches.value_of("to").unwrap(); - let amount_btc: &str = matches.value_of("amount").unwrap(); - let txid = wallet.send( - to.to_string(), - amount_btc.to_string().parse::().unwrap(), - &client_shim, - ); - wallet.save(); - println!( - "Network: [{}], Sent {} BTC to address {}. Transaction ID: {}", - network, amount_btc, to, txid - ); - } - } - } -} diff --git a/gotham-client/src/schnorr/mod.rs b/gotham-client/src/schnorr/mod.rs deleted file mode 100644 index 3b8befa..0000000 --- a/gotham-client/src/schnorr/mod.rs +++ /dev/null @@ -1,108 +0,0 @@ -use super::utilities::requests; -use super::Result; -use super::ClientShim; -use multi_party_schnorr::protocols::thresholdsig::zilliqa_schnorr::*; -pub use multi_party_schnorr::protocols::thresholdsig::zilliqa_schnorr::{Signature, Share}; -use curv::elliptic::curves::secp256_k1::GE; - -const PREFIX: &str = "schnorr"; -const PARTY1_INDEX: usize = 1; // server -const PARTY2_INDEX: usize = 2; // client (self) -const PARAMS: Parameters = Parameters { - threshold: 1, - share_count: 2, -}; - -pub fn generate_key(client_shim: &ClientShim) -> Result { - let key: Keys = Keys::phase1_create(PARTY2_INDEX); - let (msg1, msg2) = key.phase1_broadcast(); - - let (id, party1_msg1): (String, KeyGenBroadcastMessage1) = requests::postb( - client_shim, - &format!("{}/keygen/first", PREFIX), &msg1) - .unwrap(); - - let party1_msg2: KeyGenBroadcastMessage2 = requests::postb( - client_shim, - &format!("{}/keygen/{}/second", PREFIX, id), - &msg2) - .unwrap(); - - let (vss_scheme, secret_shares, _index) = key.phase1_verify_com_phase2_distribute( - &PARAMS, - &vec![party1_msg2.clone(), msg2], - &vec![party1_msg1, msg1], - &vec![PARTY1_INDEX, PARTY2_INDEX]) - .or_else(|e| Err(e))?; - let msg3 = KeyGenMessage3 { - vss_scheme, - secret_share: secret_shares[PARTY1_INDEX - 1], - }; - - let party1_msg3: KeyGenMessage3 = requests::postb( - client_shim, - &format!("{}/keygen/{}/third", PREFIX, id), &msg3) - .unwrap(); - - let vss_scheme_vec = vec![party1_msg3.vss_scheme, msg3.vss_scheme]; - let shared_key: SharedKeys = key.phase2_verify_vss_construct_keypair( - &PARAMS, - &vec![party1_msg2.y_i, key.y_i], - &vec![party1_msg3.secret_share, secret_shares[key.party_index - 1]], - &vss_scheme_vec, - &key.party_index) - .or_else(|e| Err(e))?; - - let share: Share = Share { - id, - shared_key, - vss_scheme_vec, - }; - Ok(share) -} - -pub fn sign( - client_shim: &ClientShim, - message: BigInt, - share: &Share, -) -> Result { - let eph_share = generate_key(client_shim) - .or_else(|e| Err(e))?; - let message_vec = BigInt::to_bytes(&message); - let message_slice = message_vec.as_slice(); - let local_sig = LocalSig::compute( - message_slice, - &eph_share.shared_key, - &share.shared_key); - - let sign_msg1 = SignMessage1 { - message, - local_sig, - }; - - let party1_local_sig: LocalSig = requests::postb( - client_shim, - &format!("{}/sign/{}/{}", PREFIX, share.id, eph_share.id), - &sign_msg1) - .unwrap(); - - let local_sig_vec = &vec![party1_local_sig, local_sig]; - let vss_sum_local_sigs: VerifiableSS = LocalSig::verify_local_sigs( - local_sig_vec, - &vec![PARTY1_INDEX - 1, PARTY2_INDEX - 1], - &share.vss_scheme_vec, - &eph_share.vss_scheme_vec) - .or_else(|e| Err(e))?; - - let signature = Signature::generate( - &vss_sum_local_sigs, - local_sig_vec, - &vec![PARTY1_INDEX - 1, PARTY2_INDEX - 1], - &eph_share.shared_key.y, - &share.shared_key.y, - message_slice, - ); - signature.verify(message_slice, &share.shared_key.y) - .or_else(|e| Err(format_err!("{}", e))) - .and_then(|()| Ok(signature)) -} \ No newline at end of file diff --git a/gotham-client/src/tests.rs b/gotham-client/src/tests.rs deleted file mode 100644 index d19c1df..0000000 --- a/gotham-client/src/tests.rs +++ /dev/null @@ -1,56 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// - -#[cfg(test)] -mod tests { - use super::super::wallet::Wallet; - - const TEST_WALLET_FILENAME: &str = "test-assets/wallet.data"; - - #[test] - fn load_wallet_test() { - Wallet::load_from(TEST_WALLET_FILENAME); - } - - #[test] - fn get_address_test() { - let mut w : Wallet = Wallet::load_from(TEST_WALLET_FILENAME); - let a = w.get_new_bitcoin_address(); - assert!(!a.to_string().is_empty()) - } - - #[test] - fn get_balance_test() { - let mut w : Wallet = Wallet::load_from(TEST_WALLET_FILENAME); - let b = w.get_balance(); - assert!(b.confirmed > 0); - } - -// TODO: Find a reliable way of doing integration testing over the blockchain. -// TODO: Ideally we would like to do the whole flow of receiving and sending. PR welcome ;) -// #[test] -// fn send_test() { -// // expect the server running -// let client_shim : api::ClientShim = api::ClientShim::new( -// "http://localhost:8000".to_string(), None); -// -// let mut w : Wallet = Wallet::load_from(TEST_WALLET_FILENAME); -// let b = w.get_balance(); -// assert!(b.confirmed > 0); -// -// let available_balance = b.confirmed as f32 / 100000000 as f32; -// let to_send = 0.00000001; -// let delta_pessimistic_fees = 0.00013; // 0.5 usd - 03/14/2019 -// assert!(available_balance > to_send + delta_pessimistic_fees, "You need to refund the wallet"); -// -// let to_address = w.get_new_bitcoin_address(); // inner wallet tx -// let txid = w.send(to_address.to_string(), to_send, &client_shim); -// assert!(!txid.is_empty()); -// } -} \ No newline at end of file diff --git a/gotham-client/src/utilities/mod.rs b/gotham-client/src/utilities/mod.rs index 631fc60..c22e9d5 100644 --- a/gotham-client/src/utilities/mod.rs +++ b/gotham-client/src/utilities/mod.rs @@ -10,8 +10,6 @@ use std::ffi::CString; use std::os::raw::c_char; -pub mod requests; - pub fn error_to_c_string(e: failure::Error) -> *mut c_char { - CString::new(format!("Error: {}", e.to_string())).unwrap().into_raw() + CString::new(format!("Error: {}", e)).unwrap().into_raw() } diff --git a/gotham-client/src/utilities/requests.rs b/gotham-client/src/utilities/requests.rs deleted file mode 100644 index d288c86..0000000 --- a/gotham-client/src/utilities/requests.rs +++ /dev/null @@ -1,53 +0,0 @@ -// Gotham-city -// -// Copyright 2018 by Kzen Networks (kzencorp.com) -// Gotham city is free software: you can redistribute -// it and/or modify it under the terms of the GNU General Public -// License as published by the Free Software Foundation, either -// version 3 of the License, or (at your option) any later version. -// -use serde; -use std::time::Instant; -use floating_duration::TimeFormat; -use super::super::ClientShim; - -pub fn post(client_shim: &ClientShim, path: &str) -> Option - where V: serde::de::DeserializeOwned -{ - _postb(client_shim, path, "{}") -} - -pub fn postb(client_shim: &ClientShim, path: &str, body: T) -> Option -where - T: serde::ser::Serialize, - V: serde::de::DeserializeOwned -{ - _postb(client_shim, path, body) -} - -fn _postb(client_shim: &ClientShim, path: &str, body: T) -> Option - where - T: serde::ser::Serialize, - V: serde::de::DeserializeOwned -{ - let start = Instant::now(); - - let mut b = client_shim - .client - .post(&format!("{}/{}", client_shim.endpoint, path)); - - if client_shim.auth_token.is_some() { - b = b.bearer_auth(client_shim.auth_token.clone().unwrap()); - } - - let res = b.json(&body).send(); - - info!("(req {}, took: {})", path, TimeFormat(start.elapsed())); - - let value = match res { - Ok(mut v) => v.text().unwrap(), - Err(_) => return None - }; - - Some(serde_json::from_str(value.as_str()).unwrap()) -} diff --git a/gotham-client/src/wallet/mod.rs b/gotham-client/src/wallet/mod.rs index e37fbba..d4bfc64 100644 --- a/gotham-client/src/wallet/mod.rs +++ b/gotham-client/src/wallet/mod.rs @@ -9,17 +9,18 @@ use bitcoin; use bitcoin::consensus::encode::serialize; +use bitcoin::hashes::{hex::FromHex, sha256d}; use bitcoin::network::constants::Network; +use bitcoin::secp256k1::Signature; use bitcoin::util::bip143::SighashComponents; use bitcoin::{TxIn, TxOut, Txid}; -use bitcoin::hashes::{sha256d, hex::FromHex}; -use bitcoin::secp256k1::Signature; +use curv::elliptic::curves::secp256_k1::{GE, PK}; use curv::elliptic::curves::traits::ECPoint; use curv::BigInt; -use curv::elliptic::curves::secp256_k1::{GE, PK}; use electrumx_client::{electrumx_client::ElectrumxClient, interface::Electrumx}; use kms::ecdsa::two_party::MasterKey2; use kms::ecdsa::two_party::*; +use mockall::automock; use serde_json; use std::fs; use uuid::Uuid; @@ -31,11 +32,11 @@ use kms::chain_code::two_party::party2::ChainCode2; use super::ecdsa; use super::ecdsa::types::PrivateShare; use super::escrow; -use super::utilities::requests; use super::ClientShim; use curv::arithmetic::traits::Converter; use hex; use itertools::Itertools; +use secp256k1::Signature; use std::collections::HashMap; use std::str::FromStr; @@ -45,6 +46,35 @@ const ELECTRUM_HOST: &str = "ec2-34-219-15-143.us-west-2.compute.amazonaws.com:6 const WALLET_FILENAME: &str = "wallet/wallet.data"; const BACKUP_FILENAME: &str = "wallet/backup.data"; +#[automock] +pub trait BalanceFetcher { + fn get_balance(&mut self, address: &bitcoin::Address) -> GetBalanceResponse; +} + +pub struct ElectrumxBalanceFetcher { + client: ElectrumxClient, +} + +impl ElectrumxBalanceFetcher { + pub fn new(url: &str) -> Self { + Self { + client: ElectrumxClient::new(url.to_string()).unwrap(), + } + } +} + +impl BalanceFetcher for ElectrumxBalanceFetcher { + fn get_balance(&mut self, address: &bitcoin::Address) -> GetBalanceResponse { + let resp = self.client.get_balance(&address.to_string()).unwrap(); + + GetBalanceResponse { + confirmed: resp.confirmed, + unconfirmed: resp.unconfirmed, + address: address.to_string(), + } + } +} + #[derive(Serialize, Deserialize)] pub struct SignSecondMsgRequest { pub message: BigInt, @@ -90,30 +120,31 @@ pub struct Wallet { } impl Wallet { - pub fn new(client_shim: &ClientShim, net: &String) -> Wallet { + pub fn new(client_shim: &ClientShim, net: &str) -> Wallet { let id = Uuid::new_v4().to_string(); let private_share = ecdsa::get_master_key(client_shim); let last_derived_pos = 0; let addresses_derivation_map = HashMap::new(); - let network = net.clone(); + let network = net; Wallet { id, - network, + network: network.to_string(), private_share, last_derived_pos, addresses_derivation_map, } } - pub fn rotate(self, client_shim: &ClientShim) -> Self { + pub fn rotate(self, client_shim: &ClientShim) -> Self { ecdsa::rotate_master_key(self, client_shim) } pub fn backup(&self, escrow_service: escrow::Escrow) { let g: GE = ECPoint::generator(); let y = escrow_service.get_public_key(); - let (segments, encryptions) = self.private_share.master_key.private.to_encrypted_segment(escrow::SEGMENT_SIZE, + let (segments, encryptions) = self.private_share.master_key.private.to_encrypted_segment( + escrow::SEGMENT_SIZE, escrow::NUM_SEGMENTS, &y, &g, @@ -160,10 +191,10 @@ impl Wallet { } } - pub fn recover_and_save_share( + pub fn recover_and_save_share( escrow_service: escrow::Escrow, - net: &String, - client_shim: &ClientShim, + net: &str, + client_shim: &ClientShim, ) -> Wallet { let g: GE = ECPoint::generator(); let y_priv = escrow_service.get_private_key(); @@ -182,18 +213,19 @@ impl Wallet { let client_master_key_recovered = MasterKey2::recover_master_key(sk.unwrap(), public_data, chain_code2); - let pos_old: u32 = requests::post(client_shim, &format!("ecdsa/{}/recover", key_id)).unwrap(); + let pos_old: u32 = + client_shim.post(&format!("ecdsa/{}/recover", key_id)).unwrap(); let pos_old = if pos_old < 10 { 10 } else { pos_old }; //TODO: temporary, server will keep updated pos, to do so we need to send update to server for every get_new_address let id = Uuid::new_v4().to_string(); let addresses_derivation_map = HashMap::new(); //TODO: add a fucntion to recreate - let network = net.clone(); + let network = net; let new_wallet = Wallet { id, - network, + network: network.to_string(), private_share: PrivateShare { master_key: client_master_key_recovered, id: key_id, @@ -234,13 +266,14 @@ impl Wallet { Wallet::load_from(WALLET_FILENAME) } - pub fn send( + pub fn send( &mut self, to_address: String, amount_btc: f32, - client_shim: &ClientShim, + client_shim: &ClientShim, + fetcher: &mut E, ) -> String { - let selected = self.select_tx_in(amount_btc); + let selected = self.select_tx_in(amount_btc, fetcher); if selected.is_empty() { panic!("Not enough fund"); } @@ -252,7 +285,7 @@ impl Wallet { .into_iter() .map(|s| bitcoin::TxIn { previous_output: bitcoin::OutPoint { - txid: Txid::from_hash(sha256d::Hash::from_hex(&s.tx_hash).unwrap()), + txid: bitcoin::util::hash::Sha256dHash::from_hex(&s.tx_hash).unwrap(), vout: s.tx_pos as u32, }, script_sig: bitcoin::Script::default(), @@ -292,11 +325,8 @@ impl Wallet { let mut signed_transaction = transaction.clone(); - for i in 0..transaction.input.len() { - let address_derivation = self - .addresses_derivation_map - .get(&selected[i].address) - .unwrap(); + for (i, item) in selected.iter().enumerate().take(transaction.input.len()) { + let address_derivation = self.addresses_derivation_map.get(&item.address).unwrap(); let mk = &address_derivation.mk; let pk = mk.public.q.get_element(); @@ -304,39 +334,42 @@ impl Wallet { let comp = SighashComponents::new(&transaction); let sig_hash = comp.sighash_all( &transaction.input[i], - &bitcoin::Address::p2pkh( - &to_bitcoin_public_key(pk), - self.get_bitcoin_network()).script_pubkey(), - (selected[i].value as u32).into(), + &bitcoin::Address::p2pkh(&to_bitcoin_public_key(pk), self.get_bitcoin_network()) + .script_pubkey(), + (item.value as u32).into(), ); let signature = ecdsa::sign( client_shim, BigInt::from_hex(&hex::encode(&sig_hash[..])).unwrap(), - &mk, - BigInt::from(0), + mk, + BigInt::from(0u32), BigInt::from(address_derivation.pos), &self.private_share.id, - ).unwrap(); + ) + .unwrap(); - let mut v = BigInt::to_bytes(&signature.r); - v.extend(BigInt::to_bytes(&signature.s)); + let mut v = BigInt::to_vec(&signature.r); + v.extend(BigInt::to_vec(&signature.s)); let mut sig_vec = Signature::from_compact(&v[..]) .unwrap() .serialize_der() .to_vec(); - sig_vec.push(01); + sig_vec.push(1); - let pk_vec = pk.serialize().to_vec(); + sig.push(01); + let mut witness = Vec::new(); + witness.push(sig); + witness.push(pk.serialize().to_vec()); - signed_transaction.input[i].witness = vec![sig_vec, pk_vec]; + signed_transaction.input[i].witness = witness; } let mut electrum = ElectrumxClient::new(ELECTRUM_HOST).unwrap(); let raw_tx_hex = hex::encode(serialize(&signed_transaction)); - let txid = electrum.broadcast_transaction(raw_tx_hex.clone()); + let txid = electrum.broadcast_transaction(raw_tx_hex); txid.unwrap() } @@ -344,10 +377,11 @@ impl Wallet { pub fn get_new_bitcoin_address(&mut self) -> bitcoin::Address { let (pos, mk) = Self::derive_new_key(&self.private_share, self.last_derived_pos); let pk = mk.public.q.get_element(); - let address = bitcoin::Address::p2wpkh( - &to_bitcoin_public_key(pk), - self.get_bitcoin_network() - ).expect("Cannot panic because `to_bitcoin_public_key` creates a compressed address"); + let address = + bitcoin::Address::p2wpkh(&to_bitcoin_public_key(pk), self.get_bitcoin_network()) + .expect( + "Cannot panic because `to_bitcoin_public_key` creates a compressed address", + ); self.addresses_derivation_map .insert(address.to_string(), AddressDerivation { mk, pos }); @@ -361,24 +395,24 @@ impl Wallet { for i in 0..self.last_derived_pos { let (pos, mk) = Self::derive_new_key(&self.private_share, i); - let address = - bitcoin::Address::p2wpkh( - &to_bitcoin_public_key(mk.public.q.get_element()), - self.get_bitcoin_network() - ).expect("Cannot panic because `to_bitcoin_public_key` creates a compressed address"); + let address = bitcoin::Address::p2wpkh( + &to_bitcoin_public_key(mk.public.q.get_element()), + self.get_bitcoin_network(), + ) + .expect("Cannot panic because `to_bitcoin_public_key` creates a compressed address"); self.addresses_derivation_map .insert(address.to_string(), AddressDerivation { mk, pos }); } } - pub fn get_balance(&mut self) -> GetWalletBalanceResponse { + pub fn get_balance(&mut self, fetcher: &mut E) -> GetWalletBalanceResponse { let mut aggregated_balance = GetWalletBalanceResponse { confirmed: 0, unconfirmed: 0, }; - for b in self.get_all_addresses_balance() { + for b in self.get_all_addresses_balance(fetcher) { aggregated_balance.unconfirmed += b.unconfirmed; aggregated_balance.confirmed += b.confirmed; } @@ -387,12 +421,16 @@ impl Wallet { } // TODO: handle fees - pub fn select_tx_in(&self, amount_btc: f32) -> Vec { + pub fn select_tx_in( + &self, + amount_btc: f32, + fetcher: &mut E, + ) -> Vec { // greedy selection let list_unspent: Vec = self - .get_all_addresses_balance() + .get_all_addresses_balance(fetcher) .into_iter() -// .filter(|b| b.confirmed > 0) + .filter(|b| b.confirmed > 0) .map(|a| self.list_unspent_for_addresss(a.address.to_string())) .flatten() .sorted_by(|a, b| a.value.partial_cmp(&b.value).unwrap()) @@ -442,25 +480,16 @@ impl Wallet { .collect() } - fn get_address_balance(address: &bitcoin::Address) -> GetBalanceResponse { - let mut client = ElectrumxClient::new(ELECTRUM_HOST).unwrap(); - - let resp = client.get_balance(&address.to_string()).unwrap(); - - GetBalanceResponse { - confirmed: resp.confirmed, - unconfirmed: resp.unconfirmed, - address: address.to_string(), - } - } - - fn get_all_addresses_balance(&self) -> Vec { + fn get_all_addresses_balance( + &self, + fetcher: &mut E, + ) -> Vec { let response: Vec = self .get_all_addresses() .into_iter() - .map(|a| Self::get_address_balance(&a)) + // .map(|a| Self::get_address_balance(&a)) + .map(|a| fetcher.get_balance(&a)) .collect(); - response } @@ -498,10 +527,8 @@ impl Wallet { } fn to_bitcoin_address(mk: &MasterKey2, network: Network) -> bitcoin::Address { - bitcoin::Address::p2wpkh( - &to_bitcoin_public_key(mk.public.q.get_element()), - network - ).expect("Cannot panic because `to_bitcoin_public_key` creates a compressed address") + bitcoin::Address::p2wpkh(&to_bitcoin_public_key(mk.public.q.get_element()), network) + .expect("Cannot panic because `to_bitcoin_public_key` creates a compressed address") } } @@ -509,14 +536,14 @@ impl Wallet { fn to_bitcoin_public_key(pk: PK) -> bitcoin::util::key::PublicKey { bitcoin::util::key::PublicKey { compressed: true, - key: pk + key: pk, } } #[cfg(test)] mod tests { - use bitcoin::hashes::sha256d; use bitcoin::hashes::hex::ToHex; + use bitcoin::hashes::sha256d; use bitcoin::hashes::Hash; use curv::arithmetic::traits::Converter; use curv::BigInt; @@ -529,13 +556,13 @@ mod tests { ]; // 14abf5ed107ff58bf844ee7f447bec317c276b00905c09a45434f8848599597e - let hash = sha256d::Hash::from_slice(&message).unwrap(); + let hash = Sha256dHash::from_data(&message); // 7e59998584f83454a4095c90006b277c31ec7b447fee44f88bf57f10edf5ab14 - let ser = hash.to_hex(); + let ser = hash.le_hex_string(); // 57149727877124134702546803488322951680010683936655914236113461592936003513108 - let b: BigInt = BigInt::from_hex(&ser).unwrap(); + let b: BigInt = BigInt::from_hex(&ser); println!("({},{},{})", hash, ser, b.to_hex()); } diff --git a/gotham-server/.gitignore b/gotham-server/.gitignore index b0ab256..d9f5649 100644 --- a/gotham-server/.gitignore +++ b/gotham-server/.gitignore @@ -10,3 +10,7 @@ Cargo.lock **/*.rs.bk .idea db/ + +AuthenticationTestExpiredToken/ +AuthenticationTestInvalidToken/ +KeyGenAndSign/ \ No newline at end of file diff --git a/gotham-server/Cargo.lock b/gotham-server/Cargo.lock new file mode 100644 index 0000000..aacf35d --- /dev/null +++ b/gotham-server/Cargo.lock @@ -0,0 +1,2902 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aead" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +dependencies = [ + "generic-array", +] + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes-gcm" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df5f85a83a7d8b0442b6aa7b504b8212c1733da07b98aae43d4bc21b2cb3cdf6" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aho-corasick" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +dependencies = [ + "memchr", +] + +[[package]] +name = "ansi_term" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" +dependencies = [ + "winapi", +] + +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "async-trait" +version = "0.1.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "binascii" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" + +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static 1.4.0", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.1", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +dependencies = [ + "libc", + "num-integer", + "num-traits 0.2.15", + "serde 1.0.139", + "time 0.1.44", + "winapi", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + +[[package]] +name = "clang-sys" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags", +] + +[[package]] +name = "config" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9107d78ed62b3fa5a86e7d18e647abed48cfd8f8fab6c72f4cdb982d196f7e6" +dependencies = [ + "lazy_static 1.4.0", + "nom 4.2.3", + "rust-ini", + "serde 1.0.139", + "serde-hjson", + "serde_json", + "toml 0.4.10", + "yaml-rust", +] + +[[package]] +name = "cookie" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94d4706de1b0fa5b132270cddffa8585166037822e260a944fe161acd137ca05" +dependencies = [ + "aes-gcm", + "base64", + "hkdf", + "hmac 0.12.1", + "percent-encoding", + "rand 0.8.5", + "sha2 0.10.2", + "subtle", + "time 0.3.11", + "version_check 0.9.4", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + +[[package]] +name = "cpufeatures" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c02a4d71819009c192cf4872265391563fd6a84c81ff2c0f2a7026ca4c1d85c" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07db9d94cbd326813772c968ccd25999e5f8ae22f4f8d1b11effa37ef6ce281d" +dependencies = [ + "autocfg 1.1.0", + "cfg-if", + "crossbeam-utils", + "memoffset", + "once_cell", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "crypto-common" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ccfd8c0ee4cce11e45b3fd6f9d5e69e0cc62912aa6a0cb1bf4617b0eba5a12f" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "serde 1.0.139", + "subtle", + "zeroize", +] + +[[package]] +name = "devise" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50c7580b072f1c8476148f16e0a0d5dedddab787da98d86c5082c5e9ed8ab595" +dependencies = [ + "devise_codegen", + "devise_core", +] + +[[package]] +name = "devise_codegen" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "123c73e7a6e51b05c75fe1a1b2f4e241399ea5740ed810b0e3e6cacd9db5e7b2" +dependencies = [ + "devise_core", + "quote", +] + +[[package]] +name = "devise_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841ef46f4787d9097405cac4e70fb8644fc037b526e8c14054247c0263c400d0" +dependencies = [ + "bitflags", + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer 0.10.2", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "either" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" + +[[package]] +name = "encoding_rs" +version = "0.8.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "env_logger" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "backtrace", + "version_check 0.9.4", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +dependencies = [ + "backtrace", + "failure_derive", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + +[[package]] +name = "figment" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790b4292c72618abbab50f787a477014fe15634f96291de45672ce46afe122df" +dependencies = [ + "atomic", + "pear", + "serde 1.0.139", + "toml 0.5.9", + "uncased", + "version_check 0.9.4", +] + +[[package]] +name = "floating-duration" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2c60b71d9dbcd810a3be879dc9aafac6cec5c50dc2346e245f61f54a61fdf22" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "futures" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" + +[[package]] +name = "futures-executor" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" + +[[package]] +name = "futures-macro" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" + +[[package]] +name = "futures-task" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" + +[[package]] +name = "futures-util" +version = "0.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1d9279ca822891c1a4dae06d185612cf8fc6acfe5dff37781b41297811b12ee" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "winapi", +] + +[[package]] +name = "generic-array" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check 0.9.4", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "ghash" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1583cc1656d7839fd3732b80cf4f38850336cdb9b8ded1cd399ca62958de3c99" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gimli" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" + +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "gotham-server" +version = "0.1.0" +dependencies = [ + "chrono", + "config", + "env_logger", + "error-chain", + "failure", + "floating-duration", + "hex 0.3.2", + "jsonwebtoken", + "kms", + "log", + "rocket", + "rocksdb", + "rusoto_core", + "rusoto_dynamodb", + "serde 1.0.139", + "serde_derive", + "serde_dynamodb", + "serde_json", + "time-test", + "two-party-ecdsa", + "two-party-musig2-eddsa", + "uuid", +] + +[[package]] +name = "h2" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.3", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.3", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "hyper" +version = "0.14.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg 1.1.0", + "hashbrown", + "serde 1.0.139", +] + +[[package]] +name = "inlinable_string" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" + +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "jsonwebtoken" +version = "8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa4b4af834c6cfd35d8763d359661b90f2e45d8f750a0849156c7f4671af09c" +dependencies = [ + "base64", + "pem", + "ring", + "serde 1.0.139", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "keccak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b7d56ba4a8344d6be9729995e6b06f928af29998cdf79fe390cbf6b1fee838" + +[[package]] +name = "kms" +version = "0.1.0" +source = "git+https://github.com/ZenGo-X/kms-secp256k1.git?branch=2.0#76b7990024606f62a56e2b06cc5bb2258491a92a" +dependencies = [ + "rand 0.8.5", + "serde 1.0.139", + "two-party-ecdsa", +] + +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" + +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "librocksdb-sys" +version = "6.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c309a9d2470844aceb9a4a098cf5286154d20596868b75a6b36357d2bb9ca25d" +dependencies = [ + "bindgen", + "cc", + "glob", + "libc", +] + +[[package]] +name = "linked-hash-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" +dependencies = [ + "serde 0.8.23", + "serde_test", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg 1.1.0", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde 1.0.139", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "md-5" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5a279bb9607f9f53c22d496eade00d138d1bdcccd07d74650387cf94942a15" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys", +] + +[[package]] +name = "multer" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f8f35e687561d5c1667590911e6698a8cb714a134a7505718a182e7bc9d3836" +dependencies = [ + "bytes", + "encoding_rs", + "futures-util", + "http", + "httparse", + "log", + "memchr", + "mime", + "spin 0.9.3", + "tokio", + "tokio-util 0.6.10", + "version_check 0.9.4", +] + +[[package]] +name = "native-tls" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +dependencies = [ + "lazy_static 1.4.0", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +dependencies = [ + "memchr", + "version_check 0.1.5", +] + +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +dependencies = [ + "autocfg 1.1.0", + "num-integer", + "num-traits 0.2.15", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg 1.1.0", + "num-traits 0.2.15", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.15", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg 1.1.0", +] + +[[package]] +name = "num_cpus" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "openssl" +version = "0.10.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +dependencies = [ + "autocfg 1.1.0", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "pear" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15e44241c5e4c868e3eaa78b7c1848cadd6344ed4f54d029832d32b415a58702" +dependencies = [ + "inlinable_string", + "pear_codegen", + "yansi", +] + +[[package]] +name = "pear_codegen" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82a5ca643c2303ecb740d506539deba189e16f2754040a42901cd8105d0282d0" +dependencies = [ + "proc-macro2", + "proc-macro2-diagnostics", + "quote", + "syn", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9a3b09a20e374558580a4914d3b7d89bd61b954a5a5e1dcbea98753addb1947" +dependencies = [ + "base64", +] + +[[package]] +name = "percent-encoding" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" + +[[package]] +name = "polyval" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + +[[package]] +name = "proc-macro2" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "proc-macro2-diagnostics" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf29726d67464d49fa6224a1d07936a8c08bb3fba727c7493f6cf1616fdaada" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "version_check 0.9.4", + "yansi", +] + +[[package]] +name = "quote" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.8", + "libc", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift", + "winapi", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.3.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.3", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom 0.2.7", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc", + "rand_core 0.4.2", + "winapi", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.4.2", + "rdrand", + "winapi", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.8", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg 1.1.0", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "ref-cast" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "685d58625b6c2b83e4cc88a27c4bf65adb7b6b16dbdc413e515c9405b47432ab" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a043824e29c94169374ac5183ac0ed43f5724dc4556b19568007486bd840fa1f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[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-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" +dependencies = [ + "winapi", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted", + "web-sys", + "winapi", +] + +[[package]] +name = "rocket" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98ead083fce4a405feb349cf09abdf64471c6077f14e0ce59364aa90d4b99317" +dependencies = [ + "async-stream", + "async-trait", + "atomic", + "atty", + "binascii", + "bytes", + "either", + "figment", + "futures", + "indexmap", + "log", + "memchr", + "multer", + "num_cpus", + "parking_lot", + "pin-project-lite", + "rand 0.8.5", + "ref-cast", + "rocket_codegen", + "rocket_http", + "serde 1.0.139", + "serde_json", + "state", + "tempfile", + "time 0.3.11", + "tokio", + "tokio-stream", + "tokio-util 0.7.3", + "ubyte", + "version_check 0.9.4", + "yansi", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6aeb6bb9c61e9cd2c00d70ea267bf36f76a4cc615e5908b349c2f9d93999b47" +dependencies = [ + "devise", + "glob", + "indexmap", + "proc-macro2", + "quote", + "rocket_http", + "syn", + "unicode-xid", +] + +[[package]] +name = "rocket_http" +version = "0.5.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ded65d127954de3c12471630bf4b81a2792f065984461e65b91d0fdaafc17a2" +dependencies = [ + "cookie", + "either", + "futures", + "http", + "hyper", + "indexmap", + "log", + "memchr", + "pear", + "percent-encoding", + "pin-project-lite", + "ref-cast", + "serde 1.0.139", + "smallvec", + "stable-pattern", + "state", + "time 0.3.11", + "tokio", + "uncased", +] + +[[package]] +name = "rocksdb" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a62eca5cacf2c8261128631bed9f045598d40bfbe4b29f5163f0f802f8f44a7" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rusoto_core" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b4f000e8934c1b4f70adde180056812e7ea6b1a247952db8ee98c94cd3116cc" +dependencies = [ + "async-trait", + "base64", + "bytes", + "crc32fast", + "futures", + "http", + "hyper", + "hyper-tls", + "lazy_static 1.4.0", + "log", + "rusoto_credential", + "rusoto_signature", + "rustc_version", + "serde 1.0.139", + "serde_json", + "tokio", + "xml-rs", +] + +[[package]] +name = "rusoto_credential" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a46b67db7bb66f5541e44db22b0a02fed59c9603e146db3a9e633272d3bac2f" +dependencies = [ + "async-trait", + "chrono", + "dirs-next", + "futures", + "hyper", + "serde 1.0.139", + "serde_json", + "shlex", + "tokio", + "zeroize", +] + +[[package]] +name = "rusoto_dynamodb" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7935e1f9ca57c4ee92a4d823dcd698eb8c992f7e84ca21976ae72cd2b03016e7" +dependencies = [ + "async-trait", + "bytes", + "futures", + "rusoto_core", + "serde 1.0.139", + "serde_json", +] + +[[package]] +name = "rusoto_signature" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6264e93384b90a747758bcc82079711eacf2e755c3a8b5091687b5349d870bcc" +dependencies = [ + "base64", + "bytes", + "chrono", + "digest 0.9.0", + "futures", + "hex 0.4.3", + "hmac 0.11.0", + "http", + "hyper", + "log", + "md-5", + "percent-encoding", + "pin-project-lite", + "rusoto_credential", + "rustc_version", + "serde 1.0.139", + "sha2 0.9.9", + "tokio", +] + +[[package]] +name = "rust-gmp" +version = "0.5.1" +source = "git+https://github.com/KZen-networks/rust-gmp#48a82600ba8cfd259559fb5e17e465499e7730e0" +dependencies = [ + "libc", + "num-traits 0.2.15", + "serde 1.0.139", +] + +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0a5f7c728f5d284929a1cccb5bc19884422bfe6ef4d6c409da2c41838983fcf" + +[[package]] +name = "ryu" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static 1.4.0", + "windows-sys", +] + +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "secp256k1" +version = "0.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c42e6f1735c5f00f51e43e28d6634141f2bcad10931b2609ddd74a86d751260" +dependencies = [ + "rand 0.6.5", + "secp256k1-sys", + "serde 1.0.139", +] + +[[package]] +name = "secp256k1-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957da2573cde917463ece3570eab4a0b3f19de6f1646cde62e6fd3868f566036" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" + +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" + +[[package]] +name = "serde" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-hjson" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b833c5ad67d52ced5f5938b2980f32a9c1c5ef047f0b4fb3127e7a423c76153" +dependencies = [ + "lazy_static 0.2.11", + "linked-hash-map 0.3.0", + "num-traits 0.1.43", + "regex", + "serde 0.8.23", +] + +[[package]] +name = "serde_derive" +version = "1.0.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_dynamodb" +version = "0.9.1-dev" +source = "git+https://github.com/KZen-networks/serde_dynamodb#300c87cfd37e1ec5066e44e3ff2fcf9bb2f92f9a" +dependencies = [ + "bytes", + "rusoto_dynamodb", + "serde 1.0.139", +] + +[[package]] +name = "serde_json" +version = "1.0.82" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +dependencies = [ + "itoa", + "ryu", + "serde 1.0.139", +] + +[[package]] +name = "serde_test" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" +dependencies = [ + "serde 0.8.23", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.3", +] + +[[package]] +name = "sha3" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "881bf8156c87b6301fc5ca6b27f11eeb2761224c7081e69b409d5a1951a70c86" +dependencies = [ + "digest 0.10.3", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static 1.4.0", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signal-hook-registry" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] + +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits 0.2.15", + "thiserror", + "time 0.3.11", +] + +[[package]] +name = "slab" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" + +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + +[[package]] +name = "socket2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c530c2b0d0bf8b69304b39fe2001993e267461948b890cd037d8ad4293fa1a0d" + +[[package]] +name = "stable-pattern" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" +dependencies = [ + "memchr", +] + +[[package]] +name = "state" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" +dependencies = [ + "loom", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "unicode-xid", +] + +[[package]] +name = "tempfile" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +dependencies = [ + "cfg-if", + "fastrand", + "libc", + "redox_syscall", + "remove_dir_all", + "winapi", +] + +[[package]] +name = "termcolor" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "time" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +dependencies = [ + "itoa", + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + +[[package]] +name = "time-test" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0027850c0de35afb59aa27f468f25aed155e057236a57e442b528751f79e9eb" +dependencies = [ + "time 0.1.44", +] + +[[package]] +name = "tokio" +version = "1.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +dependencies = [ + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "once_cell", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df54d54117d6fdc4e4fea40fe1e4e566b3505700e148a6827e59b34b0d2600d9" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +dependencies = [ + "serde 1.0.139", +] + +[[package]] +name = "toml" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +dependencies = [ + "serde 1.0.139", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static 1.4.0", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a713421342a5a666b7577783721d3117f1b69a393df803ee17bb73b1e122a59" +dependencies = [ + "ansi_term", + "matchers", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "two-party-ecdsa" +version = "0.1.0" +source = "git+https://github.com/ZenGo-X/two-party-ecdsa.git#005d91283ca9e803f8857fc1aa4f79780bfa49c4" +dependencies = [ + "bit-vec", + "hmac 0.12.1", + "itertools", + "rand 0.8.5", + "rayon", + "rust-gmp", + "secp256k1", + "serde 1.0.139", + "serde_derive", + "sha2 0.10.2", + "sha3", + "zeroize", +] + +[[package]] +name = "two-party-musig2-eddsa" +version = "0.1.2" +source = "git+https://github.com/ZenGo-X/two-party-musig2-eddsa?tag=v0.1.2#1a5007bef9c4712c88212425a7f5ad82e3805c8c" +dependencies = [ + "curve25519-dalek", + "rand 0.8.5", + "serde 1.0.139", + "sha2 0.9.9", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "ubyte" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a58e29f263341a29bb79e14ad7fda5f63b1c7e48929bad4c685d7876b1d04e94" +dependencies = [ + "serde 1.0.139", +] + +[[package]] +name = "uncased" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b01702b0fd0b3fadcf98e098780badda8742d4f4a7676615cad90e8ac73622" +dependencies = [ + "serde 1.0.139", + "version_check 0.9.4", +] + +[[package]] +name = "unicode-ident" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" + +[[package]] +name = "unicode-xid" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" + +[[package]] +name = "universal-hash" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +dependencies = [ + "rand 0.6.5", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +dependencies = [ + "bumpalo", + "lazy_static 1.4.0", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" + +[[package]] +name = "web-sys" +version = "0.3.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "xml-rs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" + +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map 0.5.6", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + +[[package]] +name = "zeroize" +version = "1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b578acffd8516a6c3f2a1bdefc1ec37e547bb4e0fb8b6b01a4cafc886b4442" diff --git a/gotham-server/Cargo.toml b/gotham-server/Cargo.toml index 80d120d..fedcbf8 100644 --- a/gotham-server/Cargo.toml +++ b/gotham-server/Cargo.toml @@ -1,11 +1,10 @@ [package] name = "gotham-server" -version = "0.1.4" +version = "1.0.0" authors = [ - "gbenattar ", - "Oded Leiba (String, MasterKey2) { + time_test!(); + + /*************** START: FIRST MESSAGE ***************/ + let start = Instant::now(); + + let response = client + .post("/ecdsa/keygen/first") + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 first message", + TimeFormat(start.elapsed()) + ); + let res_body = response.into_string().unwrap(); + + let (id, kg_party_one_first_message): (String, party_one::KeyGenFirstMsg) = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + + let (kg_party_two_first_message, kg_ec_key_pair_party2) = MasterKey2::key_gen_first_message(); + + println!( + "{} Client: party2 first message", + TimeFormat(start.elapsed()) + ); + /*************** END: FIRST MESSAGE ***************/ + + /*************** START: SECOND MESSAGE ***************/ + let body = serde_json::to_string(&kg_party_two_first_message.d_log_proof).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/second", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 second message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let kg_party_one_second_message: party1::KeyGenParty1Message2 = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + + let key_gen_second_message = MasterKey2::key_gen_second_message( + &kg_party_one_first_message, + &kg_party_one_second_message, + ); + assert!(key_gen_second_message.is_ok()); + + println!( + "{} Client: party2 second message", + TimeFormat(start.elapsed()) + ); + + let (party_two_second_message, party_two_paillier, party_two_pdl_chal) = + key_gen_second_message.unwrap(); + + /*************** END: SECOND MESSAGE ***************/ + + /*************** START: THIRD MESSAGE ***************/ + let body = serde_json::to_string(&party_two_second_message.pdl_first_message).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/third", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 third message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let party_one_third_message: party_one::PDLFirstMessage = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + + let pdl_decom_party2 = MasterKey2::key_gen_third_message(&party_two_pdl_chal); + + println!( + "{} Client: party2 third message", + TimeFormat(start.elapsed()) + ); + /*************** END: THIRD MESSAGE ***************/ + + /*************** START: FOURTH MESSAGE ***************/ + + let party_2_pdl_second_message = pdl_decom_party2; + let request = party_2_pdl_second_message; + let body = serde_json::to_string(&request).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/fourth", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 fourth message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let party_one_pdl_second_message: party_one::PDLSecondMessage = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + + MasterKey2::key_gen_fourth_message( + &party_two_pdl_chal, + &party_one_third_message, + &party_one_pdl_second_message, + ) + .expect("pdl error party1"); + + println!( + "{} Client: party2 fourth message", + TimeFormat(start.elapsed()) + ); + /*************** END: FOURTH MESSAGE ***************/ + + /*************** START: CHAINCODE FIRST MESSAGE ***************/ + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/chaincode/first", id)) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 chain code first message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let cc_party_one_first_message: Party1FirstMessage = serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + let (cc_party_two_first_message, cc_ec_key_pair2) = + chain_code::party2::ChainCode2::chain_code_first_message(); + + println!( + "{} Client: party2 chain code first message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE FIRST MESSAGE ***************/ + + /*************** START: CHAINCODE SECOND MESSAGE ***************/ + let body = serde_json::to_string(&cc_party_two_first_message.d_log_proof).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/chaincode/second", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 chain code second message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let cc_party_one_second_message: Party1SecondMessage = serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + let _cc_party_two_second_message = chain_code::party2::ChainCode2::chain_code_second_message( + &cc_party_one_first_message, + &cc_party_one_second_message, + ); + + println!( + "{} Client: party2 chain code second message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE SECOND MESSAGE ***************/ + + let start = Instant::now(); + let party2_cc = chain_code::party2::ChainCode2::compute_chain_code( + &cc_ec_key_pair2, + &cc_party_one_second_message.comm_witness.public_share, + ) + .chain_code; + + println!( + "{} Client: party2 chain code second message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE COMPUTE MESSAGE ***************/ + + println!( + "{} Network/Server: party1 master key", + TimeFormat(start.elapsed()) + ); + + let start = Instant::now(); + let party_two_master_key = MasterKey2::set_master_key( + &party2_cc, + &kg_ec_key_pair_party2, + &kg_party_one_second_message + .ecdh_second_message + .comm_witness + .public_share, + &party_two_paillier, + ); + + println!("{} Client: party2 master_key", TimeFormat(start.elapsed())); + /*************** END: MASTER KEYS MESSAGE ***************/ + + (id, party_two_master_key) +} + +/// Benchmarks keygen phase from client side invoking gotham server endpoints +pub fn criterion_benchmark(c: &mut Criterion) { + c.bench_function("keygen benchmarking", |b| { + b.iter(|| { + let settings = HashMap::::from([ + ("db".to_string(), "local".to_string()), + ("db_name".to_string(), "KeyGenAndSign".to_string()), + ]); + let server = server::get_server(settings); + let client = Client::tracked(server).expect("valid rocket instance"); + let (_, _): (String, MasterKey2) = key_gen(&client); + }) + }); +} + +criterion_group! { + name = benches; + config = Criterion::default().with_profiler(PProfProfiler::new(10, Output::Flamegraph(None))); + targets = criterion_benchmark +} +criterion_main!(benches); diff --git a/gotham-server/src/auth/cognito.rs b/gotham-server/src/auth/cognito.rs index 0fb331d..5d7b171 100644 --- a/gotham-server/src/auth/cognito.rs +++ b/gotham-server/src/auth/cognito.rs @@ -9,15 +9,12 @@ use super::jwt::{decode_header_from_token, get_claims, Claims}; use super::PublicKey; -use hex; -use jwt::Algorithm; -use rocket::http::Status; +use jsonwebtoken::Algorithm; +use log::{debug, error}; use rocket::request::{self, FromRequest, Request}; -use rocket::Outcome; -use rocket::State; -use serde_json; -use std::collections::HashMap; -use std::process::Command; +use rocket::{http::Status, outcome::Outcome, State}; + +use std::{collections::HashMap, process::Command}; use super::super::server::AuthConfig; use super::passthrough; @@ -25,13 +22,13 @@ use super::passthrough; const ALGORITHM: Algorithm = Algorithm::RS256; const TOKEN_TYPE: &str = "Bearer"; -pub fn verify( - issuer: &String, - audience: &String, - region: &String, - pool_id: &String, - authorization_header: &String, -) -> Result { +fn verify( + issuer: &str, + audience: &str, + region: &str, + pool_id: &str, + authorization_header: &str, +) -> Option { let mut header_parts = authorization_header.split_whitespace(); let token_type = header_parts.next(); assert_eq!(token_type, Some(TOKEN_TYPE)); @@ -39,24 +36,24 @@ pub fn verify( let token = header_parts.next().unwrap(); let header = match decode_header_from_token(token.to_string()) { - Ok(h) => h, - Err(_) => return Err(()), + Some(h) => h, + None => return None, }; let key_set_str: String = match get_jwt_to_pems(region, pool_id) { Ok(k) => k, - Err(_) => return Err(()), + Err(_) => return None, }; let key_set: HashMap = match serde_json::from_str(&key_set_str) { Ok(k) => k, - Err(_) => return Err(()), + Err(_) => return None, }; let header_kid = header.kid.unwrap(); if !key_set.contains_key(&header_kid) { - return Err(()); + return None; } let key = key_set.get(&header_kid).unwrap(); @@ -64,10 +61,10 @@ pub fn verify( let secret = hex::decode(&key.der).unwrap(); let algorithms: Vec = vec![ALGORITHM]; - get_claims(issuer, audience, &token.to_string(), &secret, algorithms) + get_claims(issuer, audience, token, &secret, algorithms) } -fn get_jwt_to_pems(region: &String, pool_id: &String) -> Result { +fn get_jwt_to_pems(region: &str, pool_id: &str) -> Result { match Command::new("node") .arg("jwt-to-pems.js") .arg(format!("--region={}", region)) @@ -75,17 +72,21 @@ fn get_jwt_to_pems(region: &String, pool_id: &String) -> Result { .current_dir("../gotham-utilities/server/cognito") .output() { - Ok(o) => return Ok(String::from_utf8_lossy(&o.stdout).to_string()), - Err(_) => return Err(()), - }; + Ok(o) => Ok(String::from_utf8_lossy(&o.stdout).to_string()), + Err(_) => Err(()), + } } -impl<'a, 'r> FromRequest<'a, 'r> for Claims { +#[rocket::async_trait] +impl<'a> FromRequest<'a> for Claims { type Error = (); - fn from_request(request: &'a Request<'r>) -> request::Outcome { + async fn from_request(request: &'a Request<'_>) -> request::Outcome { let auths: Vec<_> = request.headers().get("Authorization").collect(); - let config = request.guard::>()?; + let config = match request.guard::<&State>().await { + Outcome::Success(s) => s, + _ => return Outcome::Failure((Status::BadRequest, ())), + }; if config.issuer.is_empty() && config.audience.is_empty() @@ -112,10 +113,10 @@ impl<'a, 'r> FromRequest<'a, 'r> for Claims { &config.audience, &config.region, &config.pool_id, - &auths[0].to_string(), + auths[0], ) { - Ok(claim) => claim, - Err(_) => { + Some(claim) => claim, + None => { error!("!!! Auth error: Unauthorized (401) !!!"); return Outcome::Failure((Status::Unauthorized, ())); } @@ -127,24 +128,15 @@ impl<'a, 'r> FromRequest<'a, 'r> for Claims { #[cfg(test)] mod tests { - use super::*; - - const ISSUER: &str = "issuer"; - const AUDIENCE: &str = "audience"; - const REGION: &str = "region"; - const POOL_ID: &str = "pool_id"; - + use super::verify; #[test] pub fn get_user_id_test() { - let authorization_header = "Bearer .a.b-c-d-e-f-g-h-i".to_string(); - - assert!(verify( - &ISSUER.to_string(), - &AUDIENCE.to_string(), - ®ION.to_string(), - &POOL_ID.to_string(), - &authorization_header - ) - .is_err()); + let authorization_header = "Bearer .a.b-c-d-e-f-g-h-i"; + let issuer = "issuer"; + let audience = "audience"; + let region = "region"; + let pool_id = "pool_id"; + + assert!(verify(issuer, audience, region, pool_id, authorization_header).is_none()); } } diff --git a/gotham-server/src/auth/jwt.rs b/gotham-server/src/auth/jwt.rs index 99863b7..5a9cd1b 100644 --- a/gotham-server/src/auth/jwt.rs +++ b/gotham-server/src/auth/jwt.rs @@ -6,7 +6,8 @@ // License as published by the Free Software Foundation, either // version 3 of the License, or (at your option) any later version. // -use super::super::jwt::{decode, decode_header, Algorithm, Header, Validation}; +use jsonwebtoken::{decode, decode_header, Algorithm, DecodingKey, Header, Validation}; +use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, Clone)] pub struct Claims { @@ -15,45 +16,40 @@ pub struct Claims { } pub fn get_claims( - issuer: &String, - audience: &String, - token: &String, + issuer: &str, + audience: &str, + token: &str, secret: &[u8], algorithms: Vec, -) -> Result { - let mut validation = Validation { - iss: Some(issuer.to_string()), - ..Validation::default() - }; - +) -> Option { + let mut validation = Validation::default(); + validation.set_issuer(&[issuer]); validation.algorithms = algorithms; // Setting audience - validation.set_audience(audience); - - let token_data = match decode::(token, secret, &validation) { + validation.set_audience(&[audience]); + let key = DecodingKey::from_rsa_der(secret); + let token_data = match decode::(token, &key, &validation) { Ok(c) => c, - Err(_) => return Err(()), + Err(_) => return None, }; - Ok(token_data.claims) + Some(token_data.claims) } -pub fn decode_header_from_token(token: String) -> Result { +pub fn decode_header_from_token(token: String) -> Option
{ let header = match decode_header(&token) { Ok(h) => h, - Err(_) => return Err(()), + Err(_) => return None, }; - Ok(header) + Some(header) } #[cfg(test)] mod tests { use super::{decode_header_from_token, get_claims}; - use hex; - use jwt::{Algorithm, Header}; - use std::str; + use jsonwebtoken::{Algorithm, Header}; #[test] #[should_panic] // Obviously hardcoded authorization_header become invalid @@ -85,7 +81,7 @@ mod tests { let issuer: String = "issuer".to_string(); let audience: String = "audience".to_string(); let algorithms = vec![Algorithm::RS256]; - assert!(get_claims(&issuer, &audience, &token, der.as_ref(), algorithms).is_ok()); + assert!(get_claims(&issuer, &audience, &token, der.as_ref(), algorithms).is_some()); } #[test] diff --git a/gotham-server/src/auth/mod.rs b/gotham-server/src/auth/mod.rs index 96fca74..8302d1e 100644 --- a/gotham-server/src/auth/mod.rs +++ b/gotham-server/src/auth/mod.rs @@ -7,6 +7,8 @@ // version 3 of the License, or (at your option) any later version. // +use serde::{Deserialize, Serialize}; + #[derive(Debug, Serialize, Deserialize)] pub struct PublicKey { pub kid: String, diff --git a/gotham-server/src/lib.rs b/gotham-server/src/lib.rs index 108e63c..9a3cee4 100644 --- a/gotham-server/src/lib.rs +++ b/gotham-server/src/lib.rs @@ -6,49 +6,12 @@ // License as published by the Free Software Foundation, either // version 3 of the License, or (at your option) any later version. // -#![recursion_limit = "128"] -#![feature(proc_macro_hygiene)] -#![feature(decl_macro)] -#[macro_use] -extern crate rocket; -extern crate config; -extern crate curv; -extern crate kms; -extern crate multi_party_ecdsa; -extern crate rocket_contrib; -extern crate rocksdb; -extern crate uuid; -extern crate zk_paillier; -#[macro_use] -extern crate failure; - -#[macro_use] -extern crate error_chain; - -#[macro_use] -extern crate serde_derive; -extern crate serde; -extern crate serde_json; - -#[macro_use] -extern crate log; - -#[cfg(test)] -#[macro_use] -extern crate time_test; -extern crate floating_duration; - -extern crate crypto; -extern crate jsonwebtoken as jwt; -extern crate rusoto_dynamodb; -extern crate serde_dynamodb; - -extern crate hex; pub mod auth; pub mod routes; pub mod server; pub mod storage; + pub mod tests; type Result = std::result::Result; diff --git a/gotham-server/src/main.rs b/gotham-server/src/main.rs index 38b3a6e..138b9e7 100644 --- a/gotham-server/src/main.rs +++ b/gotham-server/src/main.rs @@ -7,8 +7,27 @@ // version 3 of the License, or (at your option) any later version. // +use log::LevelFilter; use server_lib::server; +use std::collections::HashMap; -fn main() { - server::get_server().launch(); +#[rocket::launch] +fn rocket() -> _ { + let settings = get_settings_as_map(); + server::get_server(settings) +} + +fn get_settings_as_map() -> HashMap { + let config_file = include_str!("../Settings.toml"); + let mut settings = config::Config::default(); + settings + .merge(config::File::from_str( + config_file, + config::FileFormat::Toml, + )) + .unwrap() + .merge(config::Environment::new()) + .unwrap(); + + settings.try_into::>().unwrap() } diff --git a/gotham-server/src/routes/ecdsa.rs b/gotham-server/src/routes/ecdsa.rs index 897d892..97479eb 100644 --- a/gotham-server/src/routes/ecdsa.rs +++ b/gotham-server/src/routes/ecdsa.rs @@ -8,27 +8,26 @@ // version 3 of the License, or (at your option) any later version. // -use super::super::Result; -use curv::cryptographic_primitives::proofs::sigma_dlog::*; -use curv::cryptographic_primitives::twoparty::coin_flip_optimal_rounds; -use curv::cryptographic_primitives::twoparty::dh_key_exchange_variant_with_pok_comm::{ +use two_party_ecdsa::curv::cryptographic_primitives::proofs::sigma_dlog::*; +use two_party_ecdsa::curv::cryptographic_primitives::twoparty::dh_key_exchange_variant_with_pok_comm::{ CommWitness, EcKeyPair, Party1FirstMessage, Party1SecondMessage, }; -use curv::elliptic::curves::secp256_k1::Secp256k1Scalar; -use curv::BigInt; -use curv::elliptic::curves::secp256_k1::GE; +use two_party_ecdsa::curv::{elliptic::curves::secp256_k1::GE, BigInt}; +use two_party_ecdsa::{party_one, party_two}; +use kms::ecdsa::two_party::{party1, party2, MasterKey1}; use kms::chain_code::two_party as chain_code; -use kms::ecdsa::two_party::*; -use kms::rotation::two_party::party1::Rotation1; -use multi_party_ecdsa::protocols::two_party_ecdsa::lindell_2017::*; -use rocket::State; -use rocket_contrib::json::Json; -use std::string::ToString; +use rocket::{State, post, serde::json::Json}; use uuid::Uuid; +use serde::{Serialize, Deserialize}; +use failure::format_err; +use log::{warn, error}; +use std::collections::HashMap; +use std::process; +use std::panic; + +use crate::{auth::jwt::Claims, storage::db, Config}; -use super::super::auth::jwt::Claims; -use super::super::storage::db; -use super::super::Config; +use std::string::ToString; #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] struct HDPos { @@ -37,7 +36,7 @@ struct HDPos { #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] struct Alpha { - value: BigInt + value: BigInt, } #[derive(Debug)] @@ -64,16 +63,8 @@ pub enum EcdsaStruct { EphEcKeyPair, EphKeyGenFirstMsg, - RotateCommitMessage1M, - RotateCommitMessage1R, - RotateRandom1, - RotateFirstMsg, - RotatePrivateNew, - RotatePdlDecom, - RotateParty2First, - RotateParty1Second, - POS, + Abort, } impl db::MPCStruct for EcdsaStruct { @@ -96,14 +87,35 @@ impl db::MPCStruct for EcdsaStruct { } #[post("/ecdsa/keygen/first", format = "json")] -pub fn first_message( - state: State, +pub async fn first_message( + state: &State, claim: Claims, -) -> Result> { - let id = Uuid::new_v4().to_string(); +) -> Result, String> { + match has_active_share(&state.db, &claim.sub).await { + Err(e) => { + let msg = format!( + "Error when searching for active shares of customerId {}", + &claim.sub + ); + error!("{}: {:?}", msg, e); + return Err(format!("{}", msg)); + } + Ok(result) => { + if result { + let msg = format!("User {} already has an active share", &claim.sub); + warn!("{}", msg); + let should_fail_keygen = std::env::var("FAIL_KEYGEN_IF_ACTIVE_SHARE_EXISTS"); + if should_fail_keygen.is_ok() && should_fail_keygen.unwrap() == "true" { + warn!("Abort KeyGen"); + return Err(format!("{}", msg)); + } + } + } + } let (key_gen_first_msg, comm_witness, ec_key_pair) = MasterKey1::key_gen_first_message(); + let id = Uuid::new_v4().to_string(); //save pos 0 db::insert( &state.db, @@ -111,7 +123,9 @@ pub fn first_message( &id, &EcdsaStruct::POS, &HDPos { pos: 0u32 }, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; db::insert( &state.db, @@ -119,40 +133,65 @@ pub fn first_message( &id, &EcdsaStruct::KeyGenFirstMsg, &key_gen_first_msg, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; + db::insert( &state.db, &claim.sub, &id, &EcdsaStruct::CommWitness, &comm_witness, - )?; - db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::EcKeyPair, &ec_key_pair)?; + ) + .await + .or(Err("Failed to insert into db"))?; + + db::insert( + &state.db, + &claim.sub, + &id, + &EcdsaStruct::EcKeyPair, + &ec_key_pair, + ) + .await + .or(Err("Failed to insert into db"))?; + + db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::Abort, "false") + .await + .or(Err("Failed to insert into db"))?; Ok(Json((id, key_gen_first_msg))) } #[post("/ecdsa/keygen//second", format = "json", data = "")] -pub fn second_message( - state: State, +pub async fn second_message( + state: &State, claim: Claims, id: String, - dlog_proof: Json>, -) -> Result> { - let party2_public: GE = dlog_proof.0.pk.clone(); + dlog_proof: Json, +) -> Result, String> { + let party2_public: GE = dlog_proof.0.pk; db::insert( &state.db, &claim.sub, &id, &EcdsaStruct::Party2Public, &party2_public, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; let comm_witness: party_one::CommWitness = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CommWitness)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let ec_key_pair: party_one::EcKeyPair = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EcKeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CommWitness) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; + let ec_key_pair: party_one::EcKeyPair = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EcKeyPair) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let (kg_party_one_second_message, paillier_key_pair, party_one_private) = MasterKey1::key_gen_second_message(comm_witness, &ec_key_pair, &dlog_proof.0); @@ -163,25 +202,140 @@ pub fn second_message( &id, &EcdsaStruct::PaillierKeyPair, &paillier_key_pair, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; db::insert( &state.db, &claim.sub, &id, &EcdsaStruct::Party1Private, &party_one_private, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; Ok(Json(kg_party_one_second_message)) } +#[post( + "/ecdsa/keygen//third", + format = "json", + data = "" +)] +pub async fn third_message( + state: &State, + claim: Claims, + id: String, + party_2_pdl_first_message: Json, +) -> Result, String> { + let party_one_private: party_one::Party1Private = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1Private) + .await + .or(Err(format!("Failed to get from DB, id: {}", id)))? + .ok_or(format!("No data for such identifier {}", id))?; + + let (party_one_third_message, party_one_pdl_decommit, alpha) = + MasterKey1::key_gen_third_message(&party_2_pdl_first_message.0, &party_one_private); + + db::insert( + &state.db, + &claim.sub, + &id, + &EcdsaStruct::PDLDecommit, + &party_one_pdl_decommit, + ) + .await + .or(Err(format!( + "Failed to insert into DB PDLDecommit, id: {}", + id + )))?; + + db::insert( + &state.db, + &claim.sub, + &id, + &EcdsaStruct::Alpha, + &Alpha { value: alpha }, + ) + .await + .or(Err(format!("Failed to insert into DB Alpha, id: {}", id)))?; + + db::insert( + &state.db, + &claim.sub, + &id, + &EcdsaStruct::Party2PDLFirstMsg, + &party_2_pdl_first_message.0, + ) + .await + .or(Err(format!( + "Failed to insert into DB Party2PDLFirstMsg, id: {}", + id + )))?; + + Ok(Json(party_one_third_message)) +} + +#[post( + "/ecdsa/keygen//fourth", + format = "json", + data = "" +)] +pub async fn fourth_message( + state: &State, + claim: Claims, + id: String, + party_two_pdl_second_message: Json, +) -> Result, String> { + let party_one_private: party_one::Party1Private = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1Private) + .await + .or(Err(format!("Failed to get from DB, id:{}", id)))? + .ok_or(format!("No data for such identifier {}", id))?; + + let party_one_pdl_decommit: party_one::PDLdecommit = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::PDLDecommit) + .await + .or(Err(format!( + "Failed to get party one pdl decommit, id: {}", + id + )))? + .ok_or(format!("No data for such identifier {}", id))?; + + let party_2_pdl_first_message: party_two::PDLFirstMessage = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party2PDLFirstMsg) + .await + .or(Err(format!( + "Failed to get party 2 pdl first message from DB, id: {}", + id + )))? + .ok_or(format!("No data for such identifier {}", id))?; + + let alpha: Alpha = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Alpha) + .await + .or(Err(format!("Failed to get alpha from DB, id: {}", id)))? + .ok_or(format!("No data for such identifier {}", id))?; + + let res = MasterKey1::key_gen_fourth_message( + &party_2_pdl_first_message, + &party_two_pdl_second_message.0, + party_one_private, + party_one_pdl_decommit, + alpha.value, + ); + + assert!(res.is_ok()); + + Ok(Json(res.unwrap())) +} #[post("/ecdsa/keygen//chaincode/first", format = "json")] -pub fn chain_code_first_message( - state: State, +pub async fn chain_code_first_message( + state: &State, claim: Claims, id: String, -) -> Result> { +) -> Result, String> { let (cc_party_one_first_message, cc_comm_witness, cc_ec_key_pair1) = chain_code::party1::ChainCode1::chain_code_first_message(); @@ -191,21 +345,29 @@ pub fn chain_code_first_message( &id, &EcdsaStruct::CCKeyGenFirstMsg, &cc_party_one_first_message, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; + db::insert( &state.db, &claim.sub, &id, &EcdsaStruct::CCCommWitness, &cc_comm_witness, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; + db::insert( &state.db, &claim.sub, &id, &EcdsaStruct::CCEcKeyPair, &cc_ec_key_pair1, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; Ok(Json(cc_party_one_first_message)) } @@ -215,14 +377,17 @@ pub fn chain_code_first_message( format = "json", data = "" )] -pub fn chain_code_second_message( - state: State, +pub async fn chain_code_second_message( + state: &State, claim: Claims, id: String, - cc_party_two_first_message_d_log_proof: Json>, -) -> Result)>> { - let cc_comm_witness: CommWitness = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CCCommWitness)? - .ok_or(format_err!("No data for such identifier {}", id))?; + cc_party_two_first_message_d_log_proof: Json, +) -> Result, String> { + let cc_comm_witness: CommWitness = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CCCommWitness) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let party1_cc = chain_code::party1::ChainCode1::chain_code_second_message( cc_comm_witness, @@ -230,49 +395,64 @@ pub fn chain_code_second_message( ); let party2_pub = &cc_party_two_first_message_d_log_proof.pk; - chain_code_compute_message(state, claim, id, party2_pub)?; + chain_code_compute_message(state, claim, id, party2_pub).await?; Ok(Json(party1_cc)) } -pub fn chain_code_compute_message( - state: State, +pub async fn chain_code_compute_message( + state: &State, claim: Claims, id: String, cc_party2_public: &GE, -) -> Result> { - let cc_ec_key_pair_party1: EcKeyPair = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CCEcKeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; +) -> Result, String> { + let cc_ec_key_pair_party1: EcKeyPair = + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CCEcKeyPair) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let party1_cc = chain_code::party1::ChainCode1::compute_chain_code( &cc_ec_key_pair_party1, - &cc_party2_public, + cc_party2_public, ); - db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::CC, &party1_cc)?; - master_key(state, claim, id)?; + db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::CC, &party1_cc) + .await + .or(Err("Failed to insert into db"))?; + master_key(state, claim, id) + .await + .map_err(|e| e.to_string())?; Ok(Json(())) } -pub fn master_key(state: State, claim: Claims, id: String) -> Result<()> { - let party2_public: GE = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party2Public)? - .ok_or(format_err!("No data for such identifier {}", id))?; +pub async fn master_key( + state: &State, + claim: Claims, + id: String, +) -> Result<(), failure::Error> { + let party2_public: GE = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party2Public) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id))?; let paillier_key_pair: party_one::PaillierKeyPair = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::PaillierKeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::PaillierKeyPair) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id))?; let party1_cc: chain_code::party1::ChainCode1 = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CC)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CC) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id))?; let party_one_private: party_one::Party1Private = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1Private)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1Private) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id))?; let comm_witness: party_one::CommWitness = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CommWitness)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::CommWitness) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id))?; let masterKey = MasterKey1::set_master_key( &party1_cc.chain_code, @@ -289,6 +469,7 @@ pub fn master_key(state: State, claim: Claims, id: String) -> Result<()> &EcdsaStruct::Party1MasterKey, &masterKey, ) + .await } #[post( @@ -296,12 +477,21 @@ pub fn master_key(state: State, claim: Claims, id: String) -> Result<()> format = "json", data = "" )] -pub fn sign_first( - state: State, +pub async fn sign_first( + state: &State, claim: Claims, id: String, eph_key_gen_first_message_party_two: Json, -) -> Result> { +) -> Result, String> { + let abort: String = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Abort) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; + + if abort == "true" { + panic!("Tainted user"); + } + let (sign_party_one_first_message, eph_ec_key_pair_party1) = MasterKey1::sign_first_message(); db::insert( @@ -310,7 +500,9 @@ pub fn sign_first( &id, &EcdsaStruct::EphKeyGenFirstMsg, &eph_key_gen_first_message_party_two.0, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; db::insert( &state.db, @@ -318,7 +510,9 @@ pub fn sign_first( &id, &EcdsaStruct::EphEcKeyPair, &eph_ec_key_pair_party1, - )?; + ) + .await + .or(Err("Failed to insert into db"))?; Ok(Json(sign_party_one_first_message)) } @@ -331,15 +525,18 @@ pub struct SignSecondMsgRequest { pub x_pos_child_key: BigInt, pub y_pos_child_key: BigInt, } + #[post("/ecdsa/sign//second", format = "json", data = "")] -pub fn sign_second( - state: State, +pub async fn sign_second( + state: &State, claim: Claims, id: String, request: Json, -) -> Result> { - let master_key: MasterKey1 = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1MasterKey)? - .ok_or(format_err!("No data for such identifier {}", id))?; +) -> Result, String> { + let master_key: MasterKey1 = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1MasterKey) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let x: BigInt = request.x_pos_child_key.clone(); let y: BigInt = request.y_pos_child_key.clone(); @@ -347,12 +544,16 @@ pub fn sign_second( let child_master_key = master_key.get_child(vec![x, y]); let eph_ec_key_pair_party1: party_one::EphEcKeyPair = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EphEcKeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EphEcKeyPair) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let eph_key_gen_first_message_party_two: party_two::EphKeyGenFirstMsg = - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EphKeyGenFirstMsg)? - .ok_or(format_err!("No data for such identifier {}", id))?; + db::get(&state.db, &claim.sub, &id, &EcdsaStruct::EphKeyGenFirstMsg) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; let signature_with_recid = child_master_key.sign_second_message( &request.party_two_sign_message, @@ -362,92 +563,81 @@ pub fn sign_second( ); if signature_with_recid.is_err() { - panic!("validation failed") + println!("signature failed, user tainted[{:?}]", id); + db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::Abort, "true") + .await + .or(Err("Failed to insert into db"))?; + panic!("Server sign_second: validation of signature failed. Potential adversary") }; Ok(Json(signature_with_recid.unwrap())) } -pub fn get_mk(state: &State, claim: Claims, id: &String) -> Result { - db::get(&state.db, &claim.sub, &id, &EcdsaStruct::Party1MasterKey)? - .ok_or(format_err!("No data for such identifier {}", id)) -} - -#[post("/ecdsa/rotate//first", format = "json")] -pub fn rotate_first( - state: State, +pub async fn get_mk( + state: &State, claim: Claims, - id: String, -) -> Result)>> { - let (party1_coin_flip_first_message, m1, r1) = Rotation1::key_rotate_first_message(); - db::insert( - &state.db, - &claim.sub, - &id, - &EcdsaStruct::RotateCommitMessage1M, - &m1, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &EcdsaStruct::RotateCommitMessage1R, - &r1, - )?; - Ok(Json(party1_coin_flip_first_message)) + id: &str, +) -> Result { + db::get(&state.db, &claim.sub, id, &EcdsaStruct::Party1MasterKey) + .await? + .ok_or_else(|| format_err!("No data for such identifier {}", id)) } -#[post( - "/ecdsa/rotate//second", - format = "json", - data = "" -)] -pub fn rotate_second( - state: State, - id: String, +#[post("/ecdsa//recover", format = "json")] +pub async fn recover( + state: &State, claim: Claims, - party2_first_message: Json>, -) -> Result< - Json< - (( - coin_flip_optimal_rounds::Party1SecondMessage, - party1::RotationParty1Message1, - )), - >, -> { - let party_one_master_key = get_mk(&state, claim.clone(), &id)?; - - let m1: Secp256k1Scalar = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::RotateCommitMessage1M)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - let r1: Secp256k1Scalar = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::RotateCommitMessage1R)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - let (party1_second_message, random1) = - Rotation1::key_rotate_second_message(&party2_first_message.0, &m1, &r1); - db::insert(&state.db, &claim.sub, &id, &EcdsaStruct::RotateRandom1, &random1)?; - - let (rotation_party_one_first_message, party_one_master_key_rotated) = - party_one_master_key.rotation_first_message(&random1); - - db::insert( - &state.db, - &claim.sub, - &id, - &EcdsaStruct::Party1MasterKey, - &party_one_master_key_rotated, - )?; - - Ok(Json(( - party1_second_message, - rotation_party_one_first_message, - ))) + id: String, +) -> Result, String> { + let pos_old: u32 = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::POS) + .await + .or(Err("Failed to get from db"))? + .ok_or(format!("No data for such identifier {}", id))?; + Ok(Json(pos_old)) } - -#[post("/ecdsa//recover", format = "json")] -pub fn recover(state: State, claim: Claims, id: String) -> Result> { - let pos_old: u32 = db::get(&state.db, &claim.sub, &id, &EcdsaStruct::POS)? - .ok_or(format_err!("No data for such identifier {}", id))?; - Ok(Json(pos_old)) +async fn has_active_share(db: &db::DB, user_id: &str) -> Result { + match db { + #[cfg(feature = "local")] + db::DB::Local(_) => Ok(false), + #[cfg(feature = "aws")] + db::DB::AWS(dynamodb_client, env) => { + use rusoto_dynamodb::{AttributeValue, DynamoDb, QueryInput}; + let mut expression_attribute_values: HashMap = HashMap::new(); + expression_attribute_values.insert( + ":customerId".into(), + AttributeValue { + s: Some(user_id.to_string()), + ..AttributeValue::default() + }, + ); + expression_attribute_values.insert( + ":deleted".into(), + AttributeValue { + bool: Some(true), + ..AttributeValue::default() + }, + ); + + let query_input = QueryInput { + table_name: format!("{}_Party1MasterKey", env), + projection_expression: Some("id".into()), + key_condition_expression: Some("customerId = :customerId".into()), + filter_expression: Some("isDeleted <> :deleted".into()), + expression_attribute_values: Some(expression_attribute_values), + consistent_read: Some(true), + ..QueryInput::default() + }; + let result = dynamodb_client.query(query_input).await; + match result { + Ok(query_output) => query_output + .items + .map_or(Ok(false), |items| Ok(items.len() > 0)), + Err(e) => Err(format!( + "Error retrieving Party1MasterKey for customerId {}: {:?}", + user_id, e + )), + } + } + } } diff --git a/gotham-server/src/routes/eddsa.rs b/gotham-server/src/routes/eddsa.rs index 4671f40..ba5c055 100644 --- a/gotham-server/src/routes/eddsa.rs +++ b/gotham-server/src/routes/eddsa.rs @@ -1,15 +1,13 @@ -use super::super::Result; +use std::str::FromStr; + use rocket::State; -use rocket_contrib::json::Json; use uuid::Uuid; use super::super::auth::jwt::Claims; use super::super::storage::db; use super::super::Config; +use rocket::{post, serde::json::Json}; -use curv::BigInt; -use curv::elliptic::curves::ed25519::{GE, FE}; -use multi_party_eddsa::protocols::aggsig::*; use self::EddsaStruct::*; const PARTY1_INDEX: usize = 0; @@ -23,198 +21,36 @@ pub enum EddsaStruct { Message, Party1EphemeralKey, Party1SignFirstMsg, - Party1SignSecondMsg -} - -impl db::MPCStruct for EddsaStruct { - fn to_string(&self) -> String { - format!("Eddsa{:?}", self) - } + Party1SignSecondMsg, } - -// creating a wrapper for dynamodb insertion compatibility -#[derive(Debug, Serialize, Deserialize)] -struct MessageStruct { - message: BigInt, -} - #[post("/eddsa/keygen", format = "json", data = "")] -pub fn keygen( - state: State, +pub async fn keygen( + state: &State, claim: Claims, - party2_public_key_json: Json, -) -> Result> { - let id = Uuid::new_v4().to_string(); - let party1_key_pair: KeyPair = KeyPair::create(); - let eight: FE = ECScalar::from(&BigInt::from(8)); - let eight_inverse: FE = eight.invert(); - let party2_public_key = party2_public_key_json.0 * &eight_inverse; - db::insert( - &state.db, - &claim.sub, - &id, - &Party2PublicKey, - &party2_public_key, - )?; - - // compute apk: - let mut pks: Vec = Vec::new(); - pks.push(party1_key_pair.public_key.clone()); - pks.push(party2_public_key.clone()); - let key_agg = KeyPair::key_aggregation_n(&pks, &PARTY1_INDEX); - db::insert( - &state.db, - &claim.sub, - &id, - &Party1KeyPair, - &party1_key_pair, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &AggregatedPublicKey, - &key_agg, - )?; - - Ok(Json((id, party1_key_pair.public_key))) + party2_public_key_json: String, +) -> Result { + // let id = Uuid::new_v4().to_string(); + // let party1_key_pair: KeyPair = KeyPair::create(); + // let eight: FE = ECScalar::from(&BigInt::from(8)); + // let eight_inverse: FE = eight.invert(); + // let party2_public_key = party2_public_key_json.0 * &eight_inverse; + // db::insert( + // &state.db, + // &claim.sub, + // &id, + // &Party2PublicKey, + // &party2_public_key, + // )?; + + // // compute apk: + // let mut pks: Vec = Vec::new(); + // pks.push(party1_key_pair.public_key.clone()); + // pks.push(party2_public_key.clone()); + // let key_agg = KeyPair::key_aggregation_n(&pks, &PARTY1_INDEX); + // db::insert(&state.db, &claim.sub, &id, &Party1KeyPair, &party1_key_pair)?; + // db::insert(&state.db, &claim.sub, &id, &AggregatedPublicKey, &key_agg)?; + + // Ok(Json((id, party1_key_pair.public_key))) + let default_id = Uuid::from_bytes([0u8; 16]); + Ok("[\"d9876a6a-d135-40f0-bde7-e3c21ffb06aa\",{\"bytes_str\":\"52306ad4863fb676f9d9534629c3b89e5315114e76f719325a1172bc668de3bd\"}]".to_string()) } - -#[post("/eddsa/sign//first", format = "json", data = "")] -pub fn sign_first( - state: State, - claim: Claims, - id: String, - party2_sign_first_msg_obj: Json<(SignFirstMsg, BigInt)>, -) -> Result> { - let (party2_sign_first_msg, message): (SignFirstMsg, BigInt) = - party2_sign_first_msg_obj.0; - - let party1_key_pair: KeyPair = db::get( - &state.db, - &claim.sub, - &id, - &Party1KeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - let (party1_ephemeral_key, party1_sign_first_msg, party1_sign_second_msg) = - Signature::create_ephemeral_key_and_commit(&party1_key_pair, &BigInt::to_bytes(&message).as_slice()); - - db::insert( - &state.db, - &claim.sub, - &id, - &Party2SignFirstMsg, - &party2_sign_first_msg, - )?; - - let message_struct = MessageStruct { - message, - }; - db::insert( - &state.db, - &claim.sub, - &id, - &Message, - &message_struct, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party1EphemeralKey, - &party1_ephemeral_key, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party1SignFirstMsg, - &party1_sign_first_msg, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party1SignSecondMsg, - &party1_sign_second_msg, - )?; - - Ok(Json(party1_sign_first_msg)) -} - -#[allow(non_snake_case)] -#[post("/eddsa/sign//second", format = "json", data = "")] -pub fn sign_second( - state: State, - claim: Claims, - id: String, - mut party2_sign_second_msg: Json, -) -> Result> { - let party2_sign_first_msg: SignFirstMsg = db::get( - &state.db, - &claim.sub, - &id, - &Party2SignFirstMsg)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let eight: FE = ECScalar::from(&BigInt::from(8)); - let eight_inverse: FE = eight.invert(); - party2_sign_second_msg.R = party2_sign_second_msg.R * &eight_inverse; - assert!(test_com( - &party2_sign_second_msg.R, - &party2_sign_second_msg.blind_factor, - &party2_sign_first_msg.commitment - )); - - let party1_key_pair: KeyPair = db::get( - &state.db, - &claim.sub, - &id, - &Party1KeyPair)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let mut party1_ephemeral_key: EphemeralKey = db::get( - &state.db, - &claim.sub, - &id, - &Party1EphemeralKey)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let mut party1_sign_second_msg: SignSecondMsg = db::get( - &state.db, - &claim.sub, - &id, - &Party1SignSecondMsg)? - .ok_or(format_err!("No data for such identifier {}", id))?; - party1_ephemeral_key.R = party1_ephemeral_key.R * &eight_inverse; - party1_sign_second_msg.R = party1_sign_second_msg.R * &eight_inverse; - let mut key_agg: KeyAgg = db::get( - &state.db, - &claim.sub, - &id, - &AggregatedPublicKey)? - .ok_or(format_err!("No data for such identifier {}", id))?; - key_agg.apk = key_agg.apk * &eight_inverse; - let message_struct: MessageStruct = db::get( - &state.db, - &claim.sub, - &id, - &Message)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let message: BigInt = message_struct.message; - - // compute R' = sum(Ri): - let mut Ri: Vec = Vec::new(); - Ri.push(party1_sign_second_msg.R.clone()); - Ri.push(party2_sign_second_msg.R.clone()); - // each party i should run this: - let R_tot = Signature::get_R_tot(Ri); - let k = Signature::k(&R_tot, &key_agg.apk, &BigInt::to_bytes(&message).as_slice()); - let s1 = Signature::partial_sign( - &party1_ephemeral_key.r, - &party1_key_pair, - &k, - &key_agg.hash, - &R_tot, - ); - - Ok(Json((party1_sign_second_msg, s1))) -} \ No newline at end of file diff --git a/gotham-server/src/routes/mod.rs b/gotham-server/src/routes/mod.rs index 379074f..374e2df 100644 --- a/gotham-server/src/routes/mod.rs +++ b/gotham-server/src/routes/mod.rs @@ -8,6 +8,5 @@ // pub mod ecdsa; -pub mod schnorr; pub mod eddsa; pub mod ping; diff --git a/gotham-server/src/routes/ping.rs b/gotham-server/src/routes/ping.rs index e01b5a7..63a9490 100644 --- a/gotham-server/src/routes/ping.rs +++ b/gotham-server/src/routes/ping.rs @@ -1,4 +1,4 @@ -use rocket::http::Status; +use rocket::{get, http::Status}; #[get("/ping")] pub fn ping() -> Status { diff --git a/gotham-server/src/routes/schnorr.rs b/gotham-server/src/routes/schnorr.rs deleted file mode 100644 index 58dc9e5..0000000 --- a/gotham-server/src/routes/schnorr.rs +++ /dev/null @@ -1,275 +0,0 @@ -use super::super::Result; -use rocket::State; -use rocket_contrib::json::Json; - -use super::super::auth::jwt::Claims; -use super::super::storage::db; -use super::super::Config; - -use uuid::Uuid; -use multi_party_schnorr::protocols::thresholdsig::zilliqa_schnorr::*; -use self::SchnorrStruct::*; - -use curv::elliptic::curves::secp256_k1::{GE, FE}; - -const PARTY1_INDEX: usize = 1; -const PARTY2_INDEX: usize = 2; -const PARAMS: Parameters = Parameters { - threshold: 1, - share_count: 2, -}; - -#[derive(Debug)] -pub enum SchnorrStruct { - Party1Key, - Party1KeyGenBroadcastMessage1, - Party2KeyGenBroadcastMessage1, - Party1KeyGenBroadcastMessage2, - Party2KeyGenBroadcastMessage2, - Party1VerifiableSecretShares, - Party2VerifiableSecretShares, - Party1SecretShares, - Party1SharedKey -} - -impl db::MPCStruct for SchnorrStruct { - fn to_string(&self) -> String { - format!("Schnorr{:?}", self) - } -} - -#[post("/schnorr/keygen/first", format = "json", data = "")] -pub fn keygen_first( - state: State, - claim: Claims, - party2_msg1: Json, -) -> Result> { - let id = Uuid::new_v4().to_string(); - db::insert( - &state.db, - &claim.sub, - &id, - &Party2KeyGenBroadcastMessage1, - &party2_msg1.0, - )?; - - let key: Keys = Keys::phase1_create(1); - db::insert( - &state.db, - &claim.sub, - &id, - &Party1Key, - &key, - )?; - - let (msg1, msg2) = key.phase1_broadcast(); - db::insert( - &state.db, - &claim.sub, - &id, - &Party1KeyGenBroadcastMessage1, - &msg1, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party1KeyGenBroadcastMessage2, - &msg2, - )?; - - Ok(Json((id, msg1))) -} - -#[post("/schnorr/keygen//second", format = "json", data = "")] -pub fn keygen_second( - state: State, - claim: Claims, - id: String, - party2_msg2: Json, -) -> Result> { - let key: Keys = db::get( - &state.db, - &claim.sub, - &id, - &Party1Key)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let msg1: KeyGenBroadcastMessage1 = db::get( - &state.db, - &claim.sub, - &id, - &Party1KeyGenBroadcastMessage1)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let msg2: KeyGenBroadcastMessage2 = db::get( - &state.db, - &claim.sub, - &id, - &Party1KeyGenBroadcastMessage2)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let party2_msg1: KeyGenBroadcastMessage1 = db::get( - &state.db, - &claim.sub, - &id, - &Party2KeyGenBroadcastMessage1)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - let (vss_scheme, secret_shares, _index) = key.phase1_verify_com_phase2_distribute( - &PARAMS, - &vec![msg2, party2_msg2.0.clone()], - &vec![msg1, party2_msg1], - &vec![PARTY1_INDEX, PARTY2_INDEX]) - .or_else(|e| Err(e))?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party2KeyGenBroadcastMessage2, - &party2_msg2.0, - )?; - db::insert( - &state.db, - &claim.sub, - &id, - &Party1VerifiableSecretShares, - &vss_scheme, - )?; - db::insert( - &state.db, -&claim.sub, - &id, - &Party1SecretShares, - &secret_shares, - )?; - let msg2: KeyGenBroadcastMessage2 = db::get( - &state.db, -&claim.sub, - &id, - &Party1KeyGenBroadcastMessage2)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - Ok(Json(msg2)) -} - -#[post("/schnorr/keygen//third", format = "json", data = "")] -pub fn keygen_third( - state: State, - claim: Claims, - id: String, - party2_msg3: Json, -) -> Result> { - let key: Keys = db::get( - &state.db, -&claim.sub, - &id, - &Party1Key)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let party2_msg2: KeyGenBroadcastMessage2 = db::get( - &state.db, -&claim.sub, - &id, - &Party2KeyGenBroadcastMessage2)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let vss_scheme: VerifiableSS = db::get( - &state.db, -&claim.sub, - &id, - &Party1VerifiableSecretShares)? - .ok_or(format_err!("No data for such identifier {}", id))?; - let secret_shares: Vec = db::get( - &state.db, -&claim.sub, - &id, - &Party1SecretShares)? - .ok_or(format_err!("No data for such identifier {}", id))?; - - let shared_key: SharedKeys = key.phase2_verify_vss_construct_keypair( - &PARAMS, - &vec![key.y_i, party2_msg2.y_i], - &vec![secret_shares[key.party_index - 1], party2_msg3.0.secret_share], - &vec![vss_scheme.clone(), party2_msg3.0.vss_scheme.clone()], - &(key.party_index)) - .or_else(|e| Err(e))?; - - db::insert( - &state.db, -&claim.sub, - &id, - &Party1SharedKey, - &shared_key, - )?; - - db::insert( - &state.db, -&claim.sub, - &id, - &Party2VerifiableSecretShares, - &party2_msg3.0.vss_scheme, - )?; - - let msg3: KeyGenMessage3 = KeyGenMessage3 { - vss_scheme, - secret_share: secret_shares[PARTY2_INDEX - 1], - }; - - Ok(Json(msg3)) -} - -#[post("/schnorr/sign//", format = "json", data = "")] -pub fn sign( - state: State, - claim: Claims, - keygen_id: String, - eph_keygen_id: String, - party2_sign_msg1: Json, -) -> Result> { - let shared_key: SharedKeys = db::get( - &state.db, -&claim.sub, - &keygen_id, - &Party1SharedKey)? - .ok_or(format_err!("No data for such identifier {}", keygen_id))?; - let eph_shared_key: SharedKeys = db::get( - &state.db, -&claim.sub, - &eph_keygen_id, - &Party1SharedKey)? - .ok_or(format_err!("No data for such identifier {}", eph_keygen_id))?; - - let local_sig = LocalSig::compute( - &BigInt::to_bytes(&party2_sign_msg1.message).as_slice(), - &eph_shared_key, - &shared_key); - - let vss_scheme: VerifiableSS = db::get( - &state.db, -&claim.sub, - &keygen_id, - &Party1VerifiableSecretShares)? - .ok_or(format_err!("No data for such identifier {}", keygen_id))?; - let party2_vss_scheme: VerifiableSS = db::get( - &state.db, -&claim.sub, - &keygen_id, - &Party2VerifiableSecretShares)? - .ok_or(format_err!("No data for such identifier {}", keygen_id))?; - let eph_vss_scheme: VerifiableSS = db::get( - &state.db, - &claim.sub, - &eph_keygen_id, - &Party1VerifiableSecretShares)? - .ok_or(format_err!("No data for such identifier {}", eph_keygen_id))?; - let party2_eph_vss_scheme: VerifiableSS = db::get( - &state.db, - &claim.sub, - &eph_keygen_id, - &Party2VerifiableSecretShares)? - .ok_or(format_err!("No data for such identifier {}", eph_keygen_id))?; - - LocalSig::verify_local_sigs( - &vec![local_sig, party2_sign_msg1.local_sig], - &vec![PARTY1_INDEX - 1, PARTY2_INDEX - 1], - &vec![vss_scheme, party2_vss_scheme], - &vec![eph_vss_scheme, party2_eph_vss_scheme]) - .or_else(|e| Err(format_err!("{}", e))) - .and_then(|_vss_scheme| Ok(Json(local_sig))) -} \ No newline at end of file diff --git a/gotham-server/src/server.rs b/gotham-server/src/server.rs index e05af44..4bd55a2 100644 --- a/gotham-server/src/server.rs +++ b/gotham-server/src/server.rs @@ -7,17 +7,11 @@ // version 3 of the License, or (at your option) any later version. // -use config; -use rocket; -use rocket::{Request, Rocket}; -use rocksdb; +use log::info; +use rocket::{self, catch, catchers, routes, Build, Request, Rocket}; +use serde::Deserialize; -use rusoto_core::Region; -use rusoto_dynamodb::DynamoDbClient; - -use super::routes::*; -use super::storage::db; -use super::Config; +use super::{storage::db, Config}; use std::collections::HashMap; use std::str::FromStr; @@ -67,62 +61,45 @@ fn not_found(req: &Request) -> String { format!("Unknown route '{}'.", req.uri()) } -pub fn get_server() -> Rocket { - let settings = get_settings_as_map(); +pub fn get_server(settings: HashMap) -> Rocket { + // let settings = get_settings_as_map(); let db_config = Config { db: get_db(settings.clone()), }; - let auth_config = AuthConfig::load(settings.clone()); + let auth_config = AuthConfig::load(settings); - rocket::ignite() - .register(catchers![internal_error, not_found, bad_request]) + rocket::Rocket::build() + .register("/", catchers![internal_error, not_found, bad_request]) .mount( "/", routes![ - ping::ping, - ecdsa::first_message, - ecdsa::second_message, - ecdsa::chain_code_first_message, - ecdsa::chain_code_second_message, - ecdsa::sign_first, - ecdsa::sign_second, - ecdsa::rotate_first, - ecdsa::rotate_second, - ecdsa::recover, - schnorr::keygen_first, - schnorr::keygen_second, - schnorr::keygen_third, - schnorr::sign, - eddsa::keygen, - eddsa::sign_first, - eddsa::sign_second, + crate::routes::ping::ping, + crate::routes::ecdsa::first_message, + crate::routes::ecdsa::second_message, + crate::routes::ecdsa::third_message, + crate::routes::ecdsa::fourth_message, + crate::routes::ecdsa::chain_code_first_message, + crate::routes::ecdsa::chain_code_second_message, + crate::routes::ecdsa::sign_first, + crate::routes::ecdsa::sign_second, + crate::routes::ecdsa::recover, + crate::routes::eddsa::keygen ], ) .manage(db_config) .manage(auth_config) } -fn get_settings_as_map() -> HashMap { - let config_file = include_str!("../Settings.toml"); - let mut settings = config::Config::default(); - settings - .merge(config::File::from_str( - config_file, - config::FileFormat::Toml, - )) - .unwrap() - .merge(config::Environment::new()) - .unwrap(); - - settings.try_into::>().unwrap() -} - fn get_db(settings: HashMap) -> db::DB { let db_type_string = settings .get("db") .unwrap_or(&"local".to_string()) .to_uppercase(); + let db_name = settings.get("db_name").unwrap_or(&"db".to_string()).clone(); + if !db_name.chars().all(|e| char::is_ascii_alphanumeric(&e)) { + panic!("DB name is illegal, may only contain alphanumeric characters"); + } let db_type = db_type_string.as_str(); let env = settings .get("env") @@ -130,11 +107,14 @@ fn get_db(settings: HashMap) -> db::DB { .to_string(); match db_type { + #[cfg(feature = "aws")] "AWS" => { + use rusoto_core::Region; + use rusoto_dynamodb::DynamoDbClient; let region_option = settings.get("aws_region"); match region_option { Some(s) => { - let region_res = Region::from_str(&s); + let region_res = Region::from_str(s); match region_res { Ok(region) => db::DB::AWS(DynamoDbClient::new(region), env), Err(_e) => panic!("Set 'DB = AWS' but 'region' is not a valid value"), @@ -143,6 +123,15 @@ fn get_db(settings: HashMap) -> db::DB { None => panic!("Set 'DB = AWS' but 'region' is empty"), } } - _ => db::DB::Local(rocksdb::DB::open_default("./db").unwrap()), + _ => { + #[cfg(feature = "local")] + { + db::DB::Local(rocksdb::DB::open_default(format!("./{}", db_name)).unwrap()) + } + #[cfg(not(feature = "local"))] + { + unimplemented!("DB type not supported") + } + } } } diff --git a/gotham-server/src/storage/aws/dynamodb.rs b/gotham-server/src/storage/aws/dynamodb.rs index 367c205..8ca465a 100644 --- a/gotham-server/src/storage/aws/dynamodb.rs +++ b/gotham-server/src/storage/aws/dynamodb.rs @@ -1,15 +1,12 @@ -use super::error::*; -use super::*; -use failure; -use rusoto_dynamodb::*; -use serde; -use serde_json; -use std; +// use rusoto_dynamodb::*; +use failure::format_err; +use rusoto_dynamodb::{ + AttributeValue, DynamoDb, DynamoDbClient, GetItemInput, PutItemInput, PutItemOutput, +}; +use serde::{self, Deserialize, Serialize}; + +use log::{debug, error}; use std::collections::HashMap; -use std::default::Default; -use std::string::*; -use std::thread; -use std::time::Duration; const CUSTOMER_ID_IDENTIFIER: &str = "customerId"; const ID_IDENTIFIER: &str = "id"; @@ -21,13 +18,13 @@ struct DBItemIdentifier { id: String, } -pub fn insert( +pub async fn insert( dynamodb_client: &DynamoDbClient, user_id: &str, id: &str, table_name: &str, v: T, -) -> std::result::Result +) -> Result where T: serde::ser::Serialize, { @@ -35,15 +32,13 @@ where customerId: user_id.to_string(), id: id.to_string(), }; - println!("identifier = {:?}", identifier); + debug!("identifier = {:?}", identifier); let mut item = serde_dynamodb::to_hashmap(&identifier).unwrap(); - println!("item #1 = {:?}", item); item.extend(serde_dynamodb::to_hashmap(&v).unwrap()); - println!("item #2 = {:?}", item); let put_item_input = PutItemInput { - item: item, + item, table_name: table_name.to_string(), ..Default::default() }; @@ -51,17 +46,17 @@ where // Put item dynamodb_client .put_item(put_item_input) - .sync() + .await .map_err(|e| format_err!("DynamoDB error while inserting item: {}", e)) } -pub fn get<'a, T>( - dynamodb_client: &rusoto_dynamodb::DynamoDbClient, +pub async fn get<'a, T>( + dynamodb_client: &DynamoDbClient, user_id: &str, id: &str, table_name: String, - require_customer_id: bool -) -> std::result::Result, failure::Error> + require_customer_id: bool, +) -> Result, failure::Error> where T: serde::de::Deserialize<'a>, { @@ -85,7 +80,7 @@ where }, ); - println!("Querying table {}, key: {:?}", table_name, query_key); + debug!("Querying table {}, key: {:?}", table_name, query_key); let query_item = GetItemInput { key: query_key, @@ -93,146 +88,41 @@ where ..Default::default() }; - match dynamodb_client.get_item(query_item).sync() { + match dynamodb_client.get_item(query_item).await { Ok(item_from_dynamo) => match item_from_dynamo.item { None => { - println!("nothing received from Dynamo, item may not exist"); + debug!("nothing received from Dynamo, item may not exist"); Ok(None) } Some(mut attributes_map) => { // This is not the best we can do but if you look at the DBItemIdentifier above // we augment it with the ser/de of the actual object, so we remove extra fields // here. TODO: Is there something cleaner? - println!("#1"); attributes_map.remove(CUSTOMER_ID_IDENTIFIER); attributes_map.remove(ID_IDENTIFIER); - println!("#2, attributes_map = {:?}", attributes_map); let raw_item: serde_dynamodb::error::Result = serde_dynamodb::from_hashmap(attributes_map); - println!("#3"); match raw_item { - Ok(s) => { - println!("#4"); - Ok(Some(s)) - }, - Err(_e) => { - println!("#5, {}", _e); - Ok(None) - }, + Ok(s) => Ok(Some(s)), + Err(_e) => Ok(None), } } }, Err(err) => { - println!("Error retrieving object: {:?}", err); + error!("Error retrieving object: {:?}", err); Err(failure::err_msg(format!("{:?}", err))) } } } -pub fn list_tables(client: &DynamoDbClient) -> Result> { - let list_tables_input: ListTablesInput = Default::default(); - - let result = client.list_tables(list_tables_input).sync(); - - if let Ok(output) = result { - Ok(output.table_names.unwrap()) - } else { - Ok(vec![]) - } -} - -pub fn wait_for_table(client: &DynamoDbClient, name: &str) -> Result { - loop { - let table_desc = describe_table(client, name)?; - - match table_desc.table_status.as_ref().map(|s| &s[..]) { - Some("ACTIVE") => { - info!("table {} state ACTIVE", name); - return Ok(table_desc); - } - Some(_) => { - info!("table {} state {}", name, table_desc.table_status.unwrap()); - } - None => { - info!("table {} no state available", name); - } - } - - thread::sleep(Duration::from_secs(1)); - } -} - -pub fn create_table_if_needed( - client: &DynamoDbClient, - name: &str, - read_capacity: i64, - write_capacity: i64, -) -> Result { - loop { - match describe_table(client, name).map_err(Error::from) { - Err(Error(ErrorKind::TableNotFound(_), _)) => { - info!("table {} not found. creating..", name); - } - Err(e) => { - bail!(e); - } - Ok(table) => { - return Ok(table); - } - } - - info!("Continuing to create..."); - match create_table(client, name, read_capacity, write_capacity) { - Err(Error(ErrorKind::TableAlreadyExists(_), _)) => { - info!("table {} already exists. getting info..", name); - } - Err(e) => { - bail!(e); - } - Ok(()) => { - // pass - } - } - } -} - -pub fn describe_table(client: &DynamoDbClient, name: &str) -> Result { - let describe_table_input = DescribeTableInput { - table_name: name.to_owned(), - ..Default::default() - }; - - match client.describe_table(describe_table_input).sync() { - Err(DescribeTableError::ResourceNotFound(s)) => { - if s.starts_with("Requested resource not found: Table:") { - bail!(ErrorKind::TableNotFound(name.to_string())) - } - - bail!(ErrorKind::DescribeTable( - DescribeTableError::ResourceNotFound(s) - )) - } - Err(e) => bail!(ErrorKind::DescribeTable(e)), - Ok(table) => { - if let Some(table_desc) = table.table { - info!("table created at {:?}", table_desc.creation_date_time); - Ok(table_desc) - } else { - bail!(ErrorKind::NoTableInfo) - } - } - } -} - #[macro_export] macro_rules! attributes { ($($val:expr => $attr_type:expr),*) => { { - let mut temp_vec = Vec::new(); $( - temp_vec.push(AttributeDefinition { attribute_name: String::from($val), attribute_type: String::from($attr_type) }); + let temp_vec = vec![AttributeDefinition { attribute_name: String::from($val), attribute_type: String::from($attr_type) }]; )* temp_vec } @@ -243,52 +133,10 @@ macro_rules! attributes { macro_rules! key_schema { ($($name:expr => $key_type:expr),*) => { { - let mut temp_vec = Vec::new(); $( - temp_vec.push(KeySchemaElement { key_type: String::from($key_type), attribute_name: String::from($name) }); + let temp_vec = vec![(KeySchemaElement { key_type: String::from($key_type), attribute_name: String::from($name) })]; )* temp_vec } } } - -pub fn create_table( - client: &DynamoDbClient, - name: &str, - read_capacity: i64, - write_capacity: i64, -) -> Result<()> { - let create_table_input = CreateTableInput { - table_name: name.to_string(), - attribute_definitions: attributes!("id" => "S"), - key_schema: key_schema!("id" => "HASH"), - provisioned_throughput: ProvisionedThroughput { - read_capacity_units: read_capacity, - write_capacity_units: write_capacity, - }, - ..Default::default() - }; - - match client.create_table(create_table_input).sync() { - Err(CreateTableError::ResourceInUse(s)) => { - let maybe_value = serde_json::from_str::(&s); - - if let Ok(value) = maybe_value { - if value.message.starts_with("Table already exists:") { - bail!(ErrorKind::TableAlreadyExists(name.to_string())) - } - } - - bail!(ErrorKind::CreateTable(CreateTableError::ResourceInUse(s))) - } - Err(e) => bail!(ErrorKind::CreateTable(e)), - Ok(table) => { - if let Some(table_desc) = table.table_description { - info!("table created at {:?}", table_desc.creation_date_time); - Ok(()) - } else { - bail!(ErrorKind::NoTableInfo) - } - } - } -} diff --git a/gotham-server/src/storage/aws/error.rs b/gotham-server/src/storage/aws/error.rs deleted file mode 100644 index a98c41d..0000000 --- a/gotham-server/src/storage/aws/error.rs +++ /dev/null @@ -1,43 +0,0 @@ -use rusoto_dynamodb; -use serde_json; -use std::num; - -error_chain! { - foreign_links { - DescribeTable(rusoto_dynamodb::DescribeTableError); - ListTables(rusoto_dynamodb::ListTablesError); - CreateTable(rusoto_dynamodb::CreateTableError); - GetItem(rusoto_dynamodb::GetItemError); - PutItem(rusoto_dynamodb::PutItemError); - DeleteItem(rusoto_dynamodb::DeleteItemError); - ParseError(num::ParseIntError); - Json(serde_json::Error); - } - - errors { - NoTableInfo { - description("no table info returned") - display("no table info returned") - } - - TableAlreadyExists(t: String) { - description("table already exists") - display("table already exists: {}", t) - } - - TableNotFound(t: String) { - description("table not found") - display("table not found: {}", t) - } - - ConditionalUpdateFailed { - description("conditional update failed") - display("conditional update failed") - } - - MissingAttribute { - description("missing attribute") - display("missing attribute") - } - } -} diff --git a/gotham-server/src/storage/aws/mod.rs b/gotham-server/src/storage/aws/mod.rs index 5b4a5fc..53cb2aa 100644 --- a/gotham-server/src/storage/aws/mod.rs +++ b/gotham-server/src/storage/aws/mod.rs @@ -1,6 +1,7 @@ +#![cfg(feature = "aws")] + +use serde::{Deserialize, Serialize}; pub mod dynamodb; -#[allow(deprecated)] -pub mod error; #[derive(Debug, Serialize, Deserialize)] pub struct AWSError { diff --git a/gotham-server/src/storage/db.rs b/gotham-server/src/storage/db.rs index 5e156ea..8bfd039 100644 --- a/gotham-server/src/storage/db.rs +++ b/gotham-server/src/storage/db.rs @@ -6,18 +6,17 @@ // License as published by the Free Software Foundation, either // version 3 of the License, or (at your option) any later version. // -use super::super::Result; -use rocksdb; -use serde; - -use super::aws; +use crate::Result; +use log::debug; pub enum DB { + #[cfg(feature = "local")] Local(rocksdb::DB), + #[cfg(feature = "aws")] AWS(rusoto_dynamodb::DynamoDbClient, String), } -pub trait MPCStruct { +pub trait MPCStruct: Sync { fn to_string(&self) -> String; fn to_table_name(&self, env: &str) -> String { @@ -33,46 +32,57 @@ fn idify(user_id: &str, id: &str, name: &dyn MPCStruct) -> String { format!("{}_{}_{}", user_id, id, name.to_string()) } -pub fn insert(db: &DB, user_id: &str, id: &str, name: &dyn MPCStruct, v: T) -> Result<()> +pub async fn insert(db: &DB, user_id: &str, id: &str, name: &dyn MPCStruct, v: T) -> Result<()> where T: serde::ser::Serialize, { match db { + #[cfg(feature = "aws")] DB::AWS(dynamodb_client, env) => { let table_name = name.to_table_name(env); - aws::dynamodb::insert(&dynamodb_client, user_id, id, &table_name, v)?; + super::aws::dynamodb::insert(dynamodb_client, user_id, id, &table_name, v).await?; Ok(()) } + #[cfg(feature = "local")] DB::Local(rocksdb_client) => { let identifier = idify(user_id, id, name); let v_string = serde_json::to_string(&v).unwrap(); - rocksdb_client.put(identifier.as_ref(), v_string.as_ref())?; + rocksdb_client.put(identifier, v_string)?; Ok(()) } } } -pub fn get(db: &DB, user_id: &str, id: &str, name: &dyn MPCStruct) -> Result> +pub async fn get(db: &DB, user_id: &str, id: &str, name: &dyn MPCStruct) -> Result> where T: serde::de::DeserializeOwned, { match db { + #[cfg(feature = "aws")] DB::AWS(dynamodb_client, env) => { let table_name = name.to_table_name(env); - println!("table_name = {}", table_name); + debug!("table_name = {}", table_name); let require_customer_id = name.require_customer_id(); println!("require_customer_id = {}", require_customer_id); println!("user_id = {}", user_id); println!("id = {}", id); - let res: Option = aws::dynamodb::get(&dynamodb_client, user_id, id, table_name, require_customer_id)?; + let res: Option = super::aws::dynamodb::get( + dynamodb_client, + user_id, + id, + table_name, + require_customer_id, + ) + .await?; println!("res.is_none() = {}", res.is_none()); Ok(res) } + #[cfg(feature = "local")] DB::Local(rocksdb_client) => { let identifier = idify(user_id, id, name); debug!("Getting from db ({})", identifier); - let db_option = rocksdb_client.get(identifier.as_ref())?; + let db_option = rocksdb_client.get(identifier)?; let vec_option: Option> = db_option.map(|v| v.to_vec()); match vec_option { Some(vec) => Ok(serde_json::from_slice(&vec).unwrap()), diff --git a/gotham-server/src/tests.rs b/gotham-server/src/tests.rs index 038411e..a058bfe 100644 --- a/gotham-server/src/tests.rs +++ b/gotham-server/src/tests.rs @@ -6,305 +6,409 @@ // License as published by the Free Software Foundation, either // version 3 of the License, or (at your option) any later version. // -#[cfg(test)] -mod tests { - - use super::super::routes::ecdsa; - use super::super::server; - use rocket; - use rocket::http::ContentType; - use rocket::http::Header; - use rocket::http::Status; - use rocket::local::Client; - use serde_json; - use zk_paillier::zkproofs::SALT_STRING; - use std::env; - use std::time::Instant; - - use curv::elliptic::curves::secp256_k1::{GE, FE}; - use curv::arithmetic::traits::Converter; - use curv::cryptographic_primitives::twoparty::dh_key_exchange_variant_with_pok_comm::*; - use curv::BigInt; - use kms::chain_code::two_party as chain_code; - use kms::ecdsa::two_party::*; - use multi_party_ecdsa::protocols::two_party_ecdsa::lindell_2017::*; +#![cfg(test)] + +use crate::{routes::ecdsa, server}; +use std::collections::HashMap; +use std::env; +use std::time::Instant; +use time_test::time_test; + +use rocket::{http::ContentType, http::{Header, Status}, local::blocking::Client}; + use two_party_ecdsa::curv::arithmetic::traits::Converter; + use two_party_ecdsa::curv::cryptographic_primitives::twoparty::dh_key_exchange_variant_with_pok_comm::*; + use two_party_ecdsa::{party_one, party_two, curv::BigInt}; use floating_duration::TimeFormat; + use kms::chain_code::two_party as chain_code; + use kms::ecdsa::two_party::{MasterKey2, party1}; + +fn key_gen(client: &Client) -> (String, MasterKey2) { + time_test!(); + + /*************** START: FIRST MESSAGE ***************/ + let start = Instant::now(); - fn key_gen(client: &Client) -> (String, MasterKey2) { - time_test!(); + let response = client + .post("/ecdsa/keygen/first") + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); - /*************** START: FIRST MESSAGE ***************/ - let start = Instant::now(); + println!( + "{} Network/Server: party1 first message", + TimeFormat(start.elapsed()) + ); + let res_body = response.into_string().unwrap(); - let mut response = client - .post("/ecdsa/keygen/first") - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); + let (id, kg_party_one_first_message): (String, party_one::KeyGenFirstMsg) = + serde_json::from_str(&res_body).unwrap(); - println!("{} Network/Server: party1 first message", TimeFormat(start.elapsed())); + let start = Instant::now(); - let res_body = response.body_string().unwrap(); - let (id, kg_party_one_first_message): (String, party_one::KeyGenFirstMsg) = - serde_json::from_str(&res_body).unwrap(); + let (kg_party_two_first_message, kg_ec_key_pair_party2) = MasterKey2::key_gen_first_message(); - let start = Instant::now(); + println!( + "{} Client: party2 first message", + TimeFormat(start.elapsed()) + ); + /*************** END: FIRST MESSAGE ***************/ - let (kg_party_two_first_message, kg_ec_key_pair_party2) = - MasterKey2::key_gen_first_message(); + /*************** START: SECOND MESSAGE ***************/ + let body = serde_json::to_string(&kg_party_two_first_message.d_log_proof).unwrap(); - println!("{} Client: party2 first message", TimeFormat(start.elapsed())); - /*************** END: FIRST MESSAGE ***************/ + let start = Instant::now(); - /*************** START: SECOND MESSAGE ***************/ - let body = serde_json::to_string(&kg_party_two_first_message.d_log_proof).unwrap(); + let response = client + .post(format!("/ecdsa/keygen/{}/second", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); - let start = Instant::now(); + println!( + "{} Network/Server: party1 second message", + TimeFormat(start.elapsed()) + ); - let mut response = client - .post(format!("/ecdsa/keygen/{}/second", id)) - .body(body) - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); + let res_body = response.into_string().unwrap(); + let kg_party_one_second_message: party1::KeyGenParty1Message2 = + serde_json::from_str(&res_body).unwrap(); - println!("{} Network/Server: party1 second message", TimeFormat(start.elapsed())); + let start = Instant::now(); - let res_body = response.body_string().unwrap(); - let kg_party_one_second_message: party1::KeyGenParty1Message2 = - serde_json::from_str(&res_body).unwrap(); + let key_gen_second_message = MasterKey2::key_gen_second_message( + &kg_party_one_first_message, + &kg_party_one_second_message, + ); + assert!(key_gen_second_message.is_ok()); - let start = Instant::now(); + println!( + "{} Client: party2 second message", + TimeFormat(start.elapsed()) + ); - let key_gen_second_message = MasterKey2::key_gen_second_message( - &kg_party_one_first_message, - &kg_party_one_second_message, - SALT_STRING, - ); - assert!(key_gen_second_message.is_ok()); + let (party_two_second_message, party_two_paillier, party_two_pdl_chal) = + key_gen_second_message.unwrap(); - println!("{} Client: party2 second message", TimeFormat(start.elapsed())); + /*************** END: SECOND MESSAGE ***************/ - let (party_two_second_message, party_two_paillier) = - key_gen_second_message.unwrap(); + /*************** START: THIRD MESSAGE ***************/ + let body = serde_json::to_string(&party_two_second_message.pdl_first_message).unwrap(); - /*************** END: SECOND MESSAGE ***************/ + let start = Instant::now(); - /*************** START: CHAINCODE FIRST MESSAGE ***************/ - let start = Instant::now(); + let response = client + .post(format!("/ecdsa/keygen/{}/third", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 third message", + TimeFormat(start.elapsed()) + ); - let mut response = client - .post(format!("/ecdsa/keygen/{}/chaincode/first", id)) - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); + let res_body = response.into_string().unwrap(); + let party_one_third_message: party_one::PDLFirstMessage = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); - println!( - "{} Network/Server: party1 chain code first message", - TimeFormat(start.elapsed()) - ); + let pdl_decom_party2 = MasterKey2::key_gen_third_message(&party_two_pdl_chal); + + println!( + "{} Client: party2 third message", + TimeFormat(start.elapsed()) + ); + /*************** END: THIRD MESSAGE ***************/ + + /*************** START: FOURTH MESSAGE ***************/ + + let party_2_pdl_second_message = pdl_decom_party2; + let request = party_2_pdl_second_message; + let body = serde_json::to_string(&request).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/fourth", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 fourth message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let party_one_pdl_second_message: party_one::PDLSecondMessage = + serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + + MasterKey2::key_gen_fourth_message( + &party_two_pdl_chal, + &party_one_third_message, + &party_one_pdl_second_message, + ) + .expect("pdl error party1"); + + println!( + "{} Client: party2 fourth message", + TimeFormat(start.elapsed()) + ); + /*************** END: FOURTH MESSAGE ***************/ + + /*************** START: CHAINCODE FIRST MESSAGE ***************/ + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/chaincode/first", id)) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 chain code first message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let cc_party_one_first_message: Party1FirstMessage = serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + let (cc_party_two_first_message, cc_ec_key_pair2) = + chain_code::party2::ChainCode2::chain_code_first_message(); + + println!( + "{} Client: party2 chain code first message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE FIRST MESSAGE ***************/ + + /*************** START: CHAINCODE SECOND MESSAGE ***************/ + let body = serde_json::to_string(&cc_party_two_first_message.d_log_proof).unwrap(); + + let start = Instant::now(); + + let response = client + .post(format!("/ecdsa/keygen/{}/chaincode/second", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); + + println!( + "{} Network/Server: party1 chain code second message", + TimeFormat(start.elapsed()) + ); + + let res_body = response.into_string().unwrap(); + let cc_party_one_second_message: Party1SecondMessage = serde_json::from_str(&res_body).unwrap(); + + let start = Instant::now(); + let _cc_party_two_second_message = chain_code::party2::ChainCode2::chain_code_second_message( + &cc_party_one_first_message, + &cc_party_one_second_message, + ); + + println!( + "{} Client: party2 chain code second message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE SECOND MESSAGE ***************/ + + let start = Instant::now(); + let party2_cc = chain_code::party2::ChainCode2::compute_chain_code( + &cc_ec_key_pair2, + &cc_party_one_second_message.comm_witness.public_share, + ) + .chain_code; + + println!( + "{} Client: party2 chain code second message", + TimeFormat(start.elapsed()) + ); + /*************** END: CHAINCODE COMPUTE MESSAGE ***************/ + + println!( + "{} Network/Server: party1 master key", + TimeFormat(start.elapsed()) + ); + + let start = Instant::now(); + let party_two_master_key = MasterKey2::set_master_key( + &party2_cc, + &kg_ec_key_pair_party2, + &kg_party_one_second_message + .ecdh_second_message + .comm_witness + .public_share, + &party_two_paillier, + ); + + println!("{} Client: party2 master_key", TimeFormat(start.elapsed())); + /*************** END: MASTER KEYS MESSAGE ***************/ + + (id, party_two_master_key) +} + +fn sign( + client: &Client, + id: String, + master_key_2: MasterKey2, + message: BigInt, +) -> party_one::SignatureRecid { + time_test!(); + let (eph_key_gen_first_message_party_two, eph_comm_witness, eph_ec_key_pair_party2) = + MasterKey2::sign_first_message(); - let res_body = response.body_string().unwrap(); - let cc_party_one_first_message: Party1FirstMessage = - serde_json::from_str(&res_body).unwrap(); + let request: party_two::EphKeyGenFirstMsg = eph_key_gen_first_message_party_two; - let start = Instant::now(); - let (cc_party_two_first_message, cc_ec_key_pair2) = - chain_code::party2::ChainCode2::chain_code_first_message(); + let body = serde_json::to_string(&request).unwrap(); - println!("{} Client: party2 chain code first message", TimeFormat(start.elapsed())); - /*************** END: CHAINCODE FIRST MESSAGE ***************/ + let start = Instant::now(); - /*************** START: CHAINCODE SECOND MESSAGE ***************/ - let body = serde_json::to_string(&cc_party_two_first_message.d_log_proof).unwrap(); + let response = client + .post(format!("/ecdsa/sign/{}/first", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); - let start = Instant::now(); + println!( + "{} Network/Server: party1 sign first message", + TimeFormat(start.elapsed()) + ); - let mut response = client - .post(format!("/ecdsa/keygen/{}/chaincode/second", id)) - .body(body) - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); + let res_body = response.into_string().unwrap(); + let sign_party_one_first_message: party_one::EphKeyGenFirstMsg = + serde_json::from_str(&res_body).unwrap(); - println!( - "{} Network/Server: party1 chain code second message", - TimeFormat(start.elapsed()) - ); + let x_pos = BigInt::from(0u32); + let y_pos = BigInt::from(21u32); - let res_body = response.body_string().unwrap(); - let cc_party_one_second_message: Party1SecondMessage = - serde_json::from_str(&res_body).unwrap(); + let child_party_two_master_key = master_key_2.get_child(vec![x_pos.clone(), y_pos.clone()]); - let start = Instant::now(); - let _cc_party_two_second_message = - chain_code::party2::ChainCode2::chain_code_second_message( - &cc_party_one_first_message, - &cc_party_one_second_message, - ); - - println!("{} Client: party2 chain code second message", TimeFormat(start.elapsed())); - /*************** END: CHAINCODE SECOND MESSAGE ***************/ - - let start = Instant::now(); - let party2_cc = chain_code::party2::ChainCode2::compute_chain_code( - &cc_ec_key_pair2, - &cc_party_one_second_message.comm_witness.public_share, - ) - .chain_code; - - println!("{} Client: party2 chain code second message", TimeFormat(start.elapsed())); - /*************** END: CHAINCODE COMPUTE MESSAGE ***************/ - - let start = Instant::now(); - let party_two_master_key = MasterKey2::set_master_key( - &party2_cc, - &kg_ec_key_pair_party2, - &kg_party_one_second_message - .ecdh_second_message - .comm_witness - .public_share, - &party_two_paillier, - ); + let start = Instant::now(); - println!("{} Client: party2 master_key", TimeFormat(start.elapsed())); - /*************** END: MASTER KEYS MESSAGE ***************/ + let party_two_sign_message = child_party_two_master_key.sign_second_message( + &eph_ec_key_pair_party2, + eph_comm_witness.clone(), + &sign_party_one_first_message, + &message, + ); - (id, party_two_master_key) - } - - fn sign( - client: &Client, - id: String, - master_key_2: MasterKey2, - message: BigInt, - ) -> party_one::SignatureRecid { - time_test!(); - let (eph_key_gen_first_message_party_two, eph_comm_witness, eph_ec_key_pair_party2) = - MasterKey2::sign_first_message(); - - let request: party_two::EphKeyGenFirstMsg = eph_key_gen_first_message_party_two; - - let body = serde_json::to_string(&request).unwrap(); - - let start = Instant::now(); - - let mut response = client - .post(format!("/ecdsa/sign/{}/first", id)) - .body(body) - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); - - println!( - "{} Network/Server: party1 sign first message", - TimeFormat(start.elapsed()) - ); - - let res_body = response.body_string().unwrap(); - let sign_party_one_first_message: party_one::EphKeyGenFirstMsg = - serde_json::from_str(&res_body).unwrap(); - - let x_pos = BigInt::from(0); - let y_pos = BigInt::from(21); - - let child_party_two_master_key = master_key_2.get_child(vec![x_pos.clone(), y_pos.clone()]); - - let start = Instant::now(); - - let party_two_sign_message = child_party_two_master_key.sign_second_message( - &eph_ec_key_pair_party2, - eph_comm_witness.clone(), - &sign_party_one_first_message, - &message, - ); - - println!("{} Client: party2 sign second message", TimeFormat(start.elapsed())); - - let request: ecdsa::SignSecondMsgRequest = ecdsa::SignSecondMsgRequest { - message, - party_two_sign_message, - x_pos_child_key: x_pos, - y_pos_child_key: y_pos, - }; - - let body = serde_json::to_string(&request).unwrap(); - - let start = Instant::now(); - - let mut response = client - .post(format!("/ecdsa/sign/{}/second", id)) - .body(body) - .header(ContentType::JSON) - .dispatch(); - assert_eq!(response.status(), Status::Ok); - - println!( - "{} Network/Server: party1 sign second message", - TimeFormat(start.elapsed()) - ); - - let res_body = response.body_string().unwrap(); - let signature_recid: party_one::SignatureRecid = serde_json::from_str(&res_body).unwrap(); - - signature_recid - } - - #[test] - fn key_gen_and_sign() { - // Passthrough mode - env::set_var("region", ""); - env::set_var("pool_id", ""); - env::set_var("issuer", ""); - env::set_var("audience", ""); - - time_test!(); - - let client = Client::new(server::get_server()).expect("valid rocket instance"); - - let (id, master_key_2): (String, MasterKey2) = key_gen(&client); + println!( + "{} Client: party2 sign second message", + TimeFormat(start.elapsed()) + ); - let message = BigInt::from(1234); + let request: ecdsa::SignSecondMsgRequest = ecdsa::SignSecondMsgRequest { + message, + party_two_sign_message, + x_pos_child_key: x_pos, + y_pos_child_key: y_pos, + }; - let signature: party_one::SignatureRecid = sign(&client, id, master_key_2, message); + let body = serde_json::to_string(&request).unwrap(); - println!( - "s = (r: {}, s: {}, recid: {})", - signature.r.to_hex(), - signature.s.to_hex(), - signature.recid - ); - } + let start = Instant::now(); - #[test] - fn authentication_test_invalid_token() { - env::set_var("region", "region"); - env::set_var("pool_id", "pool_id"); - env::set_var("issuer", "issuer"); - env::set_var("audience", "audience"); + let response = client + .post(format!("/ecdsa/sign/{}/second", id)) + .body(body) + .header(ContentType::JSON) + .dispatch(); + assert_eq!(response.status(), Status::Ok); - let client = Client::new(server::get_server()).expect("valid rocket instance"); + println!( + "{} Network/Server: party1 sign second message", + TimeFormat(start.elapsed()) + ); - let auth_header = Header::new("Authorization", "Bearer a"); - let response = client - .post("/ecdsa/keygen/first") - .header(ContentType::JSON) - .header(auth_header) - .dispatch(); + let res_body = response.into_string().unwrap(); + let signature_recid: party_one::SignatureRecid = serde_json::from_str(&res_body).unwrap(); + + signature_recid +} - assert_eq!(401, response.status().code); - } +#[test] +fn key_gen_and_sign() { + // Passthrough mode + env::set_var("region", ""); + env::set_var("pool_id", ""); + env::set_var("issuer", ""); + env::set_var("audience", ""); - #[test] - fn authentication_test_expired_token() { - env::set_var("region", "region"); - env::set_var("pool_id", "pool_id"); - env::set_var("issuer", "issuer"); - env::set_var("audience", "audience"); + time_test!(); - let client = Client::new(server::get_server()).expect("valid rocket instance"); + let settings = HashMap::::from([ + ("db".to_string(), "local".to_string()), + ("db_name".to_string(), "KeyGenAndSign".to_string()), + ]); + let client = Client::tracked(server::get_server(settings)).expect("valid rocket instance"); + + let (id, master_key_2): (String, MasterKey2) = key_gen(&client); + + let message = BigInt::from(1234u32); + + let signature: party_one::SignatureRecid = sign(&client, id, master_key_2, message); + + println!( + "s = (r: {}, s: {}, recid: {})", + signature.r.to_hex(), + signature.s.to_hex(), + signature.recid + ); +} + +#[test] +fn authentication_test_invalid_token() { + env::set_var("region", "region"); + env::set_var("pool_id", "pool_id"); + env::set_var("issuer", "issuer"); + env::set_var("audience", "audience"); + + let settings = HashMap::::from([ + ("db".to_string(), "local".to_string()), + ( + "db_name".to_string(), + "AuthenticationTestInvalidToken".to_string(), + ), + ]); + let client = Client::tracked(server::get_server(settings)).expect("valid rocket instance"); + + let auth_header = Header::new("Authorization", "Bearer a"); + let response = client + .post("/ecdsa/keygen/first") + .header(ContentType::JSON) + .header(auth_header) + .dispatch(); + + assert_eq!(401, response.status().code); +} - let token: String = "Bearer eyJraWQiOiJZeEdoUlhsTytZSWpjU2xWZFdVUFA1dHhWd\ +#[test] +fn authentication_test_expired_token() { + env::set_var("region", "region"); + env::set_var("pool_id", "pool_id"); + env::set_var("issuer", "issuer"); + env::set_var("audience", "audience"); + + let settings = HashMap::::from([ + ("db".to_string(), "local".to_string()), + ( + "db_name".to_string(), + "AuthenticationTestExpiredToken".to_string(), + ), + ]); + let client = Client::tracked(server::get_server(settings)).expect("valid rocket instance"); + + let token: String = "Bearer eyJraWQiOiJZeEdoUlhsTytZSWpjU2xWZFdVUFA1dHhWd\ FRSTTNmTndNZTN4QzVnXC9YZz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjNDAz\ ZTBlNy1jM2QwLTRhNDUtODI2Mi01MTM5OTIyZjc5NTgiLCJhdWQiOiI0cG1jaXUx\ YWhyZjVzdm1nbTFobTVlbGJ1cCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJjdXN0\ @@ -323,16 +427,15 @@ mod tests { PWRBXldmmp9pxivbEYixWaIRtsJxpK02ODtOUR67o4RVeVLfthQMR4wiANO_hKLH\ rt76DEkAntM0KIFODS6o6PBZw2IP4P7x21IgcDrTO3yotcc-RVEq0X1N3wI8clr8\ DaVVZgolenGlERVMfD5i0YWIM1j7GgQ1fuQ8J_LYiQ" - .to_string(); + .to_string(); - let auth_header = Header::new("Authorization", token); + let auth_header = Header::new("Authorization", token); - let response = client - .post("/ecdsa/keygen/first") - .header(ContentType::JSON) - .header(auth_header) - .dispatch(); + let response = client + .post("/ecdsa/keygen/first") + .header(ContentType::JSON) + .header(auth_header) + .dispatch(); - assert_eq!(401, response.status().code); - } + assert_eq!(401, response.status().code); } diff --git a/gotham-utilities/server/docker-build-img/Dockerfile b/gotham-utilities/server/docker-build-img/Dockerfile index e3c9ea4..4de07c8 100644 --- a/gotham-utilities/server/docker-build-img/Dockerfile +++ b/gotham-utilities/server/docker-build-img/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:xenial +FROM rust:bullseye LABEL maintainer="g.benattar@gmail.com" LABEL description="This is the build stage for Gotham server" @@ -13,7 +13,7 @@ RUN apt-get update && apt-get install -y \ pkg-config \ npm -RUN curl -sL https://deb.nodesource.com/setup_11.x | bash - +RUN curl -fsSL https://deb.nodesource.com/setup_14.x | bash - RUN apt-get install -y nodejs ADD . / @@ -21,24 +21,20 @@ ADD . / WORKDIR /gotham-utilities/server/cognito RUN ["npm", "install"] -# Rust -ARG CHANNEL="nightly" -RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly-2019-07-10 - ENV rocket_address=0.0.0.0 ENV rocket_port=8000 EXPOSE 8000 WORKDIR /gotham-server -RUN ["/root/.cargo/bin/cargo", "build", "--release"] +RUN ["cargo", "build", "--release"] WORKDIR /integration-tests -RUN ["/root/.cargo/bin/cargo", "test", "--release", "--", "--nocapture"] +RUN ["cargo", "test", "--release", "--", "--nocapture"] # Server ENV db=AWS WORKDIR /gotham-server -CMD ["/root/.cargo/bin/cargo", "run", "--release"] +CMD ["cargo", "run", "--release"] diff --git a/integration-tests/.gitignore b/integration-tests/.gitignore index 0dedd1f..04821c3 100644 --- a/integration-tests/.gitignore +++ b/integration-tests/.gitignore @@ -1,2 +1,5 @@ db/ target/ +ecdsa/ +eddsa/ +schnorr/ \ No newline at end of file diff --git a/integration-tests/Cargo.lock b/integration-tests/Cargo.lock new file mode 100644 index 0000000..df6faa1 --- /dev/null +++ b/integration-tests/Cargo.lock @@ -0,0 +1,3229 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "aho-corasick" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "arrayvec" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "autocfg" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "backtrace" +version = "0.3.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "backtrace-sys" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bech32" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bellman" +version = "0.1.0" +source = "git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a#3e667406323430813f6dbae2a60b5a83046fa20a" +dependencies = [ + "bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pairing 0.14.2 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bindgen" +version = "0.47.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "clang-sys 0.26.4 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-vec" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bit-vec" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bitcoin" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitcoin-bech32 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "secp256k1 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitcoin-bech32" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bech32 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bitflags" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "blake2-rfc" +version = "0.2.18" +source = "git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9#7a5b5fc99ae483a0043db7547fb79a6fa44b88a9" +dependencies = [ + "arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "blake2b_simd" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "arrayvec 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-buffer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bulletproof" +version = "0.1.0" +source = "git+https://github.com/KZen-networks/bulletproofs?branch=feature/libra-support-fix#79a19f9ba6972fd99779f984e673e3ca03631201" +dependencies = [ + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "byte-tools" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "byteorder" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cc" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "centipede" +version = "0.2.0" +source = "git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix#4d1b8907b346e1c57fba20a5dc5135af6216f3ca" +dependencies = [ + "bulletproof 0.1.0 (git+https://github.com/KZen-networks/bulletproofs?branch=feature/libra-support-fix)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cexpr" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "chrono" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clang-sys" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "clear_on_drop" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "config" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde-hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "yaml-rust 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "const_fn" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cookie" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crc32fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "crossbeam-channel" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-epoch 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crypto-mac" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "cryptoxide" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "curv" +version = "0.2.0" +source = "git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix#640f4ca97318004f3000cc2f782aa3b2de92a43b" +dependencies = [ + "cryptoxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.0.3 (git+https://github.com/Zengo-X/curve25519-dalek?tag=1.0.3-subtle2.2.2)", + "merkle 1.10.1-pre (git+https://github.com/KZen-networks/merkle.rs)", + "pairing 0.14.2 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-gmp 0.5.0 (git+https://github.com/KZen-networks/rust-gmp)", + "sapling-crypto 0.0.1 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "secp256k1 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zeroize 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "curv" +version = "0.2.0" +source = "git+https://github.com/oleiba/curv?branch=feature/libra-support-fix#885f9199d72ec6e52b23b9497d26fa8ac5f5f542" +dependencies = [ + "cryptoxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curve25519-dalek 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "merkle 1.10.1-pre (git+https://github.com/KZen-networks/merkle.rs)", + "pairing 0.14.2 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-gmp 0.5.0 (git+https://github.com/KZen-networks/rust-gmp)", + "sapling-crypto 0.0.1 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "secp256k1 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "zeroize 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "curve25519-dalek" +version = "1.0.3" +source = "git+https://github.com/Zengo-X/curve25519-dalek?tag=1.0.3-subtle2.2.2#3a6cf140198096c6994a5e40ca8ad8e87d70b8be" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "curve25519-dalek" +version = "1.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "devise" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "devise_codegen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "devise_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "devise_codegen" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "devise_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "devise_core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dirs" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_users 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "dtoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "electrumx_client" +version = "0.1.0" +source = "git+https://github.com/KZen-networks/rust-electrumx-client?tag=bitcoin@0.16.0#7f59a9be11b68c1e11396f0d1e3dc36a89cbe434" +dependencies = [ + "bitcoin 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "encoding_rs" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "env_logger" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "git+https://github.com/ZenGo-X/failure#eb31b454d5bd3266f5d60545ed02f7dd8074c56c" +dependencies = [ + "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", + "failure_derive 0.1.8 (git+https://github.com/ZenGo-X/failure)", +] + +[[package]] +name = "failure" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "failure_derive" +version = "0.1.8" +source = "git+https://github.com/ZenGo-X/failure#eb31b454d5bd3266f5d60545ed02f7dd8074c56c" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "filetime" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fsevent" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fsevent-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "fuchsia-zircon" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fuchsia-zircon-sys" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "generic-array" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "generic-array" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "getrandom" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "glob" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "gotham-client" +version = "0.1.0" +dependencies = [ + "bitcoin 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", + "centipede 0.2.0 (git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix)", + "clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)", + "config 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "electrumx_client 0.1.0 (git+https://github.com/KZen-networks/rust-electrumx-client?tag=bitcoin@0.16.0)", + "failure 0.1.8 (git+https://github.com/ZenGo-X/failure)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", + "kms 0.1.0 (git+https://github.com/KZen-networks/kms-secp256k1?branch=feature/libra-support-fix)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "multi-party-ecdsa 0.1.0 (git+https://github.com/KZen-networks/multi-party-ecdsa?branch=feature/libra-support-fix)", + "multi-party-ed25519 0.1.1 (git+https://github.com/KZen-networks/multi-party-eddsa?branch=feature/libra-support-fix)", + "multi-party-schnorr 0.2.0 (git+https://github.com/KZen-networks/multi-party-schnorr?branch=feature/libra-support-fix)", + "reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "secp256k1 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "zk-paillier 0.1.0 (git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix)", +] + +[[package]] +name = "gotham-server" +version = "0.1.0" +dependencies = [ + "chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "config 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "env_logger 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)", + "failure 0.1.8 (git+https://github.com/ZenGo-X/failure)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "jsonwebtoken 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "kms 0.1.0 (git+https://github.com/KZen-networks/kms-secp256k1?branch=feature/libra-support-fix)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "multi-party-ecdsa 0.1.0 (git+https://github.com/KZen-networks/multi-party-ecdsa?branch=feature/libra-support-fix)", + "multi-party-ed25519 0.1.1 (git+https://github.com/KZen-networks/multi-party-eddsa?branch=feature/libra-support-fix)", + "multi-party-schnorr 0.2.0 (git+https://github.com/KZen-networks/multi-party-schnorr?branch=feature/libra-support-fix)", + "rocket 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "rocket_contrib 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "rocksdb 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rusoto_core 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rusoto_dynamodb 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_dynamodb 0.2.0 (git+https://github.com/KZen-networks/serde_dynamodb)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "time-test 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "zk-paillier 0.1.0 (git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix)", +] + +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hashbrown" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hashbrown" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hermit-abi" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hex" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "hmac" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crypto-mac 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "httparse" +version = "1.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "humantime" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.10.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper" +version = "0.12.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-tls" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "indexmap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "hashbrown 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "inotify" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "inotify-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itertools" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "itoa" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "jobserver" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "jsonwebtoken" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "keccak" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "kms" +version = "0.1.0" +source = "git+https://github.com/KZen-networks/kms-secp256k1?branch=feature/libra-support-fix#70922064975e22c3b45c772abc92cc4baa7f4321" +dependencies = [ + "centipede 0.2.0 (git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "multi-party-ecdsa 0.1.0 (git+https://github.com/KZen-networks/multi-party-ecdsa?branch=feature/libra-support-fix)", + "multi-party-schnorr 0.2.0 (git+https://github.com/KZen-networks/multi-party-schnorr?branch=feature/libra-support-fix)", + "paillier 0.2.1-alpha.0 (git+https://github.com/KZen-networks/rust-paillier?branch=feature/libra-support-fix)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-gmp 0.5.0 (git+https://github.com/KZen-networks/rust-gmp)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "zk-paillier 0.1.0 (git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix)", +] + +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libc" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "libflate" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crc32fast 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "librocksdb-sys" +version = "5.18.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bindgen 0.47.3 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "linked-hash-map" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "log" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "md5" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "merkle" +version = "1.10.1-pre" +source = "git+https://github.com/KZen-networks/merkle.rs#8ef335b975e097f26d65ab4c00124c961e8eb025" +dependencies = [ + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "mime_guess" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio" +version = "0.6.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-extras" +version = "2.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazycell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multi-party-ecdsa" +version = "0.1.0" +source = "git+https://github.com/KZen-networks/multi-party-ecdsa?branch=feature/libra-support-fix#a48974ed03fa2a9348852c4440a07e496ac361e3" +dependencies = [ + "centipede 0.2.0 (git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "paillier 0.2.1-alpha.0 (git+https://github.com/KZen-networks/rust-paillier?branch=feature/libra-support-fix)", + "reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "rocket_contrib 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", + "zk-paillier 0.1.0 (git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix)", +] + +[[package]] +name = "multi-party-ed25519" +version = "0.1.1" +source = "git+https://github.com/KZen-networks/multi-party-eddsa?branch=feature/libra-support-fix#3aac4cf1460f94e99807d66cd9ef412f4b554603" +dependencies = [ + "curv 0.2.0 (git+https://github.com/oleiba/curv?branch=feature/libra-support-fix)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "multi-party-schnorr" +version = "0.2.0" +source = "git+https://github.com/KZen-networks/multi-party-schnorr?branch=feature/libra-support-fix#ae7fea1850b8dc1c37c73fa8a54415859036ca0a" +dependencies = [ + "centipede 0.2.0 (git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "native-tls" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.10.30 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "net2" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "nom" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "notify" +version = "4.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "filetime 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "inotify 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-integer" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num_cpus" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl" +version = "0.10.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-probe" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "openssl-sys" +version = "0.9.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "paillier" +version = "0.2.1-alpha.0" +source = "git+https://github.com/KZen-networks/rust-paillier?branch=feature/libra-support-fix#d573624b5eb74de94b70b243ec9b8370fd7b9a38" +dependencies = [ + "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pairing" +version = "0.14.2" +source = "git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a#3e667406323430813f6dbae2a60b5a83046fa20a" +dependencies = [ + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pear" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pear_codegen 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "pear_codegen" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "yansi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pkg-config" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ppv-lite86" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "proc-macro2" +version = "0.4.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "quote" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon-core 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rayon-core" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-channel 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "redox_users" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", + "rust-argon2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "remove_dir_all" +version = "0.5.3" +source = "git+https://github.com/ZenGo-X/remove_dir_all?tag=v0.5.3-fix#36735a0bbfc9a77dd5a2711ab71b3ba9b2bae282" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "reqwest" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.25 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ring" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", + "untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rle-decode-fast" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rocket" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a#fc78eaf8363f1d3346ed9f51a6168f4b55152e8a" +dependencies = [ + "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pear 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_codegen 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "rocket_http 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "state 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "yansi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rocket_codegen" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a#fc78eaf8363f1d3346ed9f51a6168f4b55152e8a" +dependencies = [ + "devise 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket_http 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", + "yansi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rocket_contrib" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a#fc78eaf8363f1d3346ed9f51a6168f4b55152e8a" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)", + "rocket 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rocket_http" +version = "0.5.0-dev" +source = "git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a#fc78eaf8363f1d3346ed9f51a6168f4b55152e8a" +dependencies = [ + "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pear 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "state 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rocksdb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "librocksdb-sys 5.18.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rusoto_core" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "md5 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", + "rusoto_credential 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rusoto_credential" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", + "dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rusoto_dynamodb" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "rusoto_core 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-argon2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", + "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-crypto" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-gmp" +version = "0.5.0" +source = "git+https://github.com/KZen-networks/rust-gmp#a15e0ec20cef8aee83e91edc7759ec3042253afa" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rust-ini" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-demangle" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sapling-crypto" +version = "0.0.1" +source = "git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a#3e667406323430813f6dbae2a60b5a83046fa20a" +dependencies = [ + "bellman 0.1.0 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)", + "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "pairing 0.14.2 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "schannel" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "scopeguard" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "secp256k1" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde-hjson" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "1.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_dynamodb" +version = "0.2.0" +source = "git+https://github.com/KZen-networks/serde_dynamodb#cbb9562c782b6ef8c5ed1e44ce7425b7a967f1f9" +dependencies = [ + "rusoto_dynamodb 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_json" +version = "1.0.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_test" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_urlencoded" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha2" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "sha3" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "slab" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "smallvec" +version = "0.6.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "state" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "strsim" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "subtle" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "syn" +version = "0.15.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "syn" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "synstructure" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "take_mut" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tempfile" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.5.3 (git+https://github.com/ZenGo-X/remove_dir_all?tag=v0.5.3-fix)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termcolor" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tests" +version = "0.1.0" +dependencies = [ + "gotham-client 0.1.0", + "gotham-server 0.1.0", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", + "time-test 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "thread_local" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "time-test" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tinyvec" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "tokio" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-fs 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-udp 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-uds 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-buf" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-codec" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-fs" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-sync" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-udp" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-uds" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "toml" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typeable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "typenum" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-normalization" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "tinyvec 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "unicode-width" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "untrusted" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "version_check" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "walkdir" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "which" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "ws2_32-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "xml-rs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "yaml-rust" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "yaml-rust" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "yansi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "zeroize" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "zk-paillier" +version = "0.1.0" +source = "git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix#4763bc0e7353ddc659c7ae67cc3b91530232f93d" +dependencies = [ + "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)", + "paillier 0.2.1-alpha.0 (git+https://github.com/KZen-networks/rust-paillier?branch=feature/libra-support-fix)", + "rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[metadata] +"checksum adler32 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +"checksum aho-corasick 0.7.14 (registry+https://github.com/rust-lang/crates.io-index)" = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +"checksum arrayvec 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" +"checksum arrayvec 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +"checksum autocfg 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" +"checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +"checksum backtrace 0.3.44 (registry+https://github.com/rust-lang/crates.io-index)" = "e4036b9bf40f3cf16aba72a3d65e8a520fc4bafcdc7079aea8f848c58c5b5536" +"checksum backtrace-sys 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "18fbebbe1c9d1f383a9cc7e8ccdb471b91c8d024ee9c2ca5b5346121fe8b4399" +"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +"checksum base64 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +"checksum bech32 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ad20b907fd16610c3960c7fe9dae13dd243343409bab80299774c9a8b5d7bed8" +"checksum bellman 0.1.0 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)" = "" +"checksum bindgen 0.47.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df683a55b54b41d5ea8ebfaebb5aa7e6b84e3f3006a78f010dadc9ca88469260" +"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" +"checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb" +"checksum bitcoin 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7f9411713f2eec2b76ebb5fc0407e9bcef86130e33e196749be3f9970eb7f7f6" +"checksum bitcoin-bech32 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f0a5cfe5abcb5040b36d4ea8acba95288fefebd7959b59475f2c4ec705974b4c" +"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +"checksum blake2-rfc 0.2.18 (git+https://github.com/gtank/blake2-rfc?rev=7a5b5fc99ae483a0043db7547fb79a6fa44b88a9)" = "" +"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +"checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" +"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +"checksum bulletproof 0.1.0 (git+https://github.com/KZen-networks/bulletproofs?branch=feature/libra-support-fix)" = "" +"checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" +"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" +"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum cc 1.0.61 (registry+https://github.com/rust-lang/crates.io-index)" = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" +"checksum centipede 0.2.0 (git+https://github.com/KZen-networks/centipede?branch=feature/libra-support-fix)" = "" +"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d" +"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +"checksum cfg-if 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +"checksum chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +"checksum clang-sys 0.26.4 (registry+https://github.com/rust-lang/crates.io-index)" = "6ef0c1bcf2e99c649104bd7a7012d8f8802684400e03db0ec0af48583c6fa0e4" +"checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +"checksum clear_on_drop 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "97276801e127ffb46b66ce23f35cc96bd454fa311294bced4bbace7baa8b1d17" +"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +"checksum config 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f9107d78ed62b3fa5a86e7d18e647abed48cfd8f8fab6c72f4cdb982d196f7e6" +"checksum const_fn 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" +"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +"checksum cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +"checksum core-foundation 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" +"checksum core-foundation-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" +"checksum crc32fast 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +"checksum crossbeam 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "24ce9782d4d5c53674646a6a4c1863a21a8fc0cb649b3c94dfc16e45071dea19" +"checksum crossbeam-channel 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" +"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" +"checksum crossbeam-deque 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +"checksum crossbeam-epoch 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +"checksum crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum crossbeam-utils 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" +"checksum crypto-mac 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0999b4ff4d3446d4ddb19a63e9e00c1876e75cd7000d20e57a693b4b3f08d958" +"checksum cryptoxide 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e35f15e1a0699dd988fed910dd78fdc6407f44654cd12589c91fa44ea67d9159" +"checksum curv 0.2.0 (git+https://github.com/KZen-networks/curv?branch=feature/libra-support-fix)" = "" +"checksum curv 0.2.0 (git+https://github.com/oleiba/curv?branch=feature/libra-support-fix)" = "" +"checksum curve25519-dalek 1.0.3 (git+https://github.com/Zengo-X/curve25519-dalek?tag=1.0.3-subtle2.2.2)" = "" +"checksum curve25519-dalek 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "405681bfe2b7b25ad8660dfd90b6e8be9e470e224ff49e36b587d43f29a22601" +"checksum devise 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e04ba2d03c5fa0d954c061fc8c9c288badadffc272ebb87679a89846de3ed3" +"checksum devise_codegen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "066ceb7928ca93a9bedc6d0e612a8a0424048b0ab1f75971b203d01420c055d7" +"checksum devise_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf41c59b22b5e3ec0ea55c7847e5f358d340f3a8d6d53a5cf4f1564967f96487" +"checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" +"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +"checksum dirs 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3fd78930633bd1c6e35c4b42b1df7b0cbc6bc191146e512bb3bedf243fcc3901" +"checksum dtoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "134951f4028bdadb9b84baf4232681efbf277da25144b9b0ad65df75946c422b" +"checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +"checksum electrumx_client 0.1.0 (git+https://github.com/KZen-networks/rust-electrumx-client?tag=bitcoin@0.16.0)" = "" +"checksum encoding_rs 0.8.25 (registry+https://github.com/rust-lang/crates.io-index)" = "f62bc5e388624f1a13da83b479275dbec9663a876e414df80decf7d2cdab6670" +"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3" +"checksum env_logger 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "54532e3223c5af90a6a757c90b5c5521564b07e5e7a958681bcd2afad421cdcd" +"checksum error-chain 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +"checksum failure 0.1.8 (git+https://github.com/ZenGo-X/failure)" = "" +"checksum failure 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +"checksum failure_derive 0.1.8 (git+https://github.com/ZenGo-X/failure)" = "" +"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +"checksum filetime 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" +"checksum fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +"checksum fsevent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ab7d1bd1bd33cc98b0889831b72da23c0aa4df9cec7e0702f46ecea04b35db6" +"checksum fsevent-sys 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" +"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" +"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" +"checksum futures 0.1.30 (registry+https://github.com/rust-lang/crates.io-index)" = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" +"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" +"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" +"checksum getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +"checksum hashbrown 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3bae29b6653b3412c2e71e9d486db9f9df5d701941d86683005efb9f2d28e3da" +"checksum hashbrown 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +"checksum hermit-abi 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum hmac 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44f3bdb08579d99d7dc761c0e266f13b5f2ab8c8c703b9fc9ef333cd8f48f55e" +"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" +"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +"checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" +"checksum hyper 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" +"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +"checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" +"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +"checksum indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +"checksum inotify 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" +"checksum inotify-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" +"checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +"checksum itertools 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0d47946d458e94a1b7bcabbf6521ea7c037062c81f534615abcad76e84d4970d" +"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484" +"checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +"checksum jsonwebtoken 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a81d1812d731546d2614737bee92aa071d37e9afa1409bc374da9e5e70e70b22" +"checksum keccak 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67c21572b4949434e4fc1e1978b99c5f77064153c59d998bf13ecd96fb5ecba7" +"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +"checksum kms 0.1.0 (git+https://github.com/KZen-networks/kms-secp256k1?branch=feature/libra-support-fix)" = "" +"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" +"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +"checksum lazycell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" +"checksum libc 0.2.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" +"checksum libflate 0.1.27 (registry+https://github.com/rust-lang/crates.io-index)" = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" +"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +"checksum librocksdb-sys 5.18.3 (registry+https://github.com/rust-lang/crates.io-index)" = "d19778314deaa7048f2ea7d07b8aa12e1c227acebe975a37eeab6d2f8c74e41b" +"checksum linked-hash-map 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d262045c5b87c0861b3f004610afd0e2c851e2908d08b6c870cbb9d5f494ecd" +"checksum linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +"checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +"checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +"checksum md5 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "79c56d6a0b07f9e19282511c83fc5b086364cbae4ba8c7d5f190c3d9b0425a48" +"checksum memchr 2.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +"checksum memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +"checksum merkle 1.10.1-pre (git+https://github.com/KZen-networks/merkle.rs)" = "" +"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)" = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +"checksum mime_guess 2.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" +"checksum mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)" = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +"checksum mio-extras 2.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" +"checksum mio-uds 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +"checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum multi-party-ecdsa 0.1.0 (git+https://github.com/KZen-networks/multi-party-ecdsa?branch=feature/libra-support-fix)" = "" +"checksum multi-party-ed25519 0.1.1 (git+https://github.com/KZen-networks/multi-party-eddsa?branch=feature/libra-support-fix)" = "" +"checksum multi-party-schnorr 0.2.0 (git+https://github.com/KZen-networks/multi-party-schnorr?branch=feature/libra-support-fix)" = "" +"checksum native-tls 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" +"checksum net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +"checksum nodrop 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" +"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" +"checksum notify 4.0.15 (registry+https://github.com/rust-lang/crates.io-index)" = "80ae4a7688d1fab81c5bf19c64fc8db920be8d519ce6336ed4e7efe024724dbd" +"checksum num-integer 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +"checksum num-traits 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +"checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +"checksum openssl 0.10.30 (registry+https://github.com/rust-lang/crates.io-index)" = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" +"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +"checksum openssl-sys 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)" = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +"checksum paillier 0.2.1-alpha.0 (git+https://github.com/KZen-networks/rust-paillier?branch=feature/libra-support-fix)" = "" +"checksum pairing 0.14.2 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)" = "" +"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +"checksum pear 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5320f212db967792b67cfe12bd469d08afd6318a249bd917d5c19bc92200ab8a" +"checksum pear_codegen 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bfc1c836fdc3d1ef87c348b237b5b5c4dff922156fb2d968f57734f9669768ca" +"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" +"checksum pkg-config 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)" = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +"checksum ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +"checksum proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +"checksum quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +"checksum rand 0.3.23 (registry+https://github.com/rust-lang/crates.io-index)" = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +"checksum rand 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +"checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +"checksum rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" +"checksum rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +"checksum rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +"checksum rand_jitter 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +"checksum rand_os 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +"checksum rand_pcg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +"checksum rayon 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" +"checksum rayon-core 1.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" +"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +"checksum redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)" = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +"checksum redox_users 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +"checksum regex 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +"checksum regex-syntax 0.6.21 (registry+https://github.com/rust-lang/crates.io-index)" = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +"checksum remove_dir_all 0.5.3 (git+https://github.com/ZenGo-X/remove_dir_all?tag=v0.5.3-fix)" = "" +"checksum reqwest 0.9.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ab52e462d1e15891441aeefadff68bdea005174328ce3da0a314f2ad313ec837" +"checksum ring 0.14.6 (registry+https://github.com/rust-lang/crates.io-index)" = "426bc186e3e95cac1e4a4be125a4aca7e84c2d616ffc02244eef36e2a60a093c" +"checksum rle-decode-fast 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cabe4fa914dec5870285fa7f71f602645da47c486e68486d2b4ceb4a343e90ac" +"checksum rocket 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)" = "" +"checksum rocket_codegen 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)" = "" +"checksum rocket_contrib 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)" = "" +"checksum rocket_http 0.5.0-dev (git+https://github.com/SergioBenitez/Rocket.git?rev=fc78eaf8363f1d3346ed9f51a6168f4b55152e8a)" = "" +"checksum rocksdb 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39be726e556e6f21d54d21cdf1be9f6df30c0411a5856c1abf3f4bb12498f2ed" +"checksum rusoto_core 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18a699355ef3189e3bbf34b64ff5a31f06456b689b09d05cdb4a901dcf4406a8" +"checksum rusoto_credential 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc8dd0f0a7e8b62f31aa23fa12fa0a7ac0e1eb52f6f4d4279d8a2ae51d8f099" +"checksum rusoto_dynamodb 0.36.0 (registry+https://github.com/rust-lang/crates.io-index)" = "827700b4f943495f881167c0a5a42f18f0a2f300a2b23bb34b1ce9f33cd804b4" +"checksum rust-argon2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" +"checksum rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f76d05d3993fd5f4af9434e8e436db163a12a9d40e1a58a726f27a01dfd12a2a" +"checksum rust-gmp 0.5.0 (git+https://github.com/KZen-networks/rust-gmp)" = "" +"checksum rust-ini 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3e52c148ef37f8c375d49d5a73aa70713125b7f19095948a923f80afdeb22ec2" +"checksum rustc-demangle 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" +"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +"checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +"checksum sapling-crypto 0.0.1 (git+https://github.com/omershlo/librustzcash.git?rev=3e667406323430813f6dbae2a60b5a83046fa20a)" = "" +"checksum schannel 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)" = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" +"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" +"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +"checksum secp256k1 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4070f3906e65249228094cf97b04a90799fba04468190bbbcfa812309cf86e32" +"checksum security-framework 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" +"checksum security-framework-sys 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" +"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +"checksum serde 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" +"checksum serde 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)" = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" +"checksum serde-hjson 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0b833c5ad67d52ced5f5938b2980f32a9c1c5ef047f0b4fb3127e7a423c76153" +"checksum serde_derive 1.0.117 (registry+https://github.com/rust-lang/crates.io-index)" = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" +"checksum serde_dynamodb 0.2.0 (git+https://github.com/KZen-networks/serde_dynamodb)" = "" +"checksum serde_json 1.0.59 (registry+https://github.com/rust-lang/crates.io-index)" = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95" +"checksum serde_test 0.8.23 (registry+https://github.com/rust-lang/crates.io-index)" = "110b3dbdf8607ec493c22d5d947753282f3bae73c0f56d322af1e8c78e4c23d5" +"checksum serde_urlencoded 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "642dd69105886af2efd227f75a520ec9b44a820d65bc133a9131f7d229fd165a" +"checksum sha2 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9eb6be24e4c23a84d7184280d2722f7f2731fcdd4a9d886efbfe4413e4847ea0" +"checksum sha2 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +"checksum sha3 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd26bc0e7a2e3a7c959bc494caf58b72ee0c71d67704e9520f736ca7e4853ecf" +"checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +"checksum state 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3015a7d0a5fd5105c91c3710d42f9ccf0abfb287d62206484dcc67f9569a6483" +"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +"checksum subtle 2.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c65d530b10ccaeac294f349038a597e435b18fb456aadd0840a623f83b9e941" +"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" +"checksum syn 1.0.48 (registry+https://github.com/rust-lang/crates.io-index)" = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" +"checksum synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" +"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" +"checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f" +"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +"checksum time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +"checksum time-test 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "483c031f2a6c1647dc242affd778f1bd07f0e0a9852d4e96976f64aaa6ee4a6d" +"checksum tinyvec 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +"checksum tokio-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b" +"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" +"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +"checksum tokio-fs 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4" +"checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +"checksum tokio-udp 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82" +"checksum tokio-uds 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0" +"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" +"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum try-lock 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" +"checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" +"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicase 2.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" +"checksum unicode-normalization 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +"checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +"checksum unicode-xid 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +"checksum untrusted 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "55cd1f4b4e96b46aeb8d4855db4a7a9bd96eeeb5c6a1ab54593328761642ce2f" +"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" +"checksum vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +"checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" +"checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" +"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +"checksum wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +"checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164" +"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" +"checksum winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" +"checksum xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c1cb601d29fe2c2ac60a2b2e5e293994d87a1f6fa9687a31a15270f909be9c2" +"checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" +"checksum yaml-rust 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d" +"checksum yansi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9fc79f4a1e39857fc00c3f662cbf2651c771f00e9c15fe2abc341806bd46bd71" +"checksum zeroize 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8ddfeb6eee2fb3b262ef6e0898a52b7563bb8e0d5955a313b3cf2f808246ea14" +"checksum zk-paillier 0.1.0 (git+https://github.com/KZen-networks/zk-paillier?branch=feature/libra-support-fix)" = "" diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index a46c3ba..43be36a 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,22 +1,17 @@ [package] name = "tests" version = "0.1.2" -authors = ["oleiba "] -edition = "2018" +authors = [] +edition = "2021" [dependencies] -serde = "1.0" -serde_json = "1.0" -serde_derive = "1.0" -time-test = "0.2.1" -log = "0.4" -time = "*" +rocket.workspace = true +two-party-ecdsa.workspace = true +gotham-server.workspace = true +gotham-client.workspace = true +serde_json.workspace = true +secp256k1 = {version = "0.21.0", features = ["global-context"]} +ed25519-dalek = "1.0" +rand = "0.8" -[dependencies.gotham-server] -path = "../gotham-server" -[dependencies.gotham-client] -path = "../gotham-client" - -[patch.crates-io] -rust-gmp = { version = "0.5.0", features = ["serde_support"], git = "https://github.com/KZen-networks/rust-gmp" } diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs deleted file mode 100644 index 7b788c2..0000000 --- a/integration-tests/src/lib.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod test; diff --git a/integration-tests/src/test.rs b/integration-tests/src/test.rs deleted file mode 100644 index 1dbe188..0000000 --- a/integration-tests/src/test.rs +++ /dev/null @@ -1,91 +0,0 @@ -#[cfg(test)] -mod tests { - extern crate server_lib; - extern crate client_lib; - - use client_lib::*; - use server_lib::server; - use std::{thread, time}; - - #[test] - fn test_ecdsa() { - spawn_server(); - - let client_shim = ClientShim::new("http://localhost:8000".to_string(), None); - - let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); - - for y in 0..10 { - let x_pos = BigInt::from(0); - let y_pos = BigInt::from(y); - println!("Deriving child_master_key at [x: {}, y:{}]", x_pos, y_pos); - - let child_master_key = ps - .master_key - .get_child(vec![x_pos.clone(), y_pos.clone()]); - - let msg: BigInt = BigInt::from(y + 1); // arbitrary message - let signature = - ecdsa::sign(&client_shim, msg, &child_master_key, x_pos, y_pos, &ps.id) - .expect("ECDSA signature failed"); - - println!( - "signature = (r: {}, s: {})", - signature.r.to_hex(), - signature.s.to_hex() - ); - } - } - - #[test] - fn test_schnorr() { - spawn_server(); - - let client_shim = ClientShim::new("http://localhost:8000".to_string(), None); - - let share: schnorr::Share = schnorr::generate_key(&client_shim).unwrap(); - - let msg: BigInt = BigInt::from(1234); // arbitrary message - let signature = schnorr::sign(&client_shim, msg, &share) - .expect("Schnorr signature failed"); - - println!( - "signature = (e: {:?}, s: {:?})", - signature.e, - signature.s - ); - } - - #[test] - fn test_eddsa() { - spawn_server(); - - let client_shim = ClientShim::new("http://localhost:8000".to_string(), None); - - let five_seconds = time::Duration::from_millis(5000); - thread::sleep(five_seconds); - - let (key_pair, key_agg, id) = client_lib::eddsa::generate_key(&client_shim).unwrap(); - - let message = BigInt::from(1234); - let signature = - client_lib::eddsa::sign(&client_shim, message, &key_pair, &key_agg, &id) - .expect("EdDSA signature failed"); - - println!( - "signature = (R: {}, s: {})", - signature.R.bytes_compressed_to_big_int().to_hex(), - signature.s.to_big_int().to_hex() - ); - } - - fn spawn_server() { - // Rocket server is blocking, so we spawn a new thread. - thread::spawn(move || { - server::get_server().launch(); - }); - - let five_seconds = time::Duration::from_millis(5000); - thread::sleep(five_seconds); - } -} diff --git a/integration-tests/tests/ecdsa.rs b/integration-tests/tests/ecdsa.rs new file mode 100644 index 0000000..b495337 --- /dev/null +++ b/integration-tests/tests/ecdsa.rs @@ -0,0 +1,223 @@ +use client_lib::{ecdsa, ClientShim}; +use rand::rngs::mock::StepRng; +use rand::Rng; +use rocket::serde::{DeserializeOwned, Serialize}; +use rocket::{Config, Ignite, Rocket}; +use secp256k1::{ecdsa::Signature, Message, SECP256K1}; +use server_lib::server; +use std::collections::HashMap; +use std::{thread, time}; +use two_party_ecdsa::curv::arithmetic::big_gmp::BigInt; +use two_party_ecdsa::curv::arithmetic::traits::Converter; +use two_party_ecdsa::curv::elliptic::curves::traits::ECPoint; + +#[rocket::async_test] +async fn test_ecdsa_network() { + let mut rng = StepRng::new(0, 1); + rocket::tokio::spawn(spawn_server(8000, "ecdsa")); + + let client_shim = ClientShim::new("http://localhost:8000".to_string(), None); + + let two_seconds = time::Duration::from_millis(2000); + thread::sleep(two_seconds); + + let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); + + for y in 0..50i32 { + let x_pos = BigInt::from(y * 2 + 1); + let y_pos = BigInt::from(y); + + let child_master_key = ps.master_key.get_child(vec![x_pos.clone(), y_pos.clone()]); + let pk = child_master_key.public.q.get_element(); + + let mut msg_buf = [0u8; 32]; + rng.fill(&mut msg_buf); + let msg: BigInt = BigInt::from(&msg_buf[..]); + + let signature = ecdsa::sign( + &client_shim, + msg.clone(), + &child_master_key, + x_pos, + y_pos, + &ps.id, + ) + .expect("ECDSA signature failed"); + + let r = BigInt::to_vec(&signature.r); + let s = BigInt::to_vec(&signature.s); + let msg = Message::from_slice(&msg_buf).unwrap(); + + let mut sig = [0u8; 64]; + sig[32 - r.len()..32].copy_from_slice(&r); + sig[32 + 32 - s.len()..].copy_from_slice(&s); + + let sig = Signature::from_compact(&sig).unwrap(); + + SECP256K1.verify_ecdsa(&msg, &sig, &pk).unwrap(); + } +} + +async fn spawn_server(port: u32, db_name: &str) -> Rocket { + let settings = HashMap::::from([ + ("db".to_string(), "local".to_string()), + ("db_name".to_string(), db_name.to_string()), + ]); + let rocket = server::get_server(settings); + let figment = rocket.figment().clone().merge((Config::PORT, port)); + rocket.configure(figment).launch().await.unwrap() +} + +#[test] +fn test_ecdsa_keygen() { + let settings = HashMap::::from([ + ("db".into(), "local".into()), + ("db_name".into(), "testEcdsaKeygen".into()), + ]); + let rocket = server::get_server(settings); + let client = RocketClient::new(rocket); + + let client_shim = + ClientShim::new_with_client("http://localhost:8009".to_string(), None, client); + for _ in 0..10 { + let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); + let _ = ps.master_key.public.q.get_element(); + } +} + +#[test] +fn test_ecdsa_key_derivation() { + let settings = HashMap::::from([ + ("db".into(), "local".into()), + ("db_name".into(), "testEcdsaDerivation".into()), + ]); + let rocket = server::get_server(settings); + let client = RocketClient::new(rocket); + + let client_shim = + ClientShim::new_with_client("http://localhost:8009".to_string(), None, client); + let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); + for y in 0..10 { + let x_pos = BigInt::from(y * 2 + 1); + let y_pos = BigInt::from(y); + let child_master_key = ps.master_key.get_child(vec![x_pos.clone(), y_pos.clone()]); + let _ = child_master_key.public.q.get_element(); + } +} + +#[test] +fn test_ecdsa_key_signing() { + let mut rng = StepRng::new(0, 1); + let settings = HashMap::::from([ + ("db".into(), "local".into()), + ("db_name".into(), "testEcdsaSigning".into()), + ]); + let rocket = server::get_server(settings); + let client = RocketClient::new(rocket); + + let client_shim = + ClientShim::new_with_client("http://localhost:8009".to_string(), None, client); + let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); + let x_pos = BigInt::from(1); + let y_pos = BigInt::from(2); + + let child_master_key = ps.master_key.get_child(vec![x_pos.clone(), y_pos.clone()]); + let pk = child_master_key.public.q.get_element(); + + for _ in 0..10 { + let mut msg_buf = [0u8; 32]; + rng.fill(&mut msg_buf); + let msg: BigInt = BigInt::from(&msg_buf[..]); + + let signature = ecdsa::sign( + &client_shim, + msg, + &child_master_key, + x_pos.clone(), + y_pos.clone(), + &ps.id, + ) + .expect("ECDSA signature failed"); + + let r = BigInt::to_vec(&signature.r); + let s = BigInt::to_vec(&signature.s); + let msg = Message::from_slice(&msg_buf).unwrap(); + + let mut sig = [0u8; 64]; + sig[32 - r.len()..32].copy_from_slice(&r); + sig[32 + 32 - s.len()..].copy_from_slice(&s); + + let sig = Signature::from_compact(&sig).unwrap(); + + SECP256K1.verify_ecdsa(&msg, &sig, &pk).unwrap(); + } +} + +#[test] +fn test_ecdsa_long() { + let mut rng = StepRng::new(0, 1); + let settings = HashMap::::from([ + ("db".into(), "local".into()), + ("db_name".into(), "ecdsaLong".into()), + ]); + let rocket = server::get_server(settings); + let client = RocketClient::new(rocket); + + let client_shim = + ClientShim::new_with_client("http://localhost:8009".to_string(), None, client); + + let ps: ecdsa::PrivateShare = ecdsa::get_master_key(&client_shim); + + for y in 0..20 { + let x_pos = BigInt::from(y * 2 + 1); + let y_pos = BigInt::from(y); + + let child_master_key = ps.master_key.get_child(vec![x_pos.clone(), y_pos.clone()]); + let pk = child_master_key.public.q.get_element(); + + let mut msg_buf = [0u8; 32]; + rng.fill(&mut msg_buf); + let msg: BigInt = BigInt::from(&msg_buf[..]); + + let signature = ecdsa::sign(&client_shim, msg, &child_master_key, x_pos, y_pos, &ps.id) + .expect("ECDSA signature failed"); + + let r = BigInt::to_vec(&signature.r); + let s = BigInt::to_vec(&signature.s); + let msg = Message::from_slice(&msg_buf).unwrap(); + + let mut sig = [0u8; 64]; + sig[32 - r.len()..32].copy_from_slice(&r); + sig[32 + 32 - s.len()..].copy_from_slice(&s); + + let sig = Signature::from_compact(&sig).unwrap(); + + SECP256K1.verify_ecdsa(&msg, &sig, &pk).unwrap(); + } +} + +struct RocketClient(pub rocket::local::blocking::Client); + +impl RocketClient { + fn new(rocket: Rocket

) -> Self { + Self(rocket::local::blocking::Client::untracked(rocket).unwrap()) + } +} + +impl client_lib::Client for RocketClient { + fn post( + &self, + _: &str, + uri: &str, + _: Option, + body: T, + ) -> Option { + self.0 + .post(["/", uri].concat()) + .json(&body) + .dispatch() + .into_string() + .map(|s| serde_json::from_str(&s).ok()) + .flatten() + } +}