From 4eb6de22aff34191ea44416ec73dd0e16bf4d9c8 Mon Sep 17 00:00:00 2001 From: brooks Date: Mon, 14 Aug 2023 13:53:35 -0400 Subject: [PATCH 1/7] Bump ed25519-dalek to 2.0.0 --- Cargo.lock | 202 +++++++++++++++++++++++++++++++--------- Cargo.toml | 8 +- programs/sbf/Cargo.lock | 188 ++++++++++++++++++++++++++++++------- 3 files changed, 315 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 294ec8bd79377e..9ec9eabbb5930d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,30 +29,30 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ + "crypto-common", "generic-array 0.14.7", ] [[package]] name = "aes" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if 1.0.0", "cipher", "cpufeatures", - "opaque-debug 0.3.0", ] [[package]] name = "aes-gcm-siv" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" dependencies = [ "aead", "aes", @@ -1070,11 +1070,12 @@ dependencies = [ [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array 0.14.7", + "crypto-common", + "inout", ] [[package]] @@ -1228,6 +1229,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + [[package]] name = "const_format" version = "0.2.31" @@ -1405,11 +1412,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", "typenum", ] @@ -1446,9 +1454,9 @@ dependencies = [ [[package]] name = "ctr" -version = "0.8.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ "cipher", ] @@ -1465,18 +1473,46 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version 0.4.0", "serde", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "darling" version = "0.20.1" @@ -1546,7 +1582,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" dependencies = [ - "const-oid", + "const-oid 0.7.1", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid 0.9.5", + "zeroize", ] [[package]] @@ -1722,7 +1768,17 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4620d40f6d2601794401d6dd95a5cf69b6c157852539470eeda433a99b3c0efc" dependencies = [ - "signature", + "signature 1.4.0", +] + +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", ] [[package]] @@ -1731,14 +1787,27 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek", - "ed25519", + "curve25519-dalek 3.2.0", + "ed25519 1.2.0", "rand 0.7.3", "serde", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.0.0", + "ed25519 2.2.2", + "serde", + "sha2 0.10.7", + "zeroize", +] + [[package]] name = "ed25519-dalek-bip32" version = "0.2.0" @@ -1746,7 +1815,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" dependencies = [ "derivation-path", - "ed25519-dalek", + "ed25519-dalek 1.0.1", "hmac 0.12.1", "sha2 0.10.7", ] @@ -1916,6 +1985,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + [[package]] name = "filedescriptor" version = "0.8.1" @@ -2664,6 +2739,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "instant" version = "0.1.12" @@ -3771,11 +3855,21 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" dependencies = [ - "der", - "spki", + "der 0.5.1", + "spki 0.5.4", "zeroize", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] + [[package]] name = "pkg-config" version = "0.3.22" @@ -3788,6 +3882,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "plotters" version = "0.3.4" @@ -3818,9 +3918,9 @@ dependencies = [ [[package]] name = "polyval" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -5048,6 +5148,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" + [[package]] name = "simpl" version = "0.1.0" @@ -5214,7 +5320,7 @@ dependencies = [ "crossbeam-channel", "dashmap 4.0.2", "dir-diff", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "flate2", "fnv", "fs-err", @@ -5650,7 +5756,7 @@ dependencies = [ "chrono", "clap 2.33.3", "console", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "humantime", "indicatif", "pretty-hex", @@ -5925,7 +6031,7 @@ name = "solana-ed25519-program-tests" version = "1.17.0" dependencies = [ "assert_matches", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "rand 0.7.3", "solana-program-test", "solana-sdk", @@ -6475,7 +6581,7 @@ dependencies = [ "bincode", "bv", "caps", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "dlopen2", "fnv", "lazy_static", @@ -6555,7 +6661,7 @@ dependencies = [ "cc", "console_error_panic_hook", "console_log", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "getrandom 0.2.8", "itertools", "js-sys", @@ -6888,7 +6994,7 @@ dependencies = [ "crossbeam-channel", "dashmap 4.0.2", "dir-diff", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "flate2", "fnv", "fs-err", @@ -6966,10 +7072,10 @@ dependencies = [ "bytemuck", "byteorder", "chrono", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "derivation-path", "digest 0.10.7", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "ed25519-dalek-bip32", "generic-array 0.14.7", "hex", @@ -7143,7 +7249,7 @@ dependencies = [ "nix", "pem", "percentage", - "pkcs8", + "pkcs8 0.8.0", "quinn", "quinn-proto", "rand 0.7.3", @@ -7525,7 +7631,7 @@ version = "1.17.0" dependencies = [ "bytemuck", "criterion", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "getrandom 0.1.16", "num-derive", "num-traits", @@ -7539,7 +7645,7 @@ name = "solana-zk-token-proof-program-tests" version = "1.17.0" dependencies = [ "bytemuck", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "solana-program-runtime", "solana-program-test", "solana-sdk", @@ -7555,7 +7661,7 @@ dependencies = [ "bincode", "bytemuck", "byteorder", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "getrandom 0.1.16", "itertools", "lazy_static", @@ -7613,7 +7719,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" dependencies = [ "base64ct", - "der", + "der 0.5.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", ] [[package]] @@ -8551,11 +8667,11 @@ checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "generic-array 0.14.7", + "crypto-common", "subtle", ] @@ -9080,9 +9196,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 59ed1509ed8f59..3d01bb36cbffdc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,7 +125,7 @@ license = "Apache-2.0" edition = "2021" [workspace.dependencies] -aes-gcm-siv = "0.10.3" +aes-gcm-siv = "0.11" ahash = "0.8.3" anyhow = "1.0.72" ark-bn254 = "0.4.0" @@ -171,7 +171,7 @@ criterion-stats = "0.3.0" crossbeam-channel = "0.5.8" csv = "1.2.2" ctrlc = "3.4.0" -curve25519-dalek = "3.2.1" +curve25519-dalek = "4" dashmap = "4.0.2" derivation-path = { version = "0.2.0", default-features = false } dialoguer = "0.10.4" @@ -180,7 +180,7 @@ dir-diff = "0.3.2" dirs-next = "2.0.0" dlopen2 = "0.5.0" eager = "0.1.0" -ed25519-dalek = "=1.0.1" +ed25519-dalek = "2" ed25519-dalek-bip32 = "0.2.0" either = "1.9.0" enum-iterator = "1.4.1" @@ -405,7 +405,7 @@ wasm-bindgen = "0.2" winapi = "0.3.8" winreg = "0.10" x509-parser = "0.14.0" -zeroize = { version = "1.3", default-features = false } +zeroize = { version = "1", default-features = false } zstd = "0.11.2" [patch.crates-io] diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index f41e9226cbf3f3..de3b40684d86a0 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -29,30 +29,30 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ + "crypto-common", "generic-array 0.14.7", ] [[package]] name = "aes" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if 1.0.0", "cipher", "cpufeatures", - "opaque-debug 0.3.0", ] [[package]] name = "aes-gcm-siv" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" +checksum = "ae0784134ba9375416d469ec31e7c5f9fa94405049cf08c5ce5b4698be673e0d" dependencies = [ "aead", "aes", @@ -927,11 +927,12 @@ dependencies = [ [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array 0.14.7", + "crypto-common", + "inout", ] [[package]] @@ -1037,6 +1038,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + [[package]] name = "constant_time_eq" version = "0.3.0" @@ -1146,11 +1153,12 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" -version = "0.1.3" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", "typenum", ] @@ -1166,27 +1174,55 @@ dependencies = [ [[package]] name = "ctr" -version = "0.8.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ "cipher", ] [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" dependencies = [ "byteorder 1.4.3", "digest 0.9.0", "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", "serde", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.28", +] + [[package]] name = "darling" version = "0.20.1" @@ -1245,7 +1281,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" dependencies = [ - "const-oid", + "const-oid 0.7.1", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid 0.9.5", + "zeroize", ] [[package]] @@ -1409,7 +1455,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf038a7b6fd7ef78ad3348b63f3a17550877b0e28f8d68bcc94894d1412158bc" dependencies = [ - "signature", + "signature 1.1.0", +] + +[[package]] +name = "ed25519" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +dependencies = [ + "pkcs8 0.10.2", + "signature 2.1.0", ] [[package]] @@ -1418,14 +1474,27 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek", - "ed25519", + "curve25519-dalek 3.2.0", + "ed25519 1.0.1", "rand 0.7.3", "serde", "sha2 0.9.9", "zeroize", ] +[[package]] +name = "ed25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +dependencies = [ + "curve25519-dalek 4.0.0", + "ed25519 2.2.2", + "serde", + "sha2 0.10.7", + "zeroize", +] + [[package]] name = "ed25519-dalek-bip32" version = "0.2.0" @@ -1433,7 +1502,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" dependencies = [ "derivation-path", - "ed25519-dalek", + "ed25519-dalek 1.0.1", "hmac 0.12.1", "sha2 0.10.7", ] @@ -1612,6 +1681,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + [[package]] name = "filetime" version = "0.2.10" @@ -2270,6 +2345,15 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array 0.14.7", +] + [[package]] name = "instant" version = "0.1.9" @@ -3387,11 +3471,21 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" dependencies = [ - "der", - "spki", + "der 0.5.1", + "spki 0.5.4", "zeroize", ] +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", +] + [[package]] name = "pkg-config" version = "0.3.17" @@ -3404,11 +3498,17 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "polyval" -version = "0.5.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -4431,6 +4531,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65211b7b6fc3f14ff9fc7a2011a434e3e6880585bd2e9e9396315ae24cbf7852" +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" + [[package]] name = "simpl" version = "0.1.0" @@ -5273,7 +5379,7 @@ dependencies = [ "bincode", "bv", "caps", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "dlopen2", "fnv", "lazy_static", @@ -5326,7 +5432,7 @@ dependencies = [ "cc", "console_error_panic_hook", "console_log", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "getrandom 0.2.8", "itertools", "js-sys", @@ -6073,7 +6179,7 @@ dependencies = [ "chrono", "derivation-path", "digest 0.10.7", - "ed25519-dalek", + "ed25519-dalek 2.0.0", "ed25519-dalek-bip32", "generic-array 0.14.7", "hmac 0.12.1", @@ -6210,7 +6316,7 @@ dependencies = [ "nix", "pem", "percentage", - "pkcs8", + "pkcs8 0.8.0", "quinn", "quinn-proto", "rand 0.7.3", @@ -6492,7 +6598,7 @@ dependencies = [ "bincode", "bytemuck", "byteorder 1.4.3", - "curve25519-dalek", + "curve25519-dalek 4.0.0", "getrandom 0.1.14", "itertools", "lazy_static", @@ -6548,7 +6654,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" dependencies = [ "base64ct", - "der", + "der 0.5.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", ] [[package]] @@ -7400,11 +7516,11 @@ checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "generic-array 0.14.7", + "crypto-common", "subtle", ] @@ -7911,9 +8027,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] From 61ffd990d6b90c4a9f406c4a6b840316c3ac0afd Mon Sep 17 00:00:00 2001 From: brooks Date: Mon, 14 Aug 2023 16:05:33 -0400 Subject: [PATCH 2/7] fixup v1 to v2 changes in ed25519-dalek --- Cargo.lock | 1 + sdk/Cargo.toml | 1 + sdk/program/src/pubkey.rs | 10 ++++------ sdk/src/ed25519_instruction.rs | 16 +++++++++------ sdk/src/signature.rs | 5 ++++- sdk/src/signer/keypair.rs | 36 +++++++++++++--------------------- 6 files changed, 34 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ec9eabbb5930d..9fdddd94f6157f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1803,6 +1803,7 @@ checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ "curve25519-dalek 4.0.0", "ed25519 2.2.2", + "rand_core 0.6.4", "serde", "sha2 0.10.7", "zeroize", diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 6f47005275ad7e..ed5eb7c0fcd72f 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -89,6 +89,7 @@ js-sys = { workspace = true } [dev-dependencies] anyhow = { workspace = true } curve25519-dalek = { workspace = true } +ed25519-dalek = { workspace = true, features = ["rand_core"] } hex = { workspace = true } static_assertions = { workspace = true } tiny-bip39 = { workspace = true } diff --git a/sdk/program/src/pubkey.rs b/sdk/program/src/pubkey.rs index f98b44fc2a4602..ab84a2ea7beae3 100644 --- a/sdk/program/src/pubkey.rs +++ b/sdk/program/src/pubkey.rs @@ -163,7 +163,9 @@ pub fn bytes_are_curve_point>(_bytes: T) -> bool { #[cfg(not(target_os = "solana"))] { curve25519_dalek::edwards::CompressedEdwardsY::from_slice(_bytes.as_ref()) - .decompress() + .ok() + .as_ref() + .map(curve25519_dalek::edwards::CompressedEdwardsY::decompress) .is_some() } #[cfg(target_os = "solana")] @@ -915,11 +917,7 @@ mod tests { if let Ok(program_address) = Pubkey::create_program_address(&[&bytes1, &bytes2], &program_id) { - let is_on_curve = curve25519_dalek::edwards::CompressedEdwardsY::from_slice( - &program_address.to_bytes(), - ) - .decompress() - .is_some(); + let is_on_curve = bytes_are_curve_point(&program_address.to_bytes()); assert!(!is_on_curve); assert!(!addresses.contains(&program_address)); addresses.push(program_address); diff --git a/sdk/src/ed25519_instruction.rs b/sdk/src/ed25519_instruction.rs index 57f36e652920a0..6052429ba83fda 100644 --- a/sdk/src/ed25519_instruction.rs +++ b/sdk/src/ed25519_instruction.rs @@ -7,7 +7,7 @@ use { crate::{feature_set::FeatureSet, instruction::Instruction, precompiles::PrecompileError}, bytemuck::{bytes_of, Pod, Zeroable}, - ed25519_dalek::{ed25519::signature::Signature, Signer, Verifier}, + ed25519_dalek::{Signature, Signer, Verifier}, }; pub const PUBKEY_SERIALIZED_SIZE: usize = 32; @@ -29,9 +29,9 @@ pub struct Ed25519SignatureOffsets { message_instruction_index: u16, // index of instruction data to get message data } -pub fn new_ed25519_instruction(keypair: &ed25519_dalek::Keypair, message: &[u8]) -> Instruction { +pub fn new_ed25519_instruction(keypair: &ed25519_dalek::SigningKey, message: &[u8]) -> Instruction { let signature = keypair.sign(message).to_bytes(); - let pubkey = keypair.public.to_bytes(); + let pubkey = keypair.verifying_key().to_bytes(); assert_eq!(pubkey.len(), PUBKEY_SERIALIZED_SIZE); assert_eq!(signature.len(), SIGNATURE_SERIALIZED_SIZE); @@ -121,7 +121,7 @@ pub fn verify( )?; let signature = - Signature::from_bytes(signature).map_err(|_| PrecompileError::InvalidSignature)?; + Signature::from_slice(signature).map_err(|_| PrecompileError::InvalidSignature)?; // Parse out pubkey let pubkey = get_data_slice( @@ -132,7 +132,11 @@ pub fn verify( PUBKEY_SERIALIZED_SIZE, )?; - let publickey = ed25519_dalek::PublicKey::from_bytes(pubkey) + let mut pubkey_bytes: [u8; ed25519_dalek::PUBLIC_KEY_LENGTH] = + [0u8; ed25519_dalek::PUBLIC_KEY_LENGTH]; + pubkey_bytes.copy_from_slice(pubkey); + + let publickey = ed25519_dalek::VerifyingKey::from_bytes(&pubkey_bytes) .map_err(|_| PrecompileError::InvalidPublicKey)?; // Parse out message @@ -347,7 +351,7 @@ pub mod test { fn test_ed25519() { solana_logger::setup(); - let privkey = ed25519_dalek::Keypair::generate(&mut thread_rng()); + let privkey = ed25519_dalek::SigningKey::generate(&mut thread_rng()); let message_arr = b"hello"; let mut instruction = new_ed25519_instruction(&privkey, message_arr); let mint_keypair = Keypair::new(); diff --git a/sdk/src/signature.rs b/sdk/src/signature.rs index e3cc900e49efc1..279ddf4c81841c 100644 --- a/sdk/src/signature.rs +++ b/sdk/src/signature.rs @@ -46,7 +46,10 @@ impl Signature { pubkey_bytes: &[u8], message_bytes: &[u8], ) -> Result<(), ed25519_dalek::SignatureError> { - let publickey = ed25519_dalek::PublicKey::from_bytes(pubkey_bytes)?; + let mut publickey_bytes: [u8; ed25519_dalek::PUBLIC_KEY_LENGTH] = + [0u8; ed25519_dalek::PUBLIC_KEY_LENGTH]; + publickey_bytes.copy_from_slice(pubkey_bytes); + let publickey = ed25519_dalek::VerifyingKey::from_bytes(&publickey_bytes)?; let signature = self.0.as_slice().try_into()?; publickey.verify_strict(message_bytes, &signature) } diff --git a/sdk/src/signer/keypair.rs b/sdk/src/signer/keypair.rs index c1e0803a6bdad0..97f0644579c055 100644 --- a/sdk/src/signer/keypair.rs +++ b/sdk/src/signer/keypair.rs @@ -22,7 +22,7 @@ use { /// A vanilla Ed25519 key pair #[wasm_bindgen] #[derive(Debug)] -pub struct Keypair(ed25519_dalek::Keypair); +pub struct Keypair(ed25519_dalek::SigningKey); impl Keypair { /// Constructs a new, random `Keypair` using a caller-provided RNG @@ -30,7 +30,7 @@ impl Keypair { where R: CryptoRng + RngCore, { - Self(ed25519_dalek::Keypair::generate(csprng)) + Self(ed25519_dalek::SigningKey::generate(csprng)) } /// Constructs a new, random `Keypair` using `OsRng` @@ -41,12 +41,12 @@ impl Keypair { /// Recovers a `Keypair` from a byte array pub fn from_bytes(bytes: &[u8]) -> Result { - ed25519_dalek::Keypair::from_bytes(bytes).map(Self) + Ok(Self(ed25519_dalek::SigningKey::try_from(bytes)?)) } /// Returns this `Keypair` as a byte array pub fn to_bytes(&self) -> [u8; 64] { - self.0.to_bytes() + self.0.to_keypair_bytes() } /// Recovers a `Keypair` from a base58-encoded string @@ -61,7 +61,7 @@ impl Keypair { /// Gets this `Keypair`'s SecretKey pub fn secret(&self) -> &ed25519_dalek::SecretKey { - &self.0.secret + &self.0.to_bytes() } /// Allows Keypair cloning @@ -72,18 +72,14 @@ impl Keypair { /// Only use this in tests or when strictly required. Consider using [`std::sync::Arc`] /// instead. pub fn insecure_clone(&self) -> Self { - Self(ed25519_dalek::Keypair { - // This will never error since self is a valid keypair - secret: ed25519_dalek::SecretKey::from_bytes(self.0.secret.as_bytes()).unwrap(), - public: self.0.public, - }) + Self(ed25519_dalek::SigningKey::from_bytes(&self.0.to_bytes())) } } impl Signer for Keypair { #[inline] fn pubkey(&self) -> Pubkey { - Pubkey::from(self.0.public.to_bytes()) + Pubkey::from(self.0.verifying_key().to_bytes()) } fn try_pubkey(&self) -> Result { @@ -155,7 +151,7 @@ impl EncodableKeypair for Keypair { /// Reads a JSON-encoded `Keypair` from a `Reader` implementor pub fn read_keypair(reader: &mut R) -> Result> { let bytes: Vec = serde_json::from_reader(reader)?; - let dalek_keypair = ed25519_dalek::Keypair::from_bytes(&bytes) + let dalek_keypair = ed25519_dalek::SigningKey::try_from(bytes.as_slice()) .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?; Ok(Keypair(dalek_keypair)) } @@ -189,11 +185,10 @@ pub fn keypair_from_seed(seed: &[u8]) -> Result> if seed.len() < ed25519_dalek::SECRET_KEY_LENGTH { return Err("Seed is too short".into()); } - let secret = ed25519_dalek::SecretKey::from_bytes(&seed[..ed25519_dalek::SECRET_KEY_LENGTH]) - .map_err(|e| e.to_string())?; - let public = ed25519_dalek::PublicKey::from(&secret); - let dalek_keypair = ed25519_dalek::Keypair { secret, public }; - Ok(Keypair(dalek_keypair)) + let signing_key = + ed25519_dalek::SigningKey::try_from(&seed[..ed25519_dalek::SECRET_KEY_LENGTH]) + .map_err(|e| e.to_string())?; + Ok(Keypair(signing_key)) } /// Generates a Keypair using Bip32 Hierarchical Derivation if derivation-path is provided; @@ -213,11 +208,8 @@ fn bip32_derived_keypair( ) -> Result { let extended = ed25519_dalek_bip32::ExtendedSecretKey::from_seed(seed) .and_then(|extended| extended.derive(&derivation_path))?; - let extended_public_key = extended.public_key(); - Ok(Keypair(ed25519_dalek::Keypair { - secret: extended.secret_key, - public: extended_public_key, - })) + let signing_key = ed25519_dalek::SigningKey::from(extended.secret_key.to_bytes()); + Ok(Keypair(signing_key)) } pub fn generate_seed_from_seed_phrase_and_passphrase( From 255ffa7339cdd004253fc25635cb80838365bb34 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 15 Aug 2023 11:33:35 -0400 Subject: [PATCH 3/7] fixup versions --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3d01bb36cbffdc..1489b83daa823e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,7 +125,7 @@ license = "Apache-2.0" edition = "2021" [workspace.dependencies] -aes-gcm-siv = "0.11" +aes-gcm-siv = "0.11.1" ahash = "0.8.3" anyhow = "1.0.72" ark-bn254 = "0.4.0" @@ -171,7 +171,7 @@ criterion-stats = "0.3.0" crossbeam-channel = "0.5.8" csv = "1.2.2" ctrlc = "3.4.0" -curve25519-dalek = "4" +curve25519-dalek = "4.0.0" dashmap = "4.0.2" derivation-path = { version = "0.2.0", default-features = false } dialoguer = "0.10.4" @@ -180,7 +180,7 @@ dir-diff = "0.3.2" dirs-next = "2.0.0" dlopen2 = "0.5.0" eager = "0.1.0" -ed25519-dalek = "2" +ed25519-dalek = "2.0.0" ed25519-dalek-bip32 = "0.2.0" either = "1.9.0" enum-iterator = "1.4.1" @@ -226,7 +226,7 @@ jsonrpc-server-utils = "18.0.0" lazy_static = "1.4.0" libc = "0.2.147" libloading = "0.7.4" -libsecp256k1 = "0.6.0" +libsecp256k1 = "0.7.1" log = "0.4.20" lru = "0.7.7" lz4 = "1.24.0" @@ -263,7 +263,7 @@ qualifier_attr = "0.1.6" quinn = "0.10.2" quinn-proto = "0.10.2" quote = "1.0" -rand = "0.7.0" +rand = "0.8.5" rand_chacha = "0.2.2" rand_core = "0.6.4" raptorq = "1.7.0" @@ -405,7 +405,7 @@ wasm-bindgen = "0.2" winapi = "0.3.8" winreg = "0.10" x509-parser = "0.14.0" -zeroize = { version = "1", default-features = false } +zeroize = { version = "1.6.0", default-features = false } zstd = "0.11.2" [patch.crates-io] From cfbe40f4d1c3c49ecab3dbcd49467fc286389c57 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 15 Aug 2023 11:37:34 -0400 Subject: [PATCH 4/7] fixup sdk cargo toml --- sdk/Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index ed5eb7c0fcd72f..ae35b01d49d1f6 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -50,7 +50,7 @@ chrono = { workspace = true, features = ["alloc"], optional = true } curve25519-dalek = { workspace = true, optional = true } derivation-path = { workspace = true } digest = { workspace = true, optional = true } -ed25519-dalek = { workspace = true, optional = true } +ed25519-dalek = { workspace = true, optional = true, features = ["rand_core"]} ed25519-dalek-bip32 = { workspace = true, optional = true } generic-array = { workspace = true, features = ["serde", "more_lengths"], optional = true } hmac = { workspace = true } @@ -89,7 +89,6 @@ js-sys = { workspace = true } [dev-dependencies] anyhow = { workspace = true } curve25519-dalek = { workspace = true } -ed25519-dalek = { workspace = true, features = ["rand_core"] } hex = { workspace = true } static_assertions = { workspace = true } tiny-bip39 = { workspace = true } From 40d02e13d5a5af602478c650c507ef58c952112d Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 15 Aug 2023 11:38:05 -0400 Subject: [PATCH 5/7] bump deps for rand and libsecp256k1 --- Cargo.lock | 92 +++++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fdddd94f6157f..bdeec04e7aca61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -540,12 +540,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.13.1" @@ -3006,18 +3000,18 @@ dependencies = [ [[package]] name = "libsecp256k1" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" dependencies = [ "arrayref", - "base64 0.12.3", + "base64 0.13.1", "digest 0.9.0", "hmac-drbg", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.7.3", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -3025,9 +3019,9 @@ dependencies = [ [[package]] name = "libsecp256k1-core" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", @@ -3036,18 +3030,18 @@ dependencies = [ [[package]] name = "libsecp256k1-gen-ecmult" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ "libsecp256k1-core", ] [[package]] name = "libsecp256k1-gen-genmult" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" dependencies = [ "libsecp256k1-core", ] @@ -5282,7 +5276,7 @@ version = "1.17.0" dependencies = [ "clap 2.33.3", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "solana-account-decoder", "solana-accounts-db", @@ -5344,7 +5338,7 @@ dependencies = [ "ouroboros", "percentage", "qualifier_attr", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "regex", @@ -5422,7 +5416,7 @@ dependencies = [ "clap 3.2.23", "crossbeam-channel", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "solana-client", "solana-core", @@ -5501,7 +5495,7 @@ dependencies = [ "clap 2.33.3", "crossbeam-channel", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "serde_json", "serde_yaml 0.9.25", @@ -5542,7 +5536,7 @@ dependencies = [ "bv", "fnv", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "rustc_version 0.4.0", "serde", @@ -5561,7 +5555,7 @@ dependencies = [ "libsecp256k1", "log", "memoffset 0.9.0", - "rand 0.7.3", + "rand 0.8.5", "solana-measure", "solana-program-runtime", "solana-sdk", @@ -5591,7 +5585,7 @@ dependencies = [ "memmap2", "modular-bitfield", "num_enum 0.6.1", - "rand 0.7.3", + "rand 0.8.5", "rayon", "solana-logger", "solana-measure", @@ -5788,7 +5782,7 @@ dependencies = [ "indicatif", "log", "quinn", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "solana-connection-cache", @@ -5868,7 +5862,7 @@ dependencies = [ "indexmap 2.0.0", "indicatif", "log", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "rcgen", @@ -5904,7 +5898,7 @@ dependencies = [ "min-max-heap", "num_enum 0.6.1", "quinn", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "raptorq", "rayon", @@ -5994,7 +5988,7 @@ dependencies = [ "crossbeam-channel", "itertools", "log", - "rand 0.7.3", + "rand 0.8.5", "serde", "solana-bench-tps", "solana-client", @@ -6033,7 +6027,7 @@ version = "1.17.0" dependencies = [ "assert_matches", "ed25519-dalek 2.0.0", - "rand 0.7.3", + "rand 0.8.5", "solana-program-test", "solana-sdk", ] @@ -6048,7 +6042,7 @@ dependencies = [ "lazy_static", "log", "matches", - "rand 0.7.3", + "rand 0.8.5", "rayon", "serde", "solana-logger", @@ -6211,7 +6205,7 @@ dependencies = [ "matches", "num-traits", "num_cpus", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "rustc_version 0.4.0", @@ -6319,7 +6313,7 @@ dependencies = [ "num_cpus", "num_enum 0.6.1", "prost 0.11.9", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "reed-solomon-erasure", @@ -6417,7 +6411,7 @@ version = "1.17.0" dependencies = [ "bincode", "log", - "rand 0.7.3", + "rand 0.8.5", "solana-measure", "solana-program-runtime", "solana-sdk", @@ -6434,7 +6428,7 @@ dependencies = [ "gag", "itertools", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "serial_test", "solana-accounts-db", @@ -6526,7 +6520,7 @@ dependencies = [ "gethostname", "lazy_static", "log", - "rand 0.7.3", + "rand 0.8.5", "reqwest", "serial_test", "solana-sdk", @@ -6538,7 +6532,7 @@ name = "solana-net-shaper" version = "1.17.0" dependencies = [ "clap 3.2.23", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_json", "solana-logger", @@ -6553,7 +6547,7 @@ dependencies = [ "crossbeam-channel", "log", "nix", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_derive", "socket2 0.5.3", @@ -6590,7 +6584,7 @@ dependencies = [ "log", "matches", "nix", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "serde", @@ -6611,7 +6605,7 @@ dependencies = [ "crossbeam-channel", "log", "matches", - "rand 0.7.3", + "rand 0.8.5", "solana-entry", "solana-ledger", "solana-logger", @@ -6629,7 +6623,7 @@ version = "1.17.0" dependencies = [ "clap 3.2.23", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "solana-entry", "solana-logger", @@ -6675,7 +6669,7 @@ dependencies = [ "num-derive", "num-traits", "parking_lot 0.12.1", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rustc_version 0.4.0", "rustversion", @@ -6711,7 +6705,7 @@ dependencies = [ "num-derive", "num-traits", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rustc_version 0.4.0", "serde", "solana-frozen-abi", @@ -7017,7 +7011,7 @@ dependencies = [ "once_cell", "ouroboros", "percentage", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "regex", @@ -7092,7 +7086,7 @@ dependencies = [ "num_enum 0.6.1", "pbkdf2 0.11.0", "qstring", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rustc_version 0.4.0", "rustversion", @@ -7253,7 +7247,7 @@ dependencies = [ "pkcs8 0.8.0", "quinn", "quinn-proto", - "rand 0.7.3", + "rand 0.8.5", "rcgen", "rustls 0.21.6", "solana-logger", @@ -7365,7 +7359,7 @@ dependencies = [ "indexmap 2.0.0", "indicatif", "log", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "solana-connection-cache", @@ -7386,7 +7380,7 @@ dependencies = [ "bincode", "clap 2.33.3", "log", - "rand 0.7.3", + "rand 0.8.5", "rayon", "solana-clap-utils", "solana-cli", @@ -7443,7 +7437,7 @@ dependencies = [ "lru", "matches", "quinn", - "rand 0.7.3", + "rand 0.8.5", "rand_chacha 0.2.2", "rayon", "rcgen", @@ -7510,7 +7504,7 @@ dependencies = [ "libloading", "log", "num_cpus", - "rand 0.7.3", + "rand 0.8.5", "rayon", "serde", "serde_json", @@ -7669,7 +7663,7 @@ dependencies = [ "merlin", "num-derive", "num-traits", - "rand 0.7.3", + "rand 0.8.5", "serde", "serde_json", "sha3 0.9.1", From 97f5854b31c3fdae15d7d7226d00ea0ecc6ffff7 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 15 Aug 2023 11:38:55 -0400 Subject: [PATCH 6/7] fixup keypair --- sdk/src/signer/keypair.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/src/signer/keypair.rs b/sdk/src/signer/keypair.rs index 97f0644579c055..b66abde38944fa 100644 --- a/sdk/src/signer/keypair.rs +++ b/sdk/src/signer/keypair.rs @@ -7,7 +7,6 @@ use { signature::Signature, signer::{EncodableKey, EncodableKeypair, SeedDerivable, Signer, SignerError}, }, - ed25519_dalek::Signer as DalekSigner, ed25519_dalek_bip32::Error as Bip32Error, hmac::Hmac, rand::{rngs::OsRng, CryptoRng, RngCore}, @@ -60,8 +59,8 @@ impl Keypair { } /// Gets this `Keypair`'s SecretKey - pub fn secret(&self) -> &ed25519_dalek::SecretKey { - &self.0.to_bytes() + pub fn secret(&self) -> ed25519_dalek::SecretKey { + self.0.to_bytes() } /// Allows Keypair cloning @@ -87,6 +86,7 @@ impl Signer for Keypair { } fn sign_message(&self, message: &[u8]) -> Signature { + use ed25519_dalek::Signer as _; Signature::from(self.0.sign(message).to_bytes()) } From 753ed2bae3c615613ecf53c51449bef9c3e8a8b0 Mon Sep 17 00:00:00 2001 From: brooks Date: Tue, 15 Aug 2023 11:39:09 -0400 Subject: [PATCH 7/7] fixups for rand bump --- sdk/src/ed25519_instruction.rs | 2 +- sdk/src/secp256k1_instruction.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/src/ed25519_instruction.rs b/sdk/src/ed25519_instruction.rs index 6052429ba83fda..914287fc69e762 100644 --- a/sdk/src/ed25519_instruction.rs +++ b/sdk/src/ed25519_instruction.rs @@ -367,7 +367,7 @@ pub mod test { assert!(tx.verify_precompiles(&feature_set).is_ok()); let index = loop { - let index = thread_rng().gen_range(0, instruction.data.len()); + let index = thread_rng().gen_range(0..instruction.data.len()); // byte 1 is not used, so this would not cause the verify to fail if index != 1 { break index; diff --git a/sdk/src/secp256k1_instruction.rs b/sdk/src/secp256k1_instruction.rs index 42fea6e9719e70..2f4738eb404bc1 100644 --- a/sdk/src/secp256k1_instruction.rs +++ b/sdk/src/secp256k1_instruction.rs @@ -1271,7 +1271,7 @@ pub mod test { assert!(tx.verify_precompiles(&feature_set).is_ok()); - let index = thread_rng().gen_range(0, secp_instruction.data.len()); + let index = thread_rng().gen_range(0..secp_instruction.data.len()); secp_instruction.data[index] = secp_instruction.data[index].wrapping_add(12); let tx = Transaction::new_signed_with_payer( &[secp_instruction],