diff --git a/Cargo.lock b/Cargo.lock index a9fdc8d2ba..7b18e90445 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.7", + "digest", ] [[package]] @@ -306,15 +306,6 @@ dependencies = [ "constant_time_eq", ] -[[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" @@ -720,19 +711,6 @@ dependencies = [ "winapi", ] -[[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 = "dashmap" version = "5.5.0" @@ -763,22 +741,13 @@ dependencies = [ "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", + "block-buffer", "crypto-common", "subtle", ] @@ -815,29 +784,6 @@ version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" -[[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 = "either" version = "1.8.1" @@ -1155,17 +1101,6 @@ dependencies = [ "unicode-width", ] -[[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.10" @@ -1175,7 +1110,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -1588,7 +1523,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -1725,12 +1660,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - [[package]] name = "opencl-sys" version = "0.2.4" @@ -1929,8 +1858,8 @@ dependencies = [ "byteorder", "lazy_static", "num-traits", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_xorshift", "regex-syntax 0.6.29", "rusty-fork", @@ -1968,19 +1897,6 @@ dependencies = [ "proc-macro2", ] -[[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" @@ -1988,18 +1904,8 @@ 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", + "rand_chacha", + "rand_core", ] [[package]] @@ -2009,16 +1915,7 @@ 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", + "rand_core", ] [[package]] @@ -2027,7 +1924,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.10", + "getrandom", ] [[package]] @@ -2037,16 +1934,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand 0.8.5", -] - -[[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", + "rand", ] [[package]] @@ -2055,7 +1943,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -2104,7 +1992,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.10", + "getrandom", "redox_syscall 0.2.16", "thiserror", ] @@ -2227,7 +2115,7 @@ dependencies = [ "log", "once_cell", "opencl3", - "sha2 0.10.7", + "sha2", "temp-env", "thiserror", ] @@ -2514,19 +2402,6 @@ dependencies = [ "syn 2.0.28", ] -[[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.7" @@ -2535,7 +2410,7 @@ checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.7", + "digest", ] [[package]] @@ -2553,12 +2428,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - [[package]] name = "slab" version = "0.4.8" @@ -2588,7 +2457,7 @@ dependencies = [ "num-format", "once_cell", "parking_lot", - "rand 0.8.5", + "rand", "rayon", "rusty-hook", "self_update", @@ -2628,15 +2497,15 @@ dependencies = [ "itertools 0.11.0", "lazy_static", "parking_lot", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "rand", + "rand_chacha", + "rand_core", "rayon", "rust-gpu-tools", "serde", "serde_json", "serial_test", - "sha2 0.10.7", + "sha2", "smallvec", "snarkvm-algorithms-cuda", "snarkvm-curves", @@ -2748,7 +2617,7 @@ name = "snarkvm-circuit-program" version = "0.14.6" dependencies = [ "anyhow", - "rand 0.8.5", + "rand", "snarkvm-circuit-account", "snarkvm-circuit-collections", "snarkvm-circuit-network", @@ -2840,7 +2709,7 @@ dependencies = [ name = "snarkvm-circuit-types-string" version = "0.14.6" dependencies = [ - "rand 0.8.5", + "rand", "snarkvm-circuit-environment", "snarkvm-circuit-types-boolean", "snarkvm-circuit-types-field", @@ -2868,7 +2737,6 @@ dependencies = [ "bincode", "bs58", "criterion", - "ed25519-dalek", "serde_json", "snarkvm-console-network", "snarkvm-console-types", @@ -2935,7 +2803,7 @@ dependencies = [ "itertools 0.11.0", "nom", "num-traits", - "rand 0.8.5", + "rand", "serde", "snarkvm-curves", "snarkvm-fields", @@ -3058,7 +2926,7 @@ version = "0.14.6" dependencies = [ "bincode", "criterion", - "rand 0.8.5", + "rand", "rayon", "rustc_version", "serde", @@ -3076,7 +2944,7 @@ dependencies = [ "derivative", "itertools 0.11.0", "num-traits", - "rand 0.8.5", + "rand", "rayon", "serde", "snarkvm-utilities", @@ -3093,7 +2961,7 @@ dependencies = [ "criterion", "indexmap 2.0.0", "parking_lot", - "rand 0.8.5", + "rand", "rayon", "serde_json", "snarkvm-console", @@ -3115,7 +2983,7 @@ version = "0.14.6" dependencies = [ "anyhow", "bincode", - "rand 0.8.5", + "rand", "serde_json", "snarkvm-console", "snarkvm-ledger-authority", @@ -3153,7 +3021,7 @@ dependencies = [ "blake2", "criterion", "itertools 0.11.0", - "rand 0.8.5", + "rand", "rayon", "serde_json", "snarkvm-algorithms", @@ -3173,8 +3041,8 @@ dependencies = [ "indexmap 2.0.0", "parking_lot", "proptest", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "rand_distr", "rayon", "serde_json", @@ -3326,9 +3194,9 @@ dependencies = [ "js-sys", "lazy_static", "paste", - "rand 0.8.5", + "rand", "serde_json", - "sha2 0.10.7", + "sha2", "snarkvm-algorithms", "snarkvm-circuit", "snarkvm-console", @@ -3351,7 +3219,7 @@ dependencies = [ "itertools 0.11.0", "once_cell", "parking_lot", - "rand 0.8.5", + "rand", "rayon", "serde_json", "serde_yaml", @@ -3376,7 +3244,7 @@ dependencies = [ "indexmap 2.0.0", "once_cell", "parking_lot", - "rand 0.8.5", + "rand", "rayon", "snarkvm-circuit", "snarkvm-console", @@ -3395,8 +3263,8 @@ dependencies = [ "bincode", "indexmap 2.0.0", "paste", - "rand 0.8.5", - "rand_chacha 0.3.1", + "rand", + "rand_chacha", "serde_json", "snarkvm-circuit", "snarkvm-console", @@ -3425,7 +3293,7 @@ dependencies = [ "bincode", "num-bigint", "num_cpus", - "rand 0.8.5", + "rand", "rand_xorshift", "rayon", "serde", @@ -3447,8 +3315,8 @@ dependencies = [ name = "snarkvm-wasm" version = "0.14.6" dependencies = [ - "getrandom 0.2.10", - "rand 0.8.5", + "getrandom", + "rand", "serde", "snarkvm-console", "snarkvm-curves", @@ -3968,12 +3836,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 27e9c2e027..99725f2d08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,7 +132,6 @@ noconfig = [ ] rocks = [ "snarkvm-ledger/rocks" ] test-helpers = [ "snarkvm-ledger/test-helpers" ] timer = [ "snarkvm-ledger/timer" ] -ed25519 = [ "snarkvm-console/ed25519" ] algorithms = [ "snarkvm-algorithms" ] circuit = [ "snarkvm-circuit" ] console = [ "snarkvm-console" ] diff --git a/console/Cargo.toml b/console/Cargo.toml index f8664fe313..1b12741de2 100644 --- a/console/Cargo.toml +++ b/console/Cargo.toml @@ -54,4 +54,3 @@ network = [ "collections", "snarkvm-console-network" ] program = [ "network", "snarkvm-console-program" ] serial = [ "snarkvm-console-collections/serial" ] types = [ "snarkvm-console-types" ] -ed25519 = [ "snarkvm-console-account/ed25519" ] diff --git a/console/account/Cargo.toml b/console/account/Cargo.toml index 9dada89541..94d7bfbd35 100644 --- a/console/account/Cargo.toml +++ b/console/account/Cargo.toml @@ -24,10 +24,6 @@ features = [ "address", "field", "group", "scalar" ] [dependencies.bs58] version = "0.5" -[dependencies.ed25519-dalek] -version = "1.0" -optional = true - [dev-dependencies.bincode] version = "1.3" @@ -51,4 +47,3 @@ graph_key = [ "private_key" ] private_key = [ "compute_key" ] signature = [ "compute_key" ] view_key = [ ] -ed25519 = [ "ed25519-dalek" ] diff --git a/console/account/src/private_key/mod.rs b/console/account/src/private_key/mod.rs index 690c714de3..b201188b63 100644 --- a/console/account/src/private_key/mod.rs +++ b/console/account/src/private_key/mod.rs @@ -20,9 +20,6 @@ mod try_from; #[cfg(feature = "signature")] mod sign; -#[cfg(feature = "ed25519")] -mod to_ed25519; - use snarkvm_console_network::prelude::*; use snarkvm_console_types::{Field, Scalar}; diff --git a/console/account/src/private_key/to_ed25519.rs b/console/account/src/private_key/to_ed25519.rs deleted file mode 100644 index 21d862504a..0000000000 --- a/console/account/src/private_key/to_ed25519.rs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2019-2023 Aleo Systems Inc. -// This file is part of the snarkVM library. - -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at: -// http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -use super::*; - -use ed25519_dalek::{PublicKey, SecretKey}; - -pub const ACCOUNT_ED25519_DOMAIN: &str = "AleoAccountEd25519_0"; - -impl PrivateKey { - /// Returns the Ed25519 private key for this account private key. - pub fn to_ed25519(&self, counter: u32) -> Result { - // Prepare the domain separator. - let domain = Field::new_domain_separator(ACCOUNT_ED25519_DOMAIN); - // Prepare the counter. - let counter = Field::from_u32(counter); - // Construct the preimage. - let preimage = [domain, self.sk_sig.to_field()?, self.r_sig.to_field()?, counter]; - // Hash the preimage. - let hash = N::hash_psd4(&preimage)?; - // Construct the ed25519 secret key. - let secret_key = SecretKey::from_bytes(&hash.to_bytes_le()?)?; - // Construct the ed25519 public key. - let public_key = PublicKey::from(&secret_key); - // Construct the ed25519 keypair. - Ok(ed25519_dalek::Keypair { secret: secret_key, public: public_key }) - } -}