From 032c465d49013eab39c6c5a0520d23274dc7732a Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 14 Feb 2025 15:52:07 -0800 Subject: [PATCH] ecdsa: bump rand_core from 0.6.4 to 0.9.0 --- .github/workflows/ecdsa.yml | 4 +- Cargo.lock | 130 ++-------- Cargo.toml | 21 +- ecdsa/Cargo.lock | 490 ++++++++++++++++++++++++++++++++++++ ecdsa/Cargo.toml | 26 +- ecdsa/README.md | 9 +- ecdsa/src/recovery.rs | 16 +- ecdsa/src/signing.rs | 28 +-- 8 files changed, 580 insertions(+), 144 deletions(-) create mode 100644 ecdsa/Cargo.lock diff --git a/.github/workflows/ecdsa.yml b/.github/workflows/ecdsa.yml index 7c94110a..3c4544f8 100644 --- a/.github/workflows/ecdsa.yml +++ b/.github/workflows/ecdsa.yml @@ -26,7 +26,7 @@ jobs: - thumbv7em-none-eabi - wasm32-unknown-unknown rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 @@ -42,7 +42,7 @@ jobs: strategy: matrix: rust: - - 1.81.0 # MSRV + - 1.85.0 # MSRV - stable steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index b50281f7..fd34664b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base64ct" version = "1.6.0" @@ -265,19 +259,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.6.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e43027691f1c055da3da4f7d96af09fcec420d435d5616e51f29afd0811c56a7" -dependencies = [ - "hybrid-array", - "num-traits", - "rand_core", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.2.0-rc.1" @@ -338,21 +319,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ecdsa" -version = "0.17.0-pre.9" -dependencies = [ - "der", - "digest", - "elliptic-curve", - "hex-literal", - "rfc6979", - "serdect", - "sha2", - "signature", - "spki", -] - [[package]] name = "ed25519" version = "2.3.0-pre.0" @@ -386,28 +352,6 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" -[[package]] -name = "elliptic-curve" -version = "0.14.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc43715037532dc2d061e5c97e81b684c28993d52a4fa4eb7d2ce2826d78f2f2" -dependencies = [ - "base16ct", - "crypto-bigint", - "digest", - "ff", - "group", - "hex-literal", - "hybrid-array", - "pem-rfc7468", - "pkcs8", - "rand_core", - "sec1", - "serdect", - "subtle", - "zeroize", -] - [[package]] name = "env_logger" version = "0.8.4" @@ -434,16 +378,6 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "rand_core", - "subtle", -] - [[package]] name = "fnv" version = "1.0.7" @@ -461,17 +395,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - [[package]] name = "half" version = "2.4.0" @@ -586,9 +509,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.150" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" @@ -708,9 +631,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem-rfc7468" -version = "1.0.0-rc.1" +version = "1.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c1cde4770761bf6bd336f947b9ac1fe700b0a4ec5867cf66cf08597fe89e8c" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" dependencies = [ "base64ct", ] @@ -972,21 +895,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "sec1" -version = "0.8.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce9453a41af5251f8439173d21b0ed2ae5d4a7c411abb76661806a44811a9d2c" -dependencies = [ - "base16ct", - "der", - "hybrid-array", - "pkcs8", - "serdect", - "subtle", - "zeroize", -] - [[package]] name = "serde" version = "1.0.215" @@ -1028,16 +936,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serdect" -version = "0.3.0-rc.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a504c8ee181e3e594d84052f983d60afe023f4d94d050900be18062bbbf7b58" -dependencies = [ - "base16ct", - "serde", -] - [[package]] name = "sha1" version = "0.11.0-pre.4" @@ -1420,3 +1318,23 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[patch.unused]] +name = "crypto-bigint" +version = "0.7.0-pre" +source = "git+https://github.com/RustCrypto/crypto-bigint.git#534c2940b1f0aa9ec8ada964ce654cc0e6e1e7bb" + +[[patch.unused]] +name = "elliptic-curve" +version = "0.14.0-rc.1" +source = "git+https://github.com/baloo/traits.git?branch=baloo/elliptic-curve/bump-rand-core#1113fea701998891b43598dac18e752718fc87e2" + +[[patch.unused]] +name = "ff" +version = "0.13.0" +source = "git+https://github.com/pinkforest/ff.git?branch=bump-rand-core#c734f7f21d6639bc6494dde538209d0770207c49" + +[[patch.unused]] +name = "group" +version = "0.13.0" +source = "git+https://github.com/pinkforest/group.git?branch=bump-rand-0.9#06ac6fb11ced26fbf980ee65e74fced4da66ec3e" diff --git a/Cargo.toml b/Cargo.toml index 50f6fce4..a0c11ff2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ resolver = "2" members = [ "dsa", - "ecdsa", + #"ecdsa", "ed448", "ed25519", "lms", @@ -10,7 +10,10 @@ members = [ "rfc6979", "slh-dsa" ] -exclude = ["ml-dsa"] # using rand_core v0.9 +exclude = [ + "ecdsa", + "ml-dsa", +] # using rand_core v0.9 [profile.dev] opt-level = 2 @@ -19,10 +22,22 @@ opt-level = 2 # A global patch crates-io block is used to avoid duplicate dependencies # when pulling a member crate through git dsa = { path = "./dsa" } -ecdsa = { path = "./ecdsa" } +# ecdsa = { path = "./ecdsa" } ed448-signature = { path = "./ed448" } ed25519 = { path = "./ed25519" } lms-signature = { path = "./lms" } #ml-dsa = { path = "./ml-dsa" } rfc6979 = { path = "./rfc6979" } slh-dsa = { path = "./slh-dsa" } + +# https://github.com/RustCrypto/traits/pull/1751 +elliptic-curve = { git = "https://github.com/baloo/traits.git", branch = "baloo/elliptic-curve/bump-rand-core" } + +# https://github.com/RustCrypto/crypto-bigint/pull/762 +# https://github.com/RustCrypto/crypto-bigint/pull/765 +crypto-bigint = { git = "https://github.com/RustCrypto/crypto-bigint.git" } + +# https://github.com/zkcrypto/ff/pull/122 +ff = { git = "https://github.com/pinkforest/ff.git", branch = "bump-rand-core" } +# https://github.com/zkcrypto/group/pull/56 +group = { git = "https://github.com/pinkforest/group.git", branch = "bump-rand-0.9" } diff --git a/ecdsa/Cargo.lock b/ecdsa/Cargo.lock new file mode 100644 index 00000000..235cfd5b --- /dev/null +++ b/ecdsa/Cargo.lock @@ -0,0 +1,490 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a229bfd78e4827c91b9b95784f69492c1b77c1ab75a45a8a037b139215086f94" +dependencies = [ + "hybrid-array 0.3.0", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "const-oid" +version = "0.10.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ff6be19477a1bd5441f382916a89bc2a0b2c35db6d41e0f6e8538bf6d6463f" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-bigint" +version = "0.7.0-pre.0" +source = "git+https://github.com/RustCrypto/crypto-bigint.git#3234fa1c28f5250022b5e97a5149555e1bcf66cd" +dependencies = [ + "hybrid-array 0.2.3", + "num-traits", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170d71b5b14dec99db7739f6fc7d6ec2db80b78c3acb77db48392ccc3d8a9ea0" +dependencies = [ + "hybrid-array 0.3.0", +] + +[[package]] +name = "der" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82db698b33305f0134faf590b9d1259dc171b5481ac41d5c8146c3b3ee7d4319" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "digest" +version = "0.11.0-pre.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c478574b20020306f98d61c8ca3322d762e1ff08117422ac6106438605ea516" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.17.0-pre.9" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "hex-literal 0.4.1", + "rfc6979", + "serdect", + "sha2", + "signature", + "spki", +] + +[[package]] +name = "elliptic-curve" +version = "0.14.0-rc.1" +source = "git+https://github.com/RustCrypto/traits.git#fbb43215e51ca212dafed6f7b0a713fe6e37171c" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "group", + "hex-literal 1.0.0", + "hybrid-array 0.3.0", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "git+https://github.com/pinkforest/ff.git?branch=bump-rand-core#c734f7f21d6639bc6494dde538209d0770207c49" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi", + "windows-targets", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "git+https://github.com/pinkforest/group.git?branch=bump-rand-0.9#06ac6fb11ced26fbf980ee65e74fced4da66ec3e" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hex-literal" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcaaec4551594c969335c98c903c1397853d4198408ea609190f420500f6be71" + +[[package]] +name = "hmac" +version = "0.13.0-pre.4" +source = "git+https://github.com/baloo/MACs.git?branch=baloo/edition-2024#cea718c1fcec0504c7ba030a2ad465d7b1881047" +dependencies = [ + "digest", +] + +[[package]] +name = "hybrid-array" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2d35805454dc9f8662a98d6d61886ffe26bd465f5960e0e55345c70d5c0d2a9" +dependencies = [ + "typenum", +] + +[[package]] +name = "hybrid-array" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dab50e193aebe510fe0e40230145820e02f48dae0cf339ea4204e6e708ff7bd" +dependencies = [ + "typenum", + "zeroize", +] + +[[package]] +name = "libc" +version = "0.2.169" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dfbfa5c6f0906884269722c5478e72fd4d6c0e24fe600332c6d62359567ce1" +dependencies = [ + "base64ct", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22636de7c995e997ed3d8d2949b7414d4faba3efa7312a6c0e75d875a14bdd4" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "proc-macro2" +version = "1.0.93" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" +dependencies = [ + "getrandom", + "zerocopy", +] + +[[package]] +name = "rfc6979" +version = "0.5.0-pre.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "871ee76a3eee98b0f805e5d1caf26929f4565073c580c053a55f886fc15dea49" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "sec1" +version = "0.8.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a017a4aa8f0bd51e9d0184d98042dfe9285218fec098493f47d9a8aa0f1a3f27" +dependencies = [ + "base16ct", + "der", + "hybrid-array 0.3.0", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "serde" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.218" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serdect" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f42f67da2385b51a5f9652db9c93d78aeaf7610bf5ec366080b6de810604af53" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha2" +version = "0.11.0-pre.4" +source = "git+https://github.com/RustCrypto/hashes.git?branch=edition_upgrade#cfe82a0f1a9a6c89c5b6d8309f2603c644dc97ea" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.3.0-pre.6" +source = "git+https://github.com/RustCrypto/traits.git#fbb43215e51ca212dafed6f7b0a713fe6e37171c" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "spki" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37ac66481418fd7afdc584adcf3be9aa572cf6c2858814494dc2a01755f050bc" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags", +] + +[[package]] +name = "zerocopy" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/ecdsa/Cargo.toml b/ecdsa/Cargo.toml index 25c2849b..5df5a6b9 100644 --- a/ecdsa/Cargo.toml +++ b/ecdsa/Cargo.toml @@ -18,13 +18,13 @@ rust-version = "1.81" [dependencies] elliptic-curve = { version = "0.14.0-rc.1", default-features = false, features = ["digest", "sec1"] } -signature = { version = "=2.3.0-pre.4", default-features = false, features = ["rand_core"] } +signature = { version = "=2.3.0-pre.6", default-features = false, features = ["rand_core"] } # optional dependencies der = { version = "0.8.0-rc.1", optional = true } -digest = { version = "=0.11.0-pre.9", optional = true, default-features = false, features = ["oid"] } +digest = { version = "=0.11.0-pre.10", optional = true, default-features = false, features = ["oid"] } rfc6979 = { version = "=0.5.0-pre.4", optional = true } -serdect = { version = "0.3.0-rc.0", optional = true, default-features = false, features = ["alloc"] } +serdect = { version = "0.3", optional = true, default-features = false, features = ["alloc"] } sha2 = { version = "=0.11.0-pre.4", optional = true, default-features = false, features = ["oid"] } spki = { version = "0.8.0-rc.0", optional = true, default-features = false } @@ -51,3 +51,23 @@ verifying = ["arithmetic", "digest", "hazmat"] [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"] + +[patch.crates-io] +# https://github.com/RustCrypto/traits/pull/1751 +elliptic-curve = { git = "https://github.com/RustCrypto/traits.git" } +signature = { git = "https://github.com/RustCrypto/traits.git" } + +# https://github.com/RustCrypto/MACs/pull/178 +hmac = { git = "https://github.com/baloo/MACs.git", branch = "baloo/edition-2024" } + +# https://github.com/RustCrypto/crypto-bigint/pull/762 +# https://github.com/RustCrypto/crypto-bigint/pull/765 +crypto-bigint = { git = "https://github.com/RustCrypto/crypto-bigint.git" } + +# https://github.com/zkcrypto/ff/pull/122 +ff = { git = "https://github.com/pinkforest/ff.git", branch = "bump-rand-core" } +# https://github.com/zkcrypto/group/pull/56 +group = { git = "https://github.com/pinkforest/group.git", branch = "bump-rand-0.9" } + +# https://github.com/RustCrypto/hashes/pull/652 +sha2 = { git = "https://github.com/RustCrypto/hashes.git", branch = "edition_upgrade" } diff --git a/ecdsa/README.md b/ecdsa/README.md index 723944de..3ff4c519 100644 --- a/ecdsa/README.md +++ b/ecdsa/README.md @@ -39,13 +39,6 @@ properly assessed for a specific elliptic curve. USE AT YOUR OWN RISK! -## Minimum Supported Rust Version - -This crate requires **Rust 1.73** at a minimum. - -We may change the MSRV in the future, but it will be accompanied by a minor -version bump. - ## License All crates licensed under either of @@ -70,7 +63,7 @@ dual licensed as above, without any additional terms or conditions. [build-image]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml/badge.svg [build-link]: https://github.com/RustCrypto/signatures/actions/workflows/ecdsa.yml [license-image]: https://img.shields.io/badge/license-Apache2.0/MIT-blue.svg -[rustc-image]: https://img.shields.io/badge/rustc-1.73+-blue.svg +[rustc-image]: https://img.shields.io/badge/rustc-1.85+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260048-signatures diff --git a/ecdsa/src/recovery.rs b/ecdsa/src/recovery.rs index 88ba735f..722b094e 100644 --- a/ecdsa/src/recovery.rs +++ b/ecdsa/src/recovery.rs @@ -9,7 +9,7 @@ use { signature::{ digest::FixedOutput, hazmat::{PrehashSigner, RandomizedPrehashSigner}, - rand_core::CryptoRngCore, + rand_core::TryCryptoRng, DigestSigner, RandomizedDigestSigner, Signer, }, }; @@ -185,14 +185,14 @@ where { /// Sign the given message prehash, using the given rng for the RFC6979 Section 3.6 "additional /// data", returning a signature and recovery ID. - pub fn sign_prehash_recoverable_with_rng( + pub fn sign_prehash_recoverable_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, prehash: &[u8], ) -> Result<(Signature, RecoveryId)> { let z = bits2field::(prehash)?; let mut ad = FieldBytes::::default(); - rng.fill_bytes(&mut ad); + rng.try_fill_bytes(&mut ad).map_err(|_| Error::new())?; sign_prehashed_rfc6979::(self.as_nonzero_scalar(), &z, &ad) } @@ -237,9 +237,9 @@ where Scalar: Invert>>, SignatureSize: ArraySize, { - fn sign_prehash_with_rng( + fn sign_prehash_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, prehash: &[u8], ) -> Result<(Signature, RecoveryId)> { self.sign_prehash_recoverable_with_rng(rng, prehash) @@ -254,9 +254,9 @@ where Scalar: Invert>>, SignatureSize: ArraySize, { - fn try_sign_digest_with_rng( + fn try_sign_digest_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg_digest: D, ) -> Result<(Signature, RecoveryId)> { self.sign_prehash_with_rng(rng, &msg_digest.finalize_fixed()) diff --git a/ecdsa/src/signing.rs b/ecdsa/src/signing.rs index 513580de..f582c494 100644 --- a/ecdsa/src/signing.rs +++ b/ecdsa/src/signing.rs @@ -17,7 +17,7 @@ use elliptic_curve::{ }; use signature::{ hazmat::{PrehashSigner, RandomizedPrehashSigner}, - rand_core::CryptoRngCore, + rand_core::{CryptoRng, TryCryptoRng}, DigestSigner, RandomizedDigestSigner, RandomizedSigner, Signer, }; @@ -83,7 +83,7 @@ where SignatureSize: ArraySize, { /// Generate a cryptographically random [`SigningKey`]. - pub fn random(rng: &mut impl CryptoRngCore) -> Self { + pub fn random(rng: &mut R) -> Self { NonZeroScalar::::random(rng).into() } @@ -182,9 +182,9 @@ where Scalar: Invert>>, SignatureSize: ArraySize, { - fn try_sign_digest_with_rng( + fn try_sign_digest_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg_digest: D, ) -> Result> { self.sign_prehash_with_rng(rng, &msg_digest.finalize_fixed()) @@ -197,14 +197,14 @@ where Scalar: Invert>>, SignatureSize: ArraySize, { - fn sign_prehash_with_rng( + fn sign_prehash_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, prehash: &[u8], ) -> Result> { let z = bits2field::(prehash)?; let mut ad = FieldBytes::::default(); - rng.fill_bytes(&mut ad); + rng.try_fill_bytes(&mut ad).map_err(|_| Error::new())?; Ok(sign_prehashed_rfc6979::(&self.secret_scalar, &z, &ad)?.0) } } @@ -216,7 +216,7 @@ where Scalar: Invert>>, SignatureSize: ArraySize, { - fn try_sign_with_rng(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> Result> { + fn try_sign_with_rng(&self, rng: &mut R, msg: &[u8]) -> Result> { self.try_sign_digest_with_rng(rng, C::Digest::new_with_prefix(msg)) } } @@ -285,9 +285,9 @@ where der::MaxSize: ArraySize, as Add>::Output: Add + ArraySize, { - fn try_sign_digest_with_rng( + fn try_sign_digest_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg_digest: D, ) -> Result> { RandomizedDigestSigner::>::try_sign_digest_with_rng(self, rng, msg_digest) @@ -304,9 +304,9 @@ where der::MaxSize: ArraySize, as Add>::Output: Add + ArraySize, { - fn sign_prehash_with_rng( + fn sign_prehash_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, prehash: &[u8], ) -> Result> { RandomizedPrehashSigner::>::sign_prehash_with_rng(self, rng, prehash) @@ -323,9 +323,9 @@ where der::MaxSize: ArraySize, as Add>::Output: Add + ArraySize, { - fn try_sign_with_rng( + fn try_sign_with_rng( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg: &[u8], ) -> Result> { RandomizedSigner::>::try_sign_with_rng(self, rng, msg).map(Into::into)