From 52507fd41d60e0d594afb508c8150c6b5d3e55c5 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 18 Jan 2024 09:08:58 +0100 Subject: [PATCH 01/16] [WIP] Integrate Rust Crypto library --- .gitmodules | 3 + lib/concordium-base | 1 + lib/crypto/.gitignore | 14 + lib/crypto/Cargo.lock | 1696 ++++++++++++++++++++++++++++++++++++ lib/crypto/Cargo.toml | 10 + lib/crypto/src/greetings.h | 4 + lib/crypto/src/lib.rs | 49 ++ 7 files changed, 1777 insertions(+) create mode 160000 lib/concordium-base create mode 100644 lib/crypto/.gitignore create mode 100644 lib/crypto/Cargo.lock create mode 100644 lib/crypto/Cargo.toml create mode 100644 lib/crypto/src/greetings.h create mode 100644 lib/crypto/src/lib.rs diff --git a/.gitmodules b/.gitmodules index 8aebd1f..f4f6e3b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "concordium-grpc-api"] path = concordium-grpc-api url = https://github.com/Concordium/concordium-grpc-api.git +[submodule "lib/concordium-base"] + path = lib/concordium-base + url = https://github.com/Concordium/concordium-base.git diff --git a/lib/concordium-base b/lib/concordium-base new file mode 160000 index 0000000..bd93a27 --- /dev/null +++ b/lib/concordium-base @@ -0,0 +1 @@ +Subproject commit bd93a27317203d89572efbd941908d1662df5adf diff --git a/lib/crypto/.gitignore b/lib/crypto/.gitignore new file mode 100644 index 0000000..6985cf1 --- /dev/null +++ b/lib/crypto/.gitignore @@ -0,0 +1,14 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/lib/crypto/Cargo.lock b/lib/crypto/Cargo.lock new file mode 100644 index 0000000..09209dc --- /dev/null +++ b/lib/crypto/Cargo.lock @@ -0,0 +1,1696 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.48", + "syn_derive", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.48.5", +] + +[[package]] +name = "concordium-contracts-common" +version = "8.1.1" +dependencies = [ + "base64", + "bs58", + "chrono", + "concordium-contracts-common-derive", + "fnv", + "hashbrown 0.11.2", + "hex", + "num-bigint 0.4.4", + "num-integer", + "num-traits", + "rust_decimal", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "concordium-contracts-common-derive" +version = "4.0.1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "concordium_base" +version = "3.2.0" +dependencies = [ + "anyhow", + "bs58", + "byteorder", + "chrono", + "concordium-contracts-common", + "concordium_base_derive", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "either", + "ff", + "group", + "hex", + "itertools", + "leb128", + "libc", + "nom", + "num", + "num-bigint 0.4.4", + "num-traits", + "pairing", + "rand 0.7.3", + "rand_core 0.5.1", + "rayon", + "rust_decimal", + "serde", + "serde_json", + "serde_with", + "sha2 0.10.8", + "sha3", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "concordium_base_derive" +version = "1.0.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crypto" +version = "0.1.0" +dependencies = [ + "wallet_library", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.48", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[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.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand 0.7.3", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519_hd_key_derivation" +version = "1.0.0" +dependencies = [ + "ed25519-dalek", + "hex", + "hmac", + "regex", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "ff" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4530da57967e140ee0b44e0143aa66b5cb42bd9c503dbe316a15d5b0be65713e" +dependencies = [ + "byteorder", + "ff_derive", + "rand_core 0.5.1", +] + +[[package]] +name = "ff_derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5796e7d62ca01a00ed3a649b0da1ffa1ac8f06bcad40339df09dbdd69a05ba9" +dependencies = [ + "num-bigint 0.2.6", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[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.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "group" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cbdfc48f95bef47e3daf3b9d552a1dde6311e3a5fefa43e16c59f651d56fe5b" +dependencies = [ + "ff", + "rand 0.7.3", + "rand_xorshift", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "key_derivation" +version = "2.1.0" +dependencies = [ + "concordium_base", + "ed25519-dalek", + "ed25519_hd_key_derivation", + "hmac", + "keygen_bls", + "pbkdf2", + "serde", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "keygen_bls" +version = "2.0.0" +dependencies = [ + "concordium_base", + "ff", + "hex", + "hkdf", + "pairing", + "sha2 0.10.8", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint 0.4.4", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "pairing" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94c40534479a28199cd5109da27fe2fc4a4728e4fc701d9e9c1bded78f3271e4" +dependencies = [ + "byteorder", + "ff", + "group", + "rand_core 0.5.1", +] + +[[package]] +name = "password-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest 0.10.7", + "hmac", + "password-hash", + "sha2 0.10.8", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + +[[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.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.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.4", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "rend" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "rkyv" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand 0.8.5", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[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.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[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.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "time" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "uuid" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wallet_library" +version = "0.1.0" +dependencies = [ + "anyhow", + "concordium_base", + "hex", + "key_derivation", + "serde", + "serde_json", + "thiserror", +] + +[[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.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +dependencies = [ + "memchr", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zeroize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] diff --git a/lib/crypto/Cargo.toml b/lib/crypto/Cargo.toml new file mode 100644 index 0000000..33bff83 --- /dev/null +++ b/lib/crypto/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "crypto" +version = "0.1.0" +edition = "2021" + +[dependencies] +wallet_library = { path = "../concordium-base/rust-src/wallet_library" } + +[lib] +crate_type = ["staticlib", "cdylib"] diff --git a/lib/crypto/src/greetings.h b/lib/crypto/src/greetings.h new file mode 100644 index 0000000..6f2fd07 --- /dev/null +++ b/lib/crypto/src/greetings.h @@ -0,0 +1,4 @@ +#include + +const char* rust_greeting(const char* to); +void rust_greeting_free(char *); diff --git a/lib/crypto/src/lib.rs b/lib/crypto/src/lib.rs new file mode 100644 index 0000000..d01c839 --- /dev/null +++ b/lib/crypto/src/lib.rs @@ -0,0 +1,49 @@ +use std::ffi::{c_char, CStr, CString}; + +#[no_mangle] +pub extern fn rust_greeting(to: *const c_char) -> *mut c_char { + let c_str = unsafe { CStr::from_ptr(to) }; + let recipient = match c_str.to_str() { + Err(_) => "there", + Ok(string) => string, + }; + CString::new("Hello ".to_owned() + recipient).unwrap().into_raw() +} + +#[no_mangle] +pub extern fn rust_greeting_free(s: *mut c_char) { + unsafe { + if s.is_null() { return } + CString::from_raw(s) + }; +} + +// #[no_mangle] +// #[allow(non_snake_case)] +// pub extern fn getAccountSigningKey( +// env: JNIEnv, +// _: JClass, +// seedAsHex: JString, +// netAsStr: JString, +// identityProviderIndex: jlong, +// identityIndex: jlong, +// credentialCounter: jlong, +// ) -> jstring { +// let seed_net = match get_seed_and_net(seedAsHex, netAsStr, env) { +// Ok(h) => h, +// Err(err) => return KeyResult::Err(err).to_jstring(&env), +// }; +// +// let account_signing_key = match get_account_signing_key_aux( +// seed_net.seed_as_hex, +// &seed_net.net_as_str, +// identityProviderIndex as u32, +// identityIndex as u32, +// credentialCounter as u32, +// ) { +// Ok(k) => k, +// Err(err) => return KeyResult::from(err).to_jstring(&env), +// }; +// +// CryptoJniResult::Ok(account_signing_key).to_jstring(&env) +// } From b6ff635296a944ccf33e2e18b72dab6525434000 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Tue, 23 Jan 2024 11:17:17 +0100 Subject: [PATCH 02/16] Generate Rust bindings using cargo-swift --- Package.swift | 68 +- Sources/ConcordiumSwiftSDK/Client.swift | 5 + .../ConcordiumSwiftSDKTests/CryptoTest.swift | 8 + lib/concordium-base | 1 - lib/crypto/.gitignore | 17 +- lib/crypto/Cargo.lock | 1717 +++-------------- lib/crypto/Cargo.toml | 10 +- lib/crypto/build.rs | 3 + lib/crypto/src/greetings.h | 4 - lib/crypto/src/lib.rs | 71 +- lib/crypto/src/lib.udl | 17 + 11 files changed, 376 insertions(+), 1545 deletions(-) create mode 100644 Tests/ConcordiumSwiftSDKTests/CryptoTest.swift delete mode 160000 lib/concordium-base create mode 100644 lib/crypto/build.rs delete mode 100644 lib/crypto/src/greetings.h create mode 100644 lib/crypto/src/lib.udl diff --git a/Package.swift b/Package.swift index 991f0ef..d534f98 100644 --- a/Package.swift +++ b/Package.swift @@ -3,36 +3,40 @@ import PackageDescription let package = Package( - name: "ConcordiumSwiftSDK", - platforms: [ - // To be kept in sync with README. - .iOS(.v15), - .macOS(.v10_15), - ], - products: [ - .library( - name: "ConcordiumSwiftSDK", - targets: ["ConcordiumSwiftSDK"]), - ], - dependencies: [ - .package(url: "https://github.com/anquii/Base58Check.git", from: "1.0.0"), - .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.15.0"), - .package(url: "https://github.com/nicklockwood/SwiftFormat.git", exact: "0.53.0"), - ], - targets: [ - .target( - name: "ConcordiumSwiftSDK", - dependencies: [ - "Base58Check", - .product(name: "GRPC", package: "grpc-swift"), - "SwiftFormat", - ] - ), - .testTarget( - name: "ConcordiumSwiftSDKTests", - dependencies: [ - "ConcordiumSwiftSDK", - ] - ), - ] + name: "ConcordiumSwiftSDK", + platforms: [ + // To be kept in sync with README. + .iOS(.v15), + .macOS(.v10_15), + ], + products: [ + .library( + name: "ConcordiumSwiftSDK", + targets: ["ConcordiumSwiftSDK"] + ), + ], + dependencies: [ + .package(url: "https://github.com/anquii/Base58Check.git", from: "1.0.0"), + .package(url: "https://github.com/grpc/grpc-swift.git", from: "1.15.0"), + .package(url: "https://github.com/nicklockwood/SwiftFormat.git", exact: "0.53.0"), + .package(path: "./lib/crypto/ConcordiumWalletCrypto"), + ], + targets: [ + .target( + name: "ConcordiumSwiftSDK", + dependencies: [ + "Base58Check", + "ConcordiumWalletCrypto", +// .product(name: "ConcordiumWalletCrypto", package: "ConcordiumWalletCrypto"), + .product(name: "GRPC", package: "grpc-swift"), + "SwiftFormat", + ] + ), + .testTarget( + name: "ConcordiumSwiftSDKTests", + dependencies: [ + "ConcordiumSwiftSDK", + ] + ), + ] ) diff --git a/Sources/ConcordiumSwiftSDK/Client.swift b/Sources/ConcordiumSwiftSDK/Client.swift index 2107869..5b9b512 100644 --- a/Sources/ConcordiumSwiftSDK/Client.swift +++ b/Sources/ConcordiumSwiftSDK/Client.swift @@ -1,3 +1,4 @@ +import ConcordiumWalletCrypto import Foundation import GRPC import NIOCore @@ -10,6 +11,10 @@ public class Client { grpc = Concordium_V2_QueriesNIOClient(channel: channel) } + public static func test() -> UInt64 { + return add(a: 21, b: 42) + } + public func getCryptographicParameters(at block: BlockIdentifier) async throws -> CryptographicParameters { let req = block.toGrpcType() let res = try await grpc.getCryptographicParameters(req).response.get() diff --git a/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift b/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift new file mode 100644 index 0000000..bbcad0d --- /dev/null +++ b/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift @@ -0,0 +1,8 @@ +@testable import ConcordiumSwiftSDK +import XCTest + +final class CryptoTest: XCTestCase { + func testTest() { + XCTAssertEqual(Client.test(), 63) + } +} diff --git a/lib/concordium-base b/lib/concordium-base deleted file mode 160000 index bd93a27..0000000 --- a/lib/concordium-base +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bd93a27317203d89572efbd941908d1662df5adf diff --git a/lib/crypto/.gitignore b/lib/crypto/.gitignore index 6985cf1..d4f0acb 100644 --- a/lib/crypto/.gitignore +++ b/lib/crypto/.gitignore @@ -1,14 +1,3 @@ -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb +/target +/generated +/ConcordiumWalletCrypto diff --git a/lib/crypto/Cargo.lock b/lib/crypto/Cargo.lock index 09209dc..c139f27 100644 --- a/lib/crypto/Cargo.lock +++ b/lib/crypto/Cargo.lock @@ -3,51 +3,51 @@ version = 3 [[package]] -name = "ahash" -version = "0.7.7" +name = "anyhow" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom 0.2.12", - "once_cell", - "version_check", -] +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] -name = "aho-corasick" -version = "1.1.2" +name = "askama" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" dependencies = [ - "memchr", + "askama_derive", + "askama_escape", ] [[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" +name = "askama_derive" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" dependencies = [ - "libc", + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn", ] [[package]] -name = "anyhow" -version = "1.0.79" +name = "askama_escape" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" [[package]] -name = "arrayvec" -version = "0.7.4" +name = "askama_parser" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] [[package]] name = "autocfg" @@ -56,1641 +56,464 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - -[[package]] -name = "base64ct" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" - -[[package]] -name = "bitvec" -version = "1.0.1" +name = "basic-toml" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +checksum = "2db21524cad41c5591204d22d75e1970a2d1f71060214ca931dc7d5afe2c14e5" dependencies = [ - "funty", - "radium", - "tap", - "wyz", + "serde", ] [[package]] -name = "block-buffer" -version = "0.9.0" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" dependencies = [ - "generic-array", + "serde", ] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "bytes" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] -name = "borsh" -version = "1.3.1" +name = "camino" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" dependencies = [ - "borsh-derive", - "cfg_aliases", + "serde", ] [[package]] -name = "borsh-derive" -version = "1.3.1" +name = "cargo-platform" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.48", - "syn_derive", + "serde", ] [[package]] -name = "bs58" -version = "0.4.0" +name = "cargo_metadata" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ - "sha2 0.9.9", + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", ] [[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytecheck" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +name = "crypto" +version = "0.1.0" dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", + "uniffi", ] [[package]] -name = "bytecheck_derive" -version = "0.6.11" +name = "fs-err" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", + "autocfg", ] [[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.5.0" +name = "glob" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "cc" -version = "1.0.83" +name = "goblin" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" dependencies = [ - "libc", + "log", + "plain", + "scroll", ] [[package]] -name = "cfg-if" -version = "1.0.0" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "cfg_aliases" -version = "0.1.1" +name = "itoa" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "chrono" -version = "0.4.31" +name = "log" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets 0.48.5", -] - -[[package]] -name = "concordium-contracts-common" -version = "8.1.1" -dependencies = [ - "base64", - "bs58", - "chrono", - "concordium-contracts-common-derive", - "fnv", - "hashbrown 0.11.2", - "hex", - "num-bigint 0.4.4", - "num-integer", - "num-traits", - "rust_decimal", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "concordium-contracts-common-derive" -version = "4.0.1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "concordium_base" -version = "3.2.0" -dependencies = [ - "anyhow", - "bs58", - "byteorder", - "chrono", - "concordium-contracts-common", - "concordium_base_derive", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "either", - "ff", - "group", - "hex", - "itertools", - "leb128", - "libc", - "nom", - "num", - "num-bigint 0.4.4", - "num-traits", - "pairing", - "rand 0.7.3", - "rand_core 0.5.1", - "rayon", - "rust_decimal", - "serde", - "serde_json", - "serde_with", - "sha2 0.10.8", - "sha3", - "subtle", - "thiserror", - "zeroize", -] - -[[package]] -name = "concordium_base_derive" -version = "1.0.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] -name = "convert_case" -version = "0.4.0" +name = "memchr" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] -name = "core-foundation-sys" -version = "0.8.6" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "cpufeatures" -version = "0.2.12" +name = "mime_guess" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ - "libc", + "mime", + "unicase", ] [[package]] -name = "crossbeam-deque" -version = "0.8.5" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "nom" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "crossbeam-utils", + "memchr", + "minimal-lexical", ] [[package]] -name = "crossbeam-utils" -version = "0.8.19" +name = "once_cell" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "crypto" -version = "0.1.0" -dependencies = [ - "wallet_library", -] +name = "oneshot-uniffi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" [[package]] -name = "crypto-common" -version = "0.1.6" +name = "paste" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] -name = "curve25519-dalek" -version = "3.2.1" +name = "plain" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" [[package]] -name = "darling" -version = "0.20.3" +name = "proc-macro2" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ - "darling_core", - "darling_macro", + "unicode-ident", ] [[package]] -name = "darling_core" -version = "0.20.3" +name = "quote" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "fnv", - "ident_case", "proc-macro2", - "quote", - "strsim", - "syn 2.0.48", ] [[package]] -name = "darling_macro" -version = "0.20.3" +name = "ryu" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" -dependencies = [ - "darling_core", - "quote", - "syn 2.0.48", -] +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] -name = "deranged" -version = "0.3.11" +name = "scroll" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" dependencies = [ - "powerfmt", - "serde", + "scroll_derive", ] [[package]] -name = "derive_more" -version = "0.99.17" +name = "scroll_derive" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "convert_case", "proc-macro2", "quote", - "rustc_version", - "syn 1.0.109", + "syn", ] [[package]] -name = "digest" -version = "0.9.0" +name = "semver" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ - "generic-array", + "serde", ] [[package]] -name = "digest" -version = "0.10.7" +name = "serde" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ - "block-buffer 0.10.4", - "crypto-common", - "subtle", + "serde_derive", ] [[package]] -name = "ed25519" -version = "1.5.3" +name = "serde_derive" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ - "signature", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "ed25519-dalek" -version = "1.0.1" +name = "serde_json" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ - "curve25519-dalek", - "ed25519", - "rand 0.7.3", + "itoa", + "ryu", "serde", - "sha2 0.9.9", - "zeroize", -] - -[[package]] -name = "ed25519_hd_key_derivation" -version = "1.0.0" -dependencies = [ - "ed25519-dalek", - "hex", - "hmac", - "regex", - "sha2 0.10.8", - "thiserror", ] [[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "equivalent" -version = "1.0.1" +name = "siphasher" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] -name = "ff" -version = "0.5.2" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4530da57967e140ee0b44e0143aa66b5cb42bd9c503dbe316a15d5b0be65713e" -dependencies = [ - "byteorder", - "ff_derive", - "rand_core 0.5.1", -] +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "ff_derive" -version = "0.4.1" +name = "syn" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5796e7d62ca01a00ed3a649b0da1ffa1ac8f06bcad40339df09dbdd69a05ba9" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ - "num-bigint 0.2.6", - "num-integer", - "num-traits", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", + "unicode-ident", ] [[package]] -name = "getrandom" -version = "0.1.16" +name = "thiserror" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ - "cfg-if", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "thiserror-impl", ] [[package]] -name = "getrandom" -version = "0.2.12" +name = "thiserror-impl" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ - "cfg-if", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "proc-macro2", + "quote", + "syn", ] [[package]] -name = "group" -version = "0.2.0" +name = "toml" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cbdfc48f95bef47e3daf3b9d552a1dde6311e3a5fefa43e16c59f651d56fe5b" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "ff", - "rand 0.7.3", - "rand_xorshift", + "serde", ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "unicase" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ - "ahash", + "version_check", ] [[package]] -name = "hashbrown" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" - -[[package]] -name = "hex" -version = "0.4.3" +name = "unicode-ident" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] -name = "hkdf" -version = "0.12.4" +name = "uniffi" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +checksum = "21345172d31092fd48c47fd56c53d4ae9e41c4b1f559fb8c38c1ab1685fd919f" dependencies = [ - "hmac", + "anyhow", + "uniffi_build", + "uniffi_core", + "uniffi_macros", ] [[package]] -name = "hmac" -version = "0.12.1" +name = "uniffi_bindgen" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +checksum = "fd992f2929a053829d5875af1eff2ee3d7a7001cb3b9a46cc7895f2caede6940" dependencies = [ - "digest 0.10.7", + "anyhow", + "askama", + "camino", + "cargo_metadata", + "fs-err", + "glob", + "goblin", + "heck", + "once_cell", + "paste", + "serde", + "toml", + "uniffi_meta", + "uniffi_testing", + "uniffi_udl", ] [[package]] -name = "iana-time-zone" -version = "0.1.59" +name = "uniffi_build" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "001964dd3682d600084b3aaf75acf9c3426699bc27b65e96bb32d175a31c74e9" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "anyhow", + "camino", + "uniffi_bindgen", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "uniffi_checksum_derive" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "55137c122f712d9330fd985d66fa61bdc381752e89c35708c13ce63049a3002c" dependencies = [ - "cc", + "quote", + "syn", ] [[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "indexmap" -version = "1.9.3" +name = "uniffi_core" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +checksum = "6121a127a3af1665cd90d12dd2b3683c2643c5103281d0fed5838324ca1fad5b" dependencies = [ - "autocfg", - "hashbrown 0.12.3", - "serde", + "anyhow", + "bytes", + "camino", + "log", + "once_cell", + "oneshot-uniffi", + "paste", + "static_assertions", ] [[package]] -name = "indexmap" -version = "2.1.0" +name = "uniffi_macros" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "11cf7a58f101fcedafa5b77ea037999b88748607f0ef3a33eaa0efc5392e92e4" dependencies = [ - "equivalent", - "hashbrown 0.14.3", + "bincode", + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", "serde", + "syn", + "toml", + "uniffi_build", + "uniffi_meta", ] [[package]] -name = "itertools" -version = "0.10.5" +name = "uniffi_meta" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "71dc8573a7b1ac4b71643d6da34888273ebfc03440c525121f1b3634ad3417a2" dependencies = [ - "either", + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", ] [[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "js-sys" -version = "0.3.67" +name = "uniffi_testing" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "118448debffcb676ddbe8c5305fb933ab7e0123753e659a71dc4a693f8d9f23c" dependencies = [ - "wasm-bindgen", + "anyhow", + "camino", + "cargo_metadata", + "fs-err", + "once_cell", ] [[package]] -name = "keccak" -version = "0.1.5" +name = "uniffi_udl" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "key_derivation" -version = "2.1.0" -dependencies = [ - "concordium_base", - "ed25519-dalek", - "ed25519_hd_key_derivation", - "hmac", - "keygen_bls", - "pbkdf2", - "serde", - "sha2 0.10.8", - "thiserror", -] - -[[package]] -name = "keygen_bls" -version = "2.0.0" +checksum = "889edb7109c6078abe0e53e9b4070cf74a6b3468d141bdf5ef1bd4d1dc24a1c3" dependencies = [ - "concordium_base", - "ff", - "hex", - "hkdf", - "pairing", - "sha2 0.10.8", + "anyhow", + "uniffi_meta", + "uniffi_testing", + "weedle2", ] [[package]] -name = "leb128" -version = "0.2.5" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "libc" -version = "0.2.152" +name = "weedle2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" -dependencies = [ - "num-bigint 0.4.4", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint 0.4.4", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "pairing" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c40534479a28199cd5109da27fe2fc4a4728e4fc701d9e9c1bded78f3271e4" -dependencies = [ - "byteorder", - "ff", - "group", - "rand_core 0.5.1", -] - -[[package]] -name = "password-hash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "pbkdf2" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" -dependencies = [ - "digest 0.10.7", - "hmac", - "password-hash", - "sha2 0.10.8", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro-crate" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b2685dd208a3771337d8d386a89840f0f43cd68be8dae90a5f8c2384effc9cd" -dependencies = [ - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.76" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - -[[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.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.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.4", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.12", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "regex" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "rend" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "rkyv" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "rust_decimal" -version = "1.33.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand 0.8.5", - "rkyv", - "serde", - "serde_json", -] - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" - -[[package]] -name = "serde" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.195" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "serde_json" -version = "1.0.111" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" -dependencies = [ - "base64", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.1.0", - "serde", - "serde_json", - "serde_with_macros", - "time", -] - -[[package]] -name = "serde_with_macros" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[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.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[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.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn_derive" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "thiserror" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - -[[package]] -name = "time" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" -dependencies = [ - "deranged", - "itoa", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" -dependencies = [ - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "toml_datetime" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" - -[[package]] -name = "toml_edit" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" -dependencies = [ - "indexmap 2.1.0", - "toml_datetime", - "winnow", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "uuid" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wallet_library" -version = "0.1.0" -dependencies = [ - "anyhow", - "concordium_base", - "hex", - "key_derivation", - "serde", - "serde_json", - "thiserror", -] - -[[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.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - -[[package]] -name = "winnow" -version = "0.5.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" -dependencies = [ - "memchr", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "zeroize" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2e79c5206e1f43a2306fd64bdb95025ee4228960f2e6c5a8b173f3caaf807741" dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", + "nom", ] diff --git a/lib/crypto/Cargo.toml b/lib/crypto/Cargo.toml index 33bff83..a1ca0d9 100644 --- a/lib/crypto/Cargo.toml +++ b/lib/crypto/Cargo.toml @@ -3,8 +3,12 @@ name = "crypto" version = "0.1.0" edition = "2021" +[lib] +crate-type = ["staticlib", "lib"] +name = "crypto" + [dependencies] -wallet_library = { path = "../concordium-base/rust-src/wallet_library" } +uniffi = "0.25" -[lib] -crate_type = ["staticlib", "cdylib"] +[build-dependencies] +uniffi = { version = "0.25", features = ["build"] } diff --git a/lib/crypto/build.rs b/lib/crypto/build.rs new file mode 100644 index 0000000..2f9d3f3 --- /dev/null +++ b/lib/crypto/build.rs @@ -0,0 +1,3 @@ +fn main() { + uniffi::generate_scaffolding("./src/lib.udl").unwrap(); +} \ No newline at end of file diff --git a/lib/crypto/src/greetings.h b/lib/crypto/src/greetings.h deleted file mode 100644 index 6f2fd07..0000000 --- a/lib/crypto/src/greetings.h +++ /dev/null @@ -1,4 +0,0 @@ -#include - -const char* rust_greeting(const char* to); -void rust_greeting_free(char *); diff --git a/lib/crypto/src/lib.rs b/lib/crypto/src/lib.rs index d01c839..f0d4fdc 100644 --- a/lib/crypto/src/lib.rs +++ b/lib/crypto/src/lib.rs @@ -1,49 +1,32 @@ -use std::ffi::{c_char, CStr, CString}; +uniffi::include_scaffolding!("lib"); -#[no_mangle] -pub extern fn rust_greeting(to: *const c_char) -> *mut c_char { - let c_str = unsafe { CStr::from_ptr(to) }; - let recipient = match c_str.to_str() { - Err(_) => "there", - Ok(string) => string, - }; - CString::new("Hello ".to_owned() + recipient).unwrap().into_raw() + +// Bindings have to be exposed in a .udl file with the same name as the corresponding .rs file, i.e. lib.udl +// You can expose top-level functions... +pub fn add(a: u64, b: u64) -> u64 { + a + b +} + +// ... data structs without methods ... +pub struct Example { + pub items: Vec, + pub value: Option, } -#[no_mangle] -pub extern fn rust_greeting_free(s: *mut c_char) { - unsafe { - if s.is_null() { return } - CString::from_raw(s) - }; +// ... classes with methods ... +pub struct Greeter { + name: String, +} + +impl Greeter { + // By convention, a method called new is exposed as a constructor + pub fn new(name: String) -> Self { + Self { name } + } + + pub fn greet(&self) -> String { + format!("Hello, {}!", self.name) + } } -// #[no_mangle] -// #[allow(non_snake_case)] -// pub extern fn getAccountSigningKey( -// env: JNIEnv, -// _: JClass, -// seedAsHex: JString, -// netAsStr: JString, -// identityProviderIndex: jlong, -// identityIndex: jlong, -// credentialCounter: jlong, -// ) -> jstring { -// let seed_net = match get_seed_and_net(seedAsHex, netAsStr, env) { -// Ok(h) => h, -// Err(err) => return KeyResult::Err(err).to_jstring(&env), -// }; -// -// let account_signing_key = match get_account_signing_key_aux( -// seed_net.seed_as_hex, -// &seed_net.net_as_str, -// identityProviderIndex as u32, -// identityIndex as u32, -// credentialCounter as u32, -// ) { -// Ok(k) => k, -// Err(err) => return KeyResult::from(err).to_jstring(&env), -// }; -// -// CryptoJniResult::Ok(account_signing_key).to_jstring(&env) -// } +// ... and much more! For more information about bindings, read the UniFFI book: https://mozilla.github.io/uniffi-rs/udl_file_spec.html \ No newline at end of file diff --git a/lib/crypto/src/lib.udl b/lib/crypto/src/lib.udl new file mode 100644 index 0000000..b16fd16 --- /dev/null +++ b/lib/crypto/src/lib.udl @@ -0,0 +1,17 @@ + +// Keep this namespace, even when empty - otherwise binding generation will throw an error! +namespace crypto { + // You can safely delete this example top-level function definition + u64 add(u64 a, u64 b); }; + +// You can safely delete this example data structure definition +dictionary Example { + sequence items; + double? value; +}; + +// You can safely delete this example interface definition +interface Greeter { + constructor(string name); + string greet(); +}; \ No newline at end of file From 0102b1c95d6499283da03db69e954f70a8f7f713 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Tue, 23 Jan 2024 14:30:11 +0100 Subject: [PATCH 03/16] Implement binding for function 'identity_provider_index' --- .gitmodules | 4 +- Sources/ConcordiumSwiftSDK/Client.swift | 4 - Sources/ConcordiumSwiftSDK/Wallet.swift | 29 + .../ConcordiumSwiftSDKTests/CryptoTest.swift | 8 - .../ConcordiumSwiftSDKTests/WalletTest.swift | 12 + lib/crypto/Cargo.lock | 1725 ++++++++++++++++- lib/crypto/Cargo.toml | 2 + lib/crypto/build.sh | 6 + lib/crypto/concordium-base | 1 + lib/crypto/src/lib.rs | 50 +- lib/crypto/src/lib.udl | 22 +- 11 files changed, 1745 insertions(+), 118 deletions(-) create mode 100644 Sources/ConcordiumSwiftSDK/Wallet.swift delete mode 100644 Tests/ConcordiumSwiftSDKTests/CryptoTest.swift create mode 100644 Tests/ConcordiumSwiftSDKTests/WalletTest.swift create mode 100755 lib/crypto/build.sh create mode 160000 lib/crypto/concordium-base diff --git a/.gitmodules b/.gitmodules index f4f6e3b..5f7e101 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "concordium-grpc-api"] path = concordium-grpc-api url = https://github.com/Concordium/concordium-grpc-api.git -[submodule "lib/concordium-base"] - path = lib/concordium-base +[submodule "lib/crypto/concordium-base"] + path = lib/crypto/concordium-base url = https://github.com/Concordium/concordium-base.git diff --git a/Sources/ConcordiumSwiftSDK/Client.swift b/Sources/ConcordiumSwiftSDK/Client.swift index 5b9b512..13f2d60 100644 --- a/Sources/ConcordiumSwiftSDK/Client.swift +++ b/Sources/ConcordiumSwiftSDK/Client.swift @@ -11,10 +11,6 @@ public class Client { grpc = Concordium_V2_QueriesNIOClient(channel: channel) } - public static func test() -> UInt64 { - return add(a: 21, b: 42) - } - public func getCryptographicParameters(at block: BlockIdentifier) async throws -> CryptographicParameters { let req = block.toGrpcType() let res = try await grpc.getCryptographicParameters(req).response.get() diff --git a/Sources/ConcordiumSwiftSDK/Wallet.swift b/Sources/ConcordiumSwiftSDK/Wallet.swift new file mode 100644 index 0000000..31256a5 --- /dev/null +++ b/Sources/ConcordiumSwiftSDK/Wallet.swift @@ -0,0 +1,29 @@ +import Foundation + +import ConcordiumWalletCrypto + +enum Network: String { + case mainnet = "Mainnet" + case testnet = "Testnet" +} + +class Wallet { + let seedHex: String + let network: Network + + init(seedHex: String, network: Network) { + self.seedHex = seedHex + self.network = network + } + + func getAccountSigningKey(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt32) throws -> String { + let res = try ConcordiumWalletCrypto.getAccountSigningKey( + seedHex: seedHex, + net: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex, credentialCounter: credentialCounter + ) +// print(res) + return res + } +} diff --git a/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift b/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift deleted file mode 100644 index bbcad0d..0000000 --- a/Tests/ConcordiumSwiftSDKTests/CryptoTest.swift +++ /dev/null @@ -1,8 +0,0 @@ -@testable import ConcordiumSwiftSDK -import XCTest - -final class CryptoTest: XCTestCase { - func testTest() { - XCTAssertEqual(Client.test(), 63) - } -} diff --git a/Tests/ConcordiumSwiftSDKTests/WalletTest.swift b/Tests/ConcordiumSwiftSDKTests/WalletTest.swift new file mode 100644 index 0000000..a8a6522 --- /dev/null +++ b/Tests/ConcordiumSwiftSDKTests/WalletTest.swift @@ -0,0 +1,12 @@ +@testable import ConcordiumSwiftSDK +import XCTest + +final class WalletTest: XCTestCase { + let someSeedHex = "77974c7dddda738dab2277073b218af3a3d84f2aa8c1245838cf49f93dddc9f3ee669e0a8a0f463cfde164bdc82208d97cb312d7777d37655575fe309a02934" + + func testTest() throws { + let w = Wallet(seedHex: someSeedHex, network: .testnet) + let res = try w.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) + print(res) + } +} diff --git a/lib/crypto/Cargo.lock b/lib/crypto/Cargo.lock index c139f27..df59453 100644 --- a/lib/crypto/Cargo.lock +++ b/lib/crypto/Cargo.lock @@ -2,12 +2,183 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ahash" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "askama" version = "0.12.1" @@ -31,7 +202,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn", + "syn 2.0.48", ] [[package]] @@ -55,6 +226,18 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" + [[package]] name = "basic-toml" version = "0.1.8" @@ -73,6 +256,95 @@ dependencies = [ "serde", ] +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "borsh" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.48", + "syn_derive", +] + +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "sha2", + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.5.0" @@ -112,134 +384,1056 @@ dependencies = [ ] [[package]] -name = "crypto" -version = "0.1.0" +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ - "uniffi", + "libc", ] [[package]] -name = "fs-err" -version = "2.11.0" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" dependencies = [ - "autocfg", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets", ] [[package]] -name = "glob" -version = "0.3.1" +name = "concordium-contracts-common" +version = "9.0.0" +dependencies = [ + "base64", + "bs58", + "chrono", + "concordium-contracts-common-derive", + "fnv", + "hashbrown 0.11.2", + "hex", + "num-bigint", + "num-integer", + "num-traits", + "rust_decimal", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "concordium-contracts-common-derive" +version = "4.0.1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "concordium_base" +version = "4.0.0" +dependencies = [ + "anyhow", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "bs58", + "byteorder", + "chrono", + "concordium-contracts-common", + "concordium_base_derive", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "either", + "ff 0.13.0", + "hex", + "itertools", + "leb128", + "libc", + "nom", + "num", + "num-bigint", + "num-traits", + "rand", + "rayon", + "rust_decimal", + "serde", + "serde_json", + "serde_with", + "sha2", + "sha3", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "concordium_base_derive" +version = "1.0.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "const-oid" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] -name = "goblin" -version = "0.6.1" +name = "convert_case" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ - "log", - "plain", - "scroll", + "libc", ] [[package]] -name = "heck" -version = "0.4.1" +name = "crossbeam-deque" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] [[package]] -name = "itoa" -version = "1.0.10" +name = "crossbeam-epoch" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] [[package]] -name = "log" -version = "0.4.20" +name = "crossbeam-utils" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] -name = "memchr" -version = "2.7.1" +name = "crypto" +version = "0.1.0" +dependencies = [ + "thiserror", + "uniffi", + "wallet_library", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] [[package]] -name = "mime" -version = "0.3.17" +name = "curve25519-dalek" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "group", + "platforms", + "rand_core 0.6.4", + "rustc_version", + "subtle", + "zeroize", +] [[package]] -name = "mime_guess" -version = "2.0.4" +name = "curve25519-dalek-derive" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.48", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.6.4", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "ed25519_hd_key_derivation" +version = "1.0.0" +dependencies = [ + "ed25519-dalek", + "hex", + "hmac", + "regex", + "sha2", + "thiserror", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "ff" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4530da57967e140ee0b44e0143aa66b5cb42bd9c503dbe316a15d5b0be65713e" +dependencies = [ + "byteorder", + "rand_core 0.5.1", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "goblin" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +dependencies = [ + "log", + "plain", + "scroll", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.7", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "key_derivation" +version = "2.1.0" +dependencies = [ + "concordium_base", + "ed25519-dalek", + "ed25519_hd_key_derivation", + "hmac", + "keygen_bls", + "pbkdf2", + "serde", + "sha2", + "thiserror", +] + +[[package]] +name = "keygen_bls" +version = "2.0.0" +dependencies = [ + "concordium_base", + "ff 0.5.2", + "hex", + "hkdf", + "sha2", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "oneshot-uniffi" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" + +[[package]] +name = "password-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core 0.6.4", +] + +[[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.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "mime", - "unicase", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "regex" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] [[package]] -name = "nom" -version = "7.1.3" +name = "regex-automata" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ + "aho-corasick", "memchr", - "minimal-lexical", + "regex-syntax", ] [[package]] -name = "once_cell" -version = "1.19.0" +name = "regex-syntax" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] -name = "oneshot-uniffi" -version = "0.1.6" +name = "rend" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] [[package]] -name = "paste" -version = "1.0.14" +name = "rkyv" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] [[package]] -name = "plain" -version = "0.2.3" +name = "rkyv_derive" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "proc-macro2" -version = "1.0.78" +name = "rust_decimal" +version = "1.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ - "unicode-ident", + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", ] [[package]] -name = "quote" -version = "1.0.35" +name = "rustc_version" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "proc-macro2", + "semver", ] [[package]] @@ -265,9 +1459,15 @@ checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "semver" version = "1.0.21" @@ -294,7 +1494,7 @@ checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -308,18 +1508,116 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58c3a1b3e418f61c25b2aeb43fc6c95eaa252b8cecdda67f401943e9e08d33f" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2068b437a31fc68f25dd7edc296b078f04b45145c199d8eed9866e45f1ff274" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + [[package]] name = "siphasher" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[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.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.48" @@ -331,6 +1629,24 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "thiserror" version = "1.0.56" @@ -348,9 +1664,53 @@ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.48", +] + +[[package]] +name = "time" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", ] +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "toml" version = "0.5.11" @@ -360,6 +1720,29 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + [[package]] name = "unicase" version = "2.7.0" @@ -428,7 +1811,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55137c122f712d9330fd985d66fa61bdc381752e89c35708c13ce63049a3002c" dependencies = [ "quote", - "syn", + "syn 2.0.48", ] [[package]] @@ -460,7 +1843,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn", + "syn 2.0.48", "toml", "uniffi_build", "uniffi_meta", @@ -503,12 +1886,92 @@ dependencies = [ "weedle2", ] +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wallet_library" +version = "0.2.0" +dependencies = [ + "anyhow", + "concordium_base", + "either", + "hex", + "key_derivation", + "serde", + "serde_json", + "thiserror", +] + +[[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.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + [[package]] name = "weedle2" version = "4.0.0" @@ -517,3 +1980,127 @@ checksum = "2e79c5206e1f43a2306fd64bdb95025ee4228960f2e6c5a8b173f3caaf807741" dependencies = [ "nom", ] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +dependencies = [ + "memchr", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] diff --git a/lib/crypto/Cargo.toml b/lib/crypto/Cargo.toml index a1ca0d9..64d9b28 100644 --- a/lib/crypto/Cargo.toml +++ b/lib/crypto/Cargo.toml @@ -8,7 +8,9 @@ crate-type = ["staticlib", "lib"] name = "crypto" [dependencies] +thiserror = "1.0.56" uniffi = "0.25" +wallet_library = { path = "./concordium-base/rust-src/wallet_library" } [build-dependencies] uniffi = { version = "0.25", features = ["build"] } diff --git a/lib/crypto/build.sh b/lib/crypto/build.sh new file mode 100755 index 0000000..b4e5242 --- /dev/null +++ b/lib/crypto/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh + +set -eux + +rm -rf ./ConcordiumWalletCrypto/ +cargo swift package --name=ConcordiumWalletCrypto --platforms=ios --platforms=macos --release \ No newline at end of file diff --git a/lib/crypto/concordium-base b/lib/crypto/concordium-base new file mode 160000 index 0000000..6d9ad35 --- /dev/null +++ b/lib/crypto/concordium-base @@ -0,0 +1 @@ +Subproject commit 6d9ad3500d0150062d8596715f6920ff33678c89 diff --git a/lib/crypto/src/lib.rs b/lib/crypto/src/lib.rs index f0d4fdc..e974176 100644 --- a/lib/crypto/src/lib.rs +++ b/lib/crypto/src/lib.rs @@ -1,32 +1,42 @@ +use wallet_library::wallet::get_account_signing_key_aux; + +// UniFFI book: https://mozilla.github.io/uniffi-rs/udl_file_spec.html uniffi::include_scaffolding!("lib"); +#[derive(Debug, thiserror::Error)] +enum WalletCryptoError { + #[error("call {call} failed: {msg}")] + CallFailed { call: String, msg: String }, +} + +fn get_account_signing_key(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, credential_counter: u32) -> Result { + get_account_signing_key_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter) + .map_err(|e| WalletCryptoError::CallFailed { + call: format!("get_account_signing_key(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter})"), + msg: e.to_string(), + }) +} -// Bindings have to be exposed in a .udl file with the same name as the corresponding .rs file, i.e. lib.udl -// You can expose top-level functions... -pub fn add(a: u64, b: u64) -> u64 { - a + b +fn getAccountPublicKey(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u64, credential_counter: u32) -> String { + todo!() } -// ... data structs without methods ... -pub struct Example { - pub items: Vec, - pub value: Option, +fn getIdCredSec(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { + todo!() } -// ... classes with methods ... -pub struct Greeter { - name: String, +fn getPrfKey(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { + todo!() } -impl Greeter { - // By convention, a method called new is exposed as a constructor - pub fn new(name: String) -> Self { - Self { name } - } +fn getCredentialId(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, credential_counter: u32, commitment_key: String) -> String { + todo!() +} - pub fn greet(&self) -> String { - format!("Hello, {}!", self.name) - } +fn getSignatureBlindingRandomness(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { + todo!() } -// ... and much more! For more information about bindings, read the UniFFI book: https://mozilla.github.io/uniffi-rs/udl_file_spec.html \ No newline at end of file +fn getAttributeCommitmentRandomness(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u64, credential_counter: u64, attribute: u32) -> String { + todo!() +} diff --git a/lib/crypto/src/lib.udl b/lib/crypto/src/lib.udl index b16fd16..38bca25 100644 --- a/lib/crypto/src/lib.udl +++ b/lib/crypto/src/lib.udl @@ -1,17 +1,9 @@ - -// Keep this namespace, even when empty - otherwise binding generation will throw an error! -namespace crypto { - // You can safely delete this example top-level function definition - u64 add(u64 a, u64 b); }; - -// You can safely delete this example data structure definition -dictionary Example { - sequence items; - double? value; +[Error] +enum WalletCryptoError { + "CallFailed" }; -// You can safely delete this example interface definition -interface Greeter { - constructor(string name); - string greet(); -}; \ No newline at end of file +namespace crypto { + [Throws=WalletCryptoError] + string get_account_signing_key(string seed_hex, string net, u32 identity_provider_index, u32 identity_index, u32 credential_counter); +}; From c540039ee611952a8390bf9b17c6bf8731f05536 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Tue, 23 Jan 2024 14:31:19 +0100 Subject: [PATCH 04/16] Fmt --- lib/crypto/build.rs | 2 +- lib/crypto/src/lib.rs | 55 +++++++++++++++++++++++++++++++++++++------ 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/lib/crypto/build.rs b/lib/crypto/build.rs index 2f9d3f3..145281c 100644 --- a/lib/crypto/build.rs +++ b/lib/crypto/build.rs @@ -1,3 +1,3 @@ fn main() { uniffi::generate_scaffolding("./src/lib.udl").unwrap(); -} \ No newline at end of file +} diff --git a/lib/crypto/src/lib.rs b/lib/crypto/src/lib.rs index e974176..9826c5c 100644 --- a/lib/crypto/src/lib.rs +++ b/lib/crypto/src/lib.rs @@ -9,7 +9,13 @@ enum WalletCryptoError { CallFailed { call: String, msg: String }, } -fn get_account_signing_key(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, credential_counter: u32) -> Result { +fn get_account_signing_key( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u32, + credential_counter: u32, +) -> Result { get_account_signing_key_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter) .map_err(|e| WalletCryptoError::CallFailed { call: format!("get_account_signing_key(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter})"), @@ -17,26 +23,61 @@ fn get_account_signing_key(seed_hex: String, net: String, identity_provider_inde }) } -fn getAccountPublicKey(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u64, credential_counter: u32) -> String { +fn getAccountPublicKey( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u64, + credential_counter: u32, +) -> String { todo!() } -fn getIdCredSec(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { +fn getIdCredSec( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u32, +) -> String { todo!() } -fn getPrfKey(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { +fn getPrfKey( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u32, +) -> String { todo!() } -fn getCredentialId(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, credential_counter: u32, commitment_key: String) -> String { +fn getCredentialId( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u32, + credential_counter: u32, + commitment_key: String, +) -> String { todo!() } -fn getSignatureBlindingRandomness(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32) -> String { +fn getSignatureBlindingRandomness( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u32, +) -> String { todo!() } -fn getAttributeCommitmentRandomness(seed_hex: String, net: String, identity_provider_index: u32, identity_index: u64, credential_counter: u64, attribute: u32) -> String { +fn getAttributeCommitmentRandomness( + seed_hex: String, + net: String, + identity_provider_index: u32, + identity_index: u64, + credential_counter: u64, + attribute: u32, +) -> String { todo!() } From 548eefdf566ae4e0d7e46910cb6e6e457e3e7f4e Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Tue, 23 Jan 2024 14:34:47 +0100 Subject: [PATCH 05/16] Minor cleanup/fix --- Package.swift | 1 - Tests/ConcordiumSwiftSDKTests/WalletTest.swift | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index d534f98..c322de2 100644 --- a/Package.swift +++ b/Package.swift @@ -27,7 +27,6 @@ let package = Package( dependencies: [ "Base58Check", "ConcordiumWalletCrypto", -// .product(name: "ConcordiumWalletCrypto", package: "ConcordiumWalletCrypto"), .product(name: "GRPC", package: "grpc-swift"), "SwiftFormat", ] diff --git a/Tests/ConcordiumSwiftSDKTests/WalletTest.swift b/Tests/ConcordiumSwiftSDKTests/WalletTest.swift index a8a6522..927adf4 100644 --- a/Tests/ConcordiumSwiftSDKTests/WalletTest.swift +++ b/Tests/ConcordiumSwiftSDKTests/WalletTest.swift @@ -2,7 +2,7 @@ import XCTest final class WalletTest: XCTestCase { - let someSeedHex = "77974c7dddda738dab2277073b218af3a3d84f2aa8c1245838cf49f93dddc9f3ee669e0a8a0f463cfde164bdc82208d97cb312d7777d37655575fe309a02934" + let someSeedHex = "877974c7dddda738dab2277073b218af3a3d84f2aa8c1245838cf49f93dddc9f3ee669e0a8a0f463cfde164bdc82208d97cb312d7777d37655575fe309a02934" func testTest() throws { let w = Wallet(seedHex: someSeedHex, network: .testnet) From e27b82001d9f58aebcdc9e5d94bcca6430a464ac Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Tue, 23 Jan 2024 22:02:06 +0100 Subject: [PATCH 06/16] Add makefile target --- Makefile | 4 ++++ lib/crypto/build.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 10b1a21..6c77908 100644 --- a/Makefile +++ b/Makefile @@ -5,3 +5,7 @@ fmt: .PHONY: generate-grpc generate-grpc: protoc --proto_path=./concordium-grpc-api --grpc-swift_opt='Client=true,Server=false' --grpc-swift_out=./Sources/ConcordiumSwiftSDK/Generated/Grpc --swift_out=./Sources/ConcordiumSwiftSDK/Generated/Grpc ./concordium-grpc-api/v2/concordium/*.proto + +.PHONY: build-crypto +build-crypto: + cd ./lib/crypto && ./build.sh diff --git a/lib/crypto/build.sh b/lib/crypto/build.sh index b4e5242..8840c4f 100755 --- a/lib/crypto/build.sh +++ b/lib/crypto/build.sh @@ -3,4 +3,4 @@ set -eux rm -rf ./ConcordiumWalletCrypto/ -cargo swift package --name=ConcordiumWalletCrypto --platforms=ios --platforms=macos --release \ No newline at end of file +cargo swift package --name=ConcordiumWalletCrypto --platforms=ios --platforms=macos --release From 9c219bd5eac11496a06b38df227b2d170d76c977 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Wed, 24 Jan 2024 14:14:28 +0100 Subject: [PATCH 07/16] Implement all Rust calls present in ConcordiumHdWallet from the JS SDK JS reference: https://github.com/Concordium/concordium-node-sdk-js/blob/main/packages/sdk/src/wasm/HdWallet.ts Unit tests ported: https://github.com/Concordium/concordium-node-sdk-js/blob/main/packages/sdk/test/ci/HdWallet.test.ts#L186 Task: https://concordium.atlassian.net/browse/CBW-1552 --- .../ConcordiumHdWallet.swift | 114 +++++++++++ .../ConcordiumSwiftSdk/ConcordiumWallet.swift | 29 --- .../ConcordiumHdWalletTest.swift | 187 ++++++++++++++++++ .../ConcordiumWalletTest.swift | 12 -- lib/crypto/src/lib.rs | 126 +++++++++--- lib/crypto/src/lib.udl | 24 ++- 6 files changed, 421 insertions(+), 71 deletions(-) create mode 100644 Sources/ConcordiumSwiftSdk/ConcordiumHdWallet.swift delete mode 100644 Sources/ConcordiumSwiftSdk/ConcordiumWallet.swift create mode 100644 Tests/ConcordiumSwiftSdkTests/ConcordiumHdWalletTest.swift delete mode 100644 Tests/ConcordiumSwiftSdkTests/ConcordiumWalletTest.swift diff --git a/Sources/ConcordiumSwiftSdk/ConcordiumHdWallet.swift b/Sources/ConcordiumSwiftSdk/ConcordiumHdWallet.swift new file mode 100644 index 0000000..7fd9f54 --- /dev/null +++ b/Sources/ConcordiumSwiftSdk/ConcordiumHdWallet.swift @@ -0,0 +1,114 @@ +import Foundation + +import ConcordiumWalletCrypto + +enum ConcordiumNetwork: String { + case mainnet = "Mainnet" + case testnet = "Testnet" +} + +class ConcordiumHdWallet { + let seedHex: String + let network: ConcordiumNetwork + + init(seedHex: String, network: ConcordiumNetwork) { + self.seedHex = seedHex + self.network = network + } + + func getAccountSigningKey(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt32) throws -> String { + try ConcordiumWalletCrypto.getAccountSigningKey( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex, + credentialCounter: credentialCounter + ) + } + + func getAccountPublicKey(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt32) throws -> String { + try ConcordiumWalletCrypto.getAccountPublicKey( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex, + credentialCounter: credentialCounter + ) + } + + func getCredentialId(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt8, commitmentKey: String) throws -> String { + try ConcordiumWalletCrypto.getCredentialId( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex, + credentialCounter: credentialCounter, + commitmentKey: commitmentKey + ) + } + + func getPrfKey(identityProviderIndex: UInt32, identityIndex: UInt32) throws -> String { + try ConcordiumWalletCrypto.getPrfKey( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex + ) + } + + func getIdCredSec(identityProviderIndex: UInt32, identityIndex: UInt32) throws -> String { + try ConcordiumWalletCrypto.getIdCredSec( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex + ) + } + + func getSignatureBlindingRandomness(identityProviderIndex: UInt32, identityIndex: UInt32) throws -> String { + try ConcordiumWalletCrypto.getSignatureBlindingRandomness( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex + ) + } + + func getAttributeCommitmentRandomness(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt32, attribute: UInt8) throws -> String { + try ConcordiumWalletCrypto.getAttributeCommitmentRandomness( + seedHex: seedHex, + network: network.rawValue, + identityProviderIndex: identityProviderIndex, + identityIndex: identityIndex, + credentialCounter: credentialCounter, + attribute: attribute + ) + } + + func getVerifiableCredentialSigningKey(issuerIndex: UInt64, issuerSubindex: UInt64, verifiableCredentialIndex: UInt32) throws -> String { + try ConcordiumWalletCrypto.getVerifiableCredentialSigningKey( + seedHex: seedHex, + network: network.rawValue, + issuerIndex: issuerIndex, + issuerSubindex: issuerSubindex, + verifiableCredentialIndex: verifiableCredentialIndex + ) + } + + func getVerifiableCredentialPublicKey(issuerIndex: UInt64, issuerSubindex: UInt64, verifiableCredentialIndex: UInt32) throws -> String { + try ConcordiumWalletCrypto.getVerifiableCredentialPublicKey( + seedHex: seedHex, + network: network.rawValue, + issuerIndex: issuerIndex, + issuerSubindex: issuerSubindex, + verifiableCredentialIndex: verifiableCredentialIndex + ) + } + + func getVerifiableCredentialBackupEncryptionKey() throws -> String { + try ConcordiumWalletCrypto.getVerifiableCredentialBackupEncryptionKey( + seedHex: seedHex, + network: network.rawValue + ) + } +} diff --git a/Sources/ConcordiumSwiftSdk/ConcordiumWallet.swift b/Sources/ConcordiumSwiftSdk/ConcordiumWallet.swift deleted file mode 100644 index 496a5be..0000000 --- a/Sources/ConcordiumSwiftSdk/ConcordiumWallet.swift +++ /dev/null @@ -1,29 +0,0 @@ -import Foundation - -import ConcordiumWalletCrypto - -enum ConcordiumNetwork: String { - case mainnet = "Mainnet" - case testnet = "Testnet" -} - -class ConcordiumWallet { - let seedHex: String - let network: ConcordiumNetwork - - init(seedHex: String, network: ConcordiumNetwork) { - self.seedHex = seedHex - self.network = network - } - - func getAccountSigningKey(identityProviderIndex: UInt32, identityIndex: UInt32, credentialCounter: UInt32) throws -> String { - let res = try ConcordiumWalletCrypto.getAccountSigningKey( - seedHex: seedHex, - net: network.rawValue, - identityProviderIndex: identityProviderIndex, - identityIndex: identityIndex, credentialCounter: credentialCounter - ) -// print(res) - return res - } -} diff --git a/Tests/ConcordiumSwiftSdkTests/ConcordiumHdWalletTest.swift b/Tests/ConcordiumSwiftSdkTests/ConcordiumHdWalletTest.swift new file mode 100644 index 0000000..7b3c05a --- /dev/null +++ b/Tests/ConcordiumSwiftSdkTests/ConcordiumHdWalletTest.swift @@ -0,0 +1,187 @@ +@testable import ConcordiumSwiftSdk +import CryptoKit +import XCTest + +final class ConcordiumHdWalletTest: XCTestCase { + let TEST_SEED_1 = "efa5e27326f8fa0902e647b52449bf335b7b605adc387015ec903f41d95080eb71361cbc7fb78721dcd4f3926a337340aa1406df83332c44c1cdcfe100603860" + + func testMainnetSigningKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 55, credentialCounter: 7), + "e4d1693c86eb9438feb9cbc3d561fbd9299e3a8b3a676eb2483b135f8dbf6eb1" + ) + } + + func testMainnetPublicKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getAccountPublicKey(identityProviderIndex: 1, identityIndex: 341, credentialCounter: 9), + "d54aab7218fc683cbd4d822f7c2b4e7406c41ae08913012fab0fa992fa008e98" + ) + } + + func testMainnetPublicAndSigningKeyMetch() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + let privateKey = try wallet.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) + let publicKey = try wallet.getAccountPublicKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) + let message = "abcd1234abcd5678".data(using: .ascii)! + let signature = try Curve25519.Signing.PrivateKey( + rawRepresentation: Data(fromHexString: privateKey) + ).signature(for: message) + XCTAssertTrue( + try Curve25519.Signing.PublicKey(rawRepresentation: Data(fromHexString: publicKey)) + .isValidSignature(signature, for: message) + ) + } + + func testMainnetIdCredSec() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getIdCredSec(identityProviderIndex: 2, identityIndex: 115), + "33b9d19b2496f59ed853eb93b9d374482d2e03dd0a12e7807929d6ee54781bb1" + ) + } + + func testMainnetPrfKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getPrfKey(identityProviderIndex: 3, identityIndex: 35), + "4409e2e4acffeae641456b5f7406ecf3e1e8bd3472e2df67a9f1e8574f211bc5" + ) + } + + func testMainnetCredId() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getCredentialId(identityProviderIndex: 10, identityIndex: 50, credentialCounter: 5, commitmentKey: "b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5a8d45e64b6f917c540eee16c970c3d4b7f3caf48a7746284878e2ace21c82ea44bf84609834625be1f309988ac523fac"), + "8a3a87f3f38a7a507d1e85dc02a92b8bcaa859f5cf56accb3c1bc7c40e1789b4933875a38dd4c0646ca3e940a02c42d8" + ) + } + + func testMainnetBlindingRandomness() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getSignatureBlindingRandomness(identityProviderIndex: 4, identityIndex: 5713), + "1e3633af2b1dbe5600becfea0324bae1f4fa29f90bdf419f6fba1ff520cb3167" + ) + } + + func testMainnetAttributeCommitmentRandomness() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getAttributeCommitmentRandomness(identityProviderIndex: 5, identityIndex: 0, credentialCounter: 4, attribute: 0), + "6ef6ba6490fa37cd517d2b89a12b77edf756f89df5e6f5597440630cd4580b8f" + ) + } + + func testTestnetSigningKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 55, credentialCounter: 7), + "aff97882c6df085e91ae2695a32d39dccb8f4b8d68d2f0db9637c3a95f845e3c" + ) + } + + func testTestnetPublicKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getAccountPublicKey(identityProviderIndex: 1, identityIndex: 341, credentialCounter: 9), + "ef6fd561ca0291a57cdfee896245db9803a86da74c9a6c1bf0252b18f8033003" + ) + } + + func testTestnetPublicAndSigningKeyMatch() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + let privateKey = try wallet.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) + let publicKey = try wallet.getAccountPublicKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) + let message = "abcd1234abcd5678".data(using: .ascii)! + let signature = try Curve25519.Signing.PrivateKey( + rawRepresentation: Data(fromHexString: privateKey) + ).signature(for: message) + XCTAssertTrue( + try Curve25519.Signing.PublicKey(rawRepresentation: Data(fromHexString: publicKey)) + .isValidSignature(signature, for: message) + ) + } + + func testTestnetIdCredSec() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getIdCredSec(identityProviderIndex: 2, identityIndex: 115), + "33c9c538e362c5ac836afc08210f4b5d881ba65a0a45b7e353586dad0a0f56df" + ) + } + + func testTestnetPrfKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getPrfKey(identityProviderIndex: 3, identityIndex: 35), + "41d794d0b06a7a31fb79bb76c44e6b87c63e78f9afe8a772fc64d20f3d9e8e82" + ) + } + + func testTestnetCredId() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getCredentialId(identityProviderIndex: 10, identityIndex: 50, credentialCounter: 5, commitmentKey: "b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5a8d45e64b6f917c540eee16c970c3d4b7f3caf48a7746284878e2ace21c82ea44bf84609834625be1f309988ac523fac"), + "9535e4f2f964c955c1dd0f312f2edcbf4c7d036fe3052372a9ad949ff061b9b7ed6b00f93bc0713e381a93a43715206c" + ) + } + + func testTestnetBlindingRandomness() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getSignatureBlindingRandomness(identityProviderIndex: 4, identityIndex: 5713), + "079eb7fe4a2e89007f411ede031543bd7f687d50341a5596e015c9f2f4c1f39b" + ) + } + + func testTestnetAttributeCommitmentRandomness() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getAttributeCommitmentRandomness(identityProviderIndex: 5, identityIndex: 0, credentialCounter: 4, attribute: 0), + "409fa90314ec8fb4a2ae812fd77fe58bfac81765cad3990478ff7a73ba6d88ae" + ) + } + + func testTestnetCredIdMatchesCredDeployment() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getCredentialId(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 1, commitmentKey: "b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5a8d45e64b6f917c540eee16c970c3d4b7f3caf48a7746284878e2ace21c82ea44bf84609834625be1f309988ac523fac"), + "b317d3fea7de56f8c96f6e72820c5cd502cc0eef8454016ee548913255897c6b52156cc60df965d3efb3f160eff6ced4" + ) + } + + func testMainnetVerifiableCredentialSigningKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getVerifiableCredentialSigningKey(issuerIndex: 1, issuerSubindex: 2, verifiableCredentialIndex: 1), + "670d904509ce09372deb784e702d4951d4e24437ad3879188d71ae6db51f3301" + ) + } + + func testMainnetVerifiableCredentialPublicKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .mainnet) + XCTAssertEqual( + try wallet.getVerifiableCredentialPublicKey(issuerIndex: 3, issuerSubindex: 1232, verifiableCredentialIndex: 341), + "16afdb3cb3568b5ad8f9a0fa3c741b065642de8c53e58f7920bf449e63ff2bf9" + ) + } + + func testTestnetVerifiableCredentialSigningKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getVerifiableCredentialSigningKey(issuerIndex: 13, issuerSubindex: 0, verifiableCredentialIndex: 1), + "c75a161b97a1e204d9f31202308958e541e14f0b14903bd220df883bd06702bb" + ) + } + + func testTestnetVerifiableCredentialPublicKey() throws { + let wallet = ConcordiumHdWallet(seedHex: TEST_SEED_1, network: .testnet) + XCTAssertEqual( + try wallet.getVerifiableCredentialPublicKey(issuerIndex: 17, issuerSubindex: 0, verifiableCredentialIndex: 341), + "c52a30475bac88da9e65471cf9cf59f99dcce22ce31de580b3066597746b394a" + ) + } +} diff --git a/Tests/ConcordiumSwiftSdkTests/ConcordiumWalletTest.swift b/Tests/ConcordiumSwiftSdkTests/ConcordiumWalletTest.swift deleted file mode 100644 index fa10db5..0000000 --- a/Tests/ConcordiumSwiftSdkTests/ConcordiumWalletTest.swift +++ /dev/null @@ -1,12 +0,0 @@ -@testable import ConcordiumSwiftSdk -import XCTest - -final class ConcordiumWalletTest: XCTestCase { - let someSeedHex = "877974c7dddda738dab2277073b218af3a3d84f2aa8c1245838cf49f93dddc9f3ee669e0a8a0f463cfde164bdc82208d97cb312d7777d37655575fe309a02934" - - func testTest() throws { - let w = ConcordiumWallet(seedHex: someSeedHex, network: .testnet) - let res = try w.getAccountSigningKey(identityProviderIndex: 0, identityIndex: 0, credentialCounter: 0) - print(res) - } -} diff --git a/lib/crypto/src/lib.rs b/lib/crypto/src/lib.rs index 9826c5c..5f64c5d 100644 --- a/lib/crypto/src/lib.rs +++ b/lib/crypto/src/lib.rs @@ -1,10 +1,18 @@ -use wallet_library::wallet::get_account_signing_key_aux; +use wallet_library::wallet::{ + get_account_public_key_aux, get_account_signing_key_aux, + get_attribute_commitment_randomness_aux, get_credential_id_aux, get_id_cred_sec_aux, + get_prf_key_aux, get_signature_blinding_randomness_aux, + get_verifiable_credential_backup_encryption_key_aux, get_verifiable_credential_public_key_aux, + get_verifiable_credential_signing_key_aux, +}; // UniFFI book: https://mozilla.github.io/uniffi-rs/udl_file_spec.html uniffi::include_scaffolding!("lib"); +/// Error type returned by the bridge functions. +/// A corresponding Swift type will be generated (via the UDL definition). #[derive(Debug, thiserror::Error)] -enum WalletCryptoError { +enum ConcordiumWalletCryptoError { #[error("call {call} failed: {msg}")] CallFailed { call: String, msg: String }, } @@ -15,69 +23,133 @@ fn get_account_signing_key( identity_provider_index: u32, identity_index: u32, credential_counter: u32, -) -> Result { +) -> Result { get_account_signing_key_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter) - .map_err(|e| WalletCryptoError::CallFailed { + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { call: format!("get_account_signing_key(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter})"), msg: e.to_string(), }) } -fn getAccountPublicKey( +fn get_account_public_key( seed_hex: String, net: String, identity_provider_index: u32, - identity_index: u64, + identity_index: u32, credential_counter: u32, -) -> String { - todo!() +) -> Result { + get_account_public_key_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_account_public_key(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter})"), + msg: e.to_string(), + }) } -fn getIdCredSec( +fn get_id_cred_sec( seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, -) -> String { - todo!() +) -> Result { + get_id_cred_sec_aux(seed_hex, net.as_str(), identity_provider_index, identity_index) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_id_cred_sec(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index})"), + msg: e.to_string(), + }) } -fn getPrfKey( +fn get_prf_key( seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, -) -> String { - todo!() +) -> Result { + get_prf_key_aux(seed_hex, net.as_str(), identity_provider_index, identity_index) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_prf_key(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index})"), + msg: e.to_string(), + }) } -fn getCredentialId( +fn get_credential_id( seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, - credential_counter: u32, + credential_counter: u8, commitment_key: String, -) -> String { - todo!() +) -> Result { + get_credential_id_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter, commitment_key.as_str()) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_credential_id(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter}, commitment_key={commitment_key})"), + msg: e.to_string(), + }) } -fn getSignatureBlindingRandomness( +fn get_signature_blinding_randomness( seed_hex: String, net: String, identity_provider_index: u32, identity_index: u32, -) -> String { - todo!() +) -> Result { + get_signature_blinding_randomness_aux(seed_hex, net.as_str(), identity_provider_index, identity_index) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_signature_blinding_randomness(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index})"), + msg: e.to_string(), + }) } -fn getAttributeCommitmentRandomness( +fn get_attribute_commitment_randomness( seed_hex: String, net: String, identity_provider_index: u32, - identity_index: u64, - credential_counter: u64, - attribute: u32, -) -> String { - todo!() + identity_index: u32, + credential_counter: u32, + attribute: u8, +) -> Result { + get_attribute_commitment_randomness_aux(seed_hex, net.as_str(), identity_provider_index, identity_index, credential_counter, attribute) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_attribute_commitment_randomness(seed_hex, net={net}, identity_provider_index={identity_provider_index}, identity_index={identity_index}, credential_counter={credential_counter}, attribute={attribute})"), + msg: e.to_string(), + }) +} + +fn get_verifiable_credential_signing_key( + seed_hex: String, + net: String, + issuer_index: u64, + issuer_subindex: u64, + verifiable_credential_index: u32, +) -> Result { + get_verifiable_credential_signing_key_aux(seed_hex, net.as_str(), issuer_index, issuer_subindex, verifiable_credential_index) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_verifiable_credential_signing_key(seed_hex, net={net}, issuer_index={issuer_index}, issuer_subindex={issuer_subindex}, verifiable_credential_index={verifiable_credential_index})"), + msg: e.to_string(), + }) +} + +fn get_verifiable_credential_public_key( + seed_hex: String, + net: String, + issuer_index: u64, + issuer_subindex: u64, + verifiable_credential_index: u32, +) -> Result { + get_verifiable_credential_public_key_aux(seed_hex, net.as_str(), issuer_index, issuer_subindex, verifiable_credential_index) + .map_err(|e| ConcordiumWalletCryptoError::CallFailed { + call: format!("get_verifiable_credential_public_key(seed_hex, net={net}, issuer_index={issuer_index}, issuer_subindex={issuer_subindex}, verifiable_credential_index={verifiable_credential_index})"), + msg: e.to_string(), + }) +} + +fn get_verifiable_credential_backup_encryption_key( + seed_hex: String, + net: String, +) -> Result { + get_verifiable_credential_backup_encryption_key_aux(seed_hex, net.as_str()).map_err(|e| { + ConcordiumWalletCryptoError::CallFailed { + call: format!("get_verifiable_credential_backup_encryption_key(seed_hex, net={net}"), + msg: e.to_string(), + } + }) } diff --git a/lib/crypto/src/lib.udl b/lib/crypto/src/lib.udl index 38bca25..26a5cea 100644 --- a/lib/crypto/src/lib.udl +++ b/lib/crypto/src/lib.udl @@ -1,9 +1,27 @@ [Error] -enum WalletCryptoError { +enum ConcordiumWalletCryptoError { "CallFailed" }; namespace crypto { - [Throws=WalletCryptoError] - string get_account_signing_key(string seed_hex, string net, u32 identity_provider_index, u32 identity_index, u32 credential_counter); + [Throws=ConcordiumWalletCryptoError] + string get_account_signing_key(string seed_hex, string network, u32 identity_provider_index, u32 identity_index, u32 credential_counter); + [Throws=ConcordiumWalletCryptoError] + string get_account_public_key(string seed_hex, string network, u32 identity_provider_index, u32 identity_index, u32 credential_counter); + [Throws=ConcordiumWalletCryptoError] + string get_id_cred_sec(string seed_hex, string network, u32 identity_provider_index, u32 identity_index); + [Throws=ConcordiumWalletCryptoError] + string get_prf_key(string seed_hex, string network, u32 identity_provider_index, u32 identity_index); + [Throws=ConcordiumWalletCryptoError] + string get_credential_id(string seed_hex, string network, u32 identity_provider_index, u32 identity_index, u8 credential_counter, string commitment_key); + [Throws=ConcordiumWalletCryptoError] + string get_signature_blinding_randomness(string seed_hex, string network, u32 identity_provider_index, u32 identity_index); + [Throws=ConcordiumWalletCryptoError] + string get_attribute_commitment_randomness(string seed_hex, string network, u32 identity_provider_index, u32 identity_index, u32 credential_counter, u8 attribute); + [Throws=ConcordiumWalletCryptoError] + string get_verifiable_credential_signing_key(string seed_hex, string network, u64 issuer_index, u64 issuer_subindex, u32 verifiable_credential_index); + [Throws=ConcordiumWalletCryptoError] + string get_verifiable_credential_public_key(string seed_hex, string network, u64 issuer_index, u64 issuer_subindex, u32 verifiable_credential_index); + [Throws=ConcordiumWalletCryptoError] + string get_verifiable_credential_backup_encryption_key(string seed_hex, string network); }; From 776ac319b769b05b5e0ee1ec087af26c7ec54659 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Wed, 24 Jan 2024 15:23:53 +0100 Subject: [PATCH 08/16] Automatic XCode project file updates --- ExampleWallet/ExampleWallet.xcodeproj/project.pbxproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ExampleWallet/ExampleWallet.xcodeproj/project.pbxproj b/ExampleWallet/ExampleWallet.xcodeproj/project.pbxproj index b8d1972..7a4064f 100644 --- a/ExampleWallet/ExampleWallet.xcodeproj/project.pbxproj +++ b/ExampleWallet/ExampleWallet.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ A10E85322B56A6110063B079 /* SeedPhraseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A10E85312B56A6110063B079 /* SeedPhraseView.swift */; }; A16C9F8F2B5D2CAF0009AD77 /* SeedPhraseValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A16C9F8E2B5D2CAF0009AD77 /* SeedPhraseValidator.swift */; }; A16C9FBC2B5D370C0009AD77 /* SeedPhraseValidatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A16C9FBB2B5D370C0009AD77 /* SeedPhraseValidatorTests.swift */; }; - CD0E4E142B6116CA00E62FF1 /* ConcordiumSwiftSdk in Frameworks */ = {isa = PBXBuildFile; productRef = CD0E4E132B6116CA00E62FF1 /* ConcordiumSwiftSdk */; }; A17E071D2B57E8DE00F7BFFC /* IssueIdentityView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A17E071C2B57E8DE00F7BFFC /* IssueIdentityView.swift */; }; A17E07202B57EE8E00F7BFFC /* BlueButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A17E071F2B57EE8E00F7BFFC /* BlueButton.swift */; }; A17E07222B57F12400F7BFFC /* BlueTextStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = A17E07212B57F12400F7BFFC /* BlueTextStyle.swift */; }; @@ -20,6 +19,7 @@ A1CD79D82B556FD200F1CAA5 /* ExampleWalletApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1CD79D72B556FD200F1CAA5 /* ExampleWalletApp.swift */; }; A1CD79DC2B556FD300F1CAA5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1CD79DB2B556FD300F1CAA5 /* Assets.xcassets */; }; A1CD79DF2B556FD300F1CAA5 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A1CD79DE2B556FD300F1CAA5 /* Preview Assets.xcassets */; }; + CD0E4E142B6116CA00E62FF1 /* ConcordiumSwiftSdk in Frameworks */ = {isa = PBXBuildFile; productRef = CD0E4E132B6116CA00E62FF1 /* ConcordiumSwiftSdk */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -541,15 +541,15 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - CD0E4E132B6116CA00E62FF1 /* ConcordiumSwiftSdk */ = { - isa = XCSwiftPackageProductDependency; - productName = ConcordiumSwiftSdk; - }; A1A6B3A02B5A893100EC1313 /* MnemonicSwift */ = { isa = XCSwiftPackageProductDependency; package = A1A6B39F2B5A893100EC1313 /* XCRemoteSwiftPackageReference "MnemonicSwift" */; productName = MnemonicSwift; }; + CD0E4E132B6116CA00E62FF1 /* ConcordiumSwiftSdk */ = { + isa = XCSwiftPackageProductDependency; + productName = ConcordiumSwiftSdk; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = A1CD79CC2B556FD200F1CAA5 /* Project object */; From f4e54ad91eff99df9ca884f093b21a198e6aa4c0 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Wed, 24 Jan 2024 15:32:47 +0100 Subject: [PATCH 09/16] CI: Build rust lib --- .github/workflows/build+test.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 85cb96d..6dc66e5 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -6,6 +6,7 @@ on: pull_request: env: + rust_version: "1.72" swift_version: "5.9" jobs: @@ -13,10 +14,17 @@ jobs: runs-on: macos-13 steps: + - name: Setup Rust + run: | + rustup default "${{env.rust_version}}" + - name: Build ConcordiumWalletCrypto library + run: | + cargo install --git=https://github.com/antoniusnaumann/cargo-swift/ --rev=4816d75550878dfb598cc8f0eda397aacef9166c cargo-swift + make build-crypto - name: Setup Swift uses: swift-actions/setup-swift@v1 with: - swift-version: "${{ env.swift_version }}" + swift-version: "${{env.swift_version}}" - name: Check out sources uses: actions/checkout@v4 - name: Check formatting From d75809a583cf2d5137ce6dbcb0645908fcb2d5a4 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Wed, 24 Jan 2024 15:43:06 +0100 Subject: [PATCH 10/16] CI: Comment out formatter check for now We'll need to add Rust lib building, but it requires adding a script that does the equivalent of what 'cargo-swift' does. --- .github/workflows/build+test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 6dc66e5..2086999 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -6,7 +6,6 @@ on: pull_request: env: - rust_version: "1.72" swift_version: "5.9" jobs: @@ -14,21 +13,14 @@ jobs: runs-on: macos-13 steps: - - name: Setup Rust - run: | - rustup default "${{env.rust_version}}" - - name: Build ConcordiumWalletCrypto library - run: | - cargo install --git=https://github.com/antoniusnaumann/cargo-swift/ --rev=4816d75550878dfb598cc8f0eda397aacef9166c cargo-swift - make build-crypto - name: Setup Swift uses: swift-actions/setup-swift@v1 with: - swift-version: "${{env.swift_version}}" + swift-version: "${{ env.swift_version }}" - name: Check out sources uses: actions/checkout@v4 - - name: Check formatting - run: swift package plugin --allow-writing-to-package-directory swiftformat --lint + #- name: Check formatting + # run: swift package plugin --allow-writing-to-package-directory swiftformat --lint - name: Build project run: swift build #- name: Run tests From 3d0ad5ef31c7c5d94a371d3c21b94a287ccab8aa Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 12:11:04 +0100 Subject: [PATCH 11/16] Update readme --- README.md | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 657ee58..d1f6c96 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,14 @@ **STATUS: EARLY DEVELOPMENT** An SDK for applications written in the [Swift Programming Language](https://www.swift.org/) to -interact with the Concordium Blockchain. +interact with the [Concordium Blockchain](https://concordium.com). The main purpose of the SDK is to facilitate development of mobile wallet apps for iOS devices. +Once the project is ready for production, it will replace the existing +[`ConcordiumWalletCrypto`](https://github.com/Concordium/concordium-wallet-crypto-swift) library +which is currently used in the [iOS reference wallet](https://github.com/Concordium/concordium-reference-wallet-ios/). + ### Supported platforms - iOS 15+ @@ -14,25 +18,54 @@ The main purpose of the SDK is to facilitate development of mobile wallet apps f ## Usage -*No tags have been added to "publish" a build yet. The following is unverified and is only going to work once v1.0 has been published.* +*No tags have been added to "publish" a build yet. The following is only going to work once v1.0 has been published. +To use it in the current, unfinished state, replace `"1.0"` with `"main"`.* -The SDK is available as a SwiftPM package hosted on GitHub as this repository. +The SDK is available as a [SwiftPM package](https://developer.apple.com/documentation/xcode/swift-packages) +hosted on GitHub as this repository. To include it as a dependency, add the following ```swift -.package(url: "https://github.com/Concordium/concordium-swift-sdk.git", from: "1.0"), +.package(url: "https://github.com/Concordium/concordium-swift-sdk.git", from: "1.0") ``` and adding ```swift -.product(name: "ConcordiumSwiftSDK", package: "concordium-swift-sdk"), +.product(name: "ConcordiumSwiftSDK", package: "concordium-swift-sdk") ``` to the `dependencies` list of the appropriate `target`. ## Development +### Build Rust bindings + +The Rust bindings are located in `./lib/crypto` and built using [`cargo-swift`](https://github.com/antoniusnaumann/cargo-swift/) +into a [XCFramework](https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages). +The SDK pulls in this framework from a local path. + +Building is only a matter of installing `cargo-swift` and invoking a Make target: + +```shell +cargo install cargo-swift +make build-crypto +``` + +This will place the target framework at `./lib/crypto/ConcordiumWalletCrypto`. + +### Build and test SDK + +With the Rust bindings in place, the SDK is built and tests executed using `swift test`. +It's not necessary to build the project in order to use it in other projects: +Just declare a dependency as explained in [usage](#usage). +The SDK will get compiled as part of the build process of the executable. + +TODO: This means that we'll either have to add steps in `Package.swift` for having the binaries built automatically (if possible) +or push them to some specific location +(like we did with [`concordium-wallet-crypto-swift`](https://github.com/Concordium/concordium-wallet-crypto-swift)). +This could be a GitHub release/package or something. + ### Source code formatting The source code is formatted according to the default rules of [`SwiftFormat`](https://github.com/nicklockwood/SwiftFormat). From a26a630650b6628bb15b92998bb762b9cfa4abc3 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 14:23:46 +0100 Subject: [PATCH 12/16] Update readme --- README.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index d1f6c96..a9d86b9 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,14 @@ to the `dependencies` list of the appropriate `target`. ### Build Rust bindings -The Rust bindings are located in `./lib/crypto` and built using [`cargo-swift`](https://github.com/antoniusnaumann/cargo-swift/) +Concordium specific cryptographic functions are implemented in Rust and shared between all kinds of Concordium products. +This SDK includes a thin wrapper for providing bindings to the Rust library +[`wallet_library`](https://github.com/Concordium/concordium-base/tree/main/rust-src/wallet_library) +which exposes functions specifically relevant for wallets. + +These bindings are located in `./lib/crypto` and built using [`cargo-swift`](https://github.com/antoniusnaumann/cargo-swift/) into a [XCFramework](https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages). -The SDK pulls in this framework from a local path. +The SDK pulls in this framework from a local path, so the bindings have to built manually before the SDK can be used. Building is only a matter of installing `cargo-swift` and invoking a Make target: @@ -61,10 +66,10 @@ It's not necessary to build the project in order to use it in other projects: Just declare a dependency as explained in [usage](#usage). The SDK will get compiled as part of the build process of the executable. -TODO: This means that we'll either have to add steps in `Package.swift` for having the binaries built automatically (if possible) +TODO: This means that we'll either have to add steps in `Package.swift` for automatically building the binaries (if possible) or push them to some specific location (like we did with [`concordium-wallet-crypto-swift`](https://github.com/Concordium/concordium-wallet-crypto-swift)). -This could be a GitHub release/package or something. +This could be a GitHub release/package or S3. ### Source code formatting @@ -73,7 +78,8 @@ The source code is formatted according to the default rules of [`SwiftFormat`](h The CI workflow [`Build and test`](https://github.com/Concordium/concordium-swift-sdk/blob/main/.github/workflows/build%2Btest.yml) checks that the code base is correctly formated before PRs are merged. -The formatter has been integrated as a [Swift Package Manger plugin](https://github.com/nicklockwood/SwiftFormat#swift-package-manager-plugin). +The formatter has been integrated as a +[Swift Package Manger plugin](https://github.com/nicklockwood/SwiftFormat#swift-package-manager-plugin). It's possible to run the tool in a variety of ways (see the previous link for all options). The easiest option is to run it on the command line via @@ -81,5 +87,6 @@ The easiest option is to run it on the command line via make fmt ``` -It may also be [invoked directly from XCode](https://github.com/nicklockwood/SwiftFormat#trigger-plugin-from-xcode) by right-clicking on package root (i.e. `concordium-swift-sdk`) in the Project Navigator pane. +It may also be [invoked directly from XCode](https://github.com/nicklockwood/SwiftFormat#trigger-plugin-from-xcode) +by right-clicking on package root (i.e. `concordium-swift-sdk`) in the Project Navigator pane. The tool is then listed under "SwiftFormat" as "SwiftFormatPlugin" in the context menu for formatting the entire project. From 3e3b02ac738785ea23eed814fd213115cbc50712 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 14:28:32 +0100 Subject: [PATCH 13/16] Attempt to fix CI --- .github/workflows/build+test.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 2086999..5f2cc47 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -6,6 +6,7 @@ on: pull_request: env: + rust_version: "1.72" swift_version: "5.9" jobs: @@ -16,11 +17,17 @@ jobs: - name: Setup Swift uses: swift-actions/setup-swift@v1 with: - swift-version: "${{ env.swift_version }}" + swift-version: "${{env.swift_version}}" + - name: Setup Rust + run: | + rustup default "${{env.rust_version}}" + cargo install cargo-swift - name: Check out sources uses: actions/checkout@v4 - #- name: Check formatting - # run: swift package plugin --allow-writing-to-package-directory swiftformat --lint + - name: Build rust bindings + run: make build-crypto + - name: Check formatting + run: swift package plugin --allow-writing-to-package-directory swiftformat --lint - name: Build project run: swift build #- name: Run tests From acf802a15d4cb4d5481b9fb546ac624220eef0ca Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 14:39:44 +0100 Subject: [PATCH 14/16] Fix CI some more --- .github/workflows/build+test.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 5f2cc47..47423da 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -22,10 +22,14 @@ jobs: run: | rustup default "${{env.rust_version}}" cargo install cargo-swift + rustup toolchain install aarch64-apple-darwin - name: Check out sources uses: actions/checkout@v4 - - name: Build rust bindings - run: make build-crypto + with: + submodules: recursive + - name: Build rust bindings (macOS only) + run: cargo swift package --name=ConcordiumWalletCrypto --platforms=macos --release + working-directory: ./lib/crypto - name: Check formatting run: swift package plugin --allow-writing-to-package-directory swiftformat --lint - name: Build project From 3a71c2378c2735073236d42d12eb7e4d9a377dd2 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 14:46:15 +0100 Subject: [PATCH 15/16] More CI fix --- .github/workflows/build+test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 47423da..4c11b81 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -21,8 +21,8 @@ jobs: - name: Setup Rust run: | rustup default "${{env.rust_version}}" + rustup toolchain install x86_64-apple-darwin aarch64-apple-darwin cargo install cargo-swift - rustup toolchain install aarch64-apple-darwin - name: Check out sources uses: actions/checkout@v4 with: From 5dfbf9485eb5b27e438cd9da628f0d0b8b3038b8 Mon Sep 17 00:00:00 2001 From: Michael Bisgaard Olesen Date: Thu, 25 Jan 2024 14:52:49 +0100 Subject: [PATCH 16/16] Fix --- .github/workflows/build+test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build+test.yml b/.github/workflows/build+test.yml index 4c11b81..89c0e47 100644 --- a/.github/workflows/build+test.yml +++ b/.github/workflows/build+test.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Rust run: | rustup default "${{env.rust_version}}" - rustup toolchain install x86_64-apple-darwin aarch64-apple-darwin + rustup target install aarch64-apple-darwin x86_64-apple-darwin cargo install cargo-swift - name: Check out sources uses: actions/checkout@v4