From 655ba404337804b8856b0015718e8d3b6e1327c3 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Sun, 9 Mar 2025 15:12:21 -0700 Subject: [PATCH] `ff` now uses `CryptoRng` --- Cargo.lock | 4 ++-- Cargo.toml | 3 ++- elliptic-curve/src/dev.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 972a00a2..a99889ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,7 +248,7 @@ dependencies = [ [[package]] name = "ff" version = "0.13.0" -source = "git+https://github.com/zkcrypto/ff.git?branch=release-0.14.0#1bb634588722b1b7ce986d239c263e332bedda7f" +source = "git+https://github.com/baloo/ff.git?branch=baloo%2Fcrypto-rng#31c707d4e9bcd2bc49e465a0f08913a573a8884d" dependencies = [ "bitvec", "ff_derive", @@ -259,7 +259,7 @@ dependencies = [ [[package]] name = "ff_derive" version = "0.13.0" -source = "git+https://github.com/zkcrypto/ff.git?branch=release-0.14.0#1bb634588722b1b7ce986d239c263e332bedda7f" +source = "git+https://github.com/baloo/ff.git?branch=baloo%2Fcrypto-rng#31c707d4e9bcd2bc49e465a0f08913a573a8884d" dependencies = [ "addchain", "cfg-if", diff --git a/Cargo.toml b/Cargo.toml index 21a73466..01992392 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,8 @@ crypto-bigint = { git = "https://github.com/RustCrypto/crypto-bigint.git" } # https://github.com/zkcrypto/ff/pull/122 # https://github.com/zkcrypto/ff/pull/126 # https://github.com/zkcrypto/ff/pull/127 -ff = { git = "https://github.com/zkcrypto/ff.git", branch = "release-0.14.0" } +# https://github.com/zkcrypto/ff/pull/132 +ff = { git = "https://github.com/baloo/ff.git", branch = "baloo/crypto-rng" } # https://github.com/zkcrypto/group/pull/56 group = { git = "https://github.com/pinkforest/group.git", branch = "bump-rand-0.9" } diff --git a/elliptic-curve/src/dev.rs b/elliptic-curve/src/dev.rs index 4f1c5881..cca8021d 100644 --- a/elliptic-curve/src/dev.rs +++ b/elliptic-curve/src/dev.rs @@ -10,7 +10,7 @@ use crate::{ error::{Error, Result}, ops::{Invert, LinearCombination, MulByGenerator, Reduce, ShrAssign}, point::AffineCoordinates, - rand_core::{RngCore, TryRngCore}, + rand_core::{RngCore, TryCryptoRng}, scalar::{FromUintUnchecked, IsHigh}, sec1::{CompressedPoint, FromEncodedPoint, ToEncodedPoint}, subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}, @@ -99,7 +99,7 @@ impl Field for Scalar { const ZERO: Self = Self(ScalarPrimitive::ZERO); const ONE: Self = Self(ScalarPrimitive::ONE); - fn try_from_rng(rng: &mut R) -> core::result::Result { + fn try_from_rng(rng: &mut R) -> core::result::Result { let mut bytes = FieldBytes::default(); loop {