diff --git a/ethereum-consensus/Cargo.toml b/ethereum-consensus/Cargo.toml index 33880d6ab..317ed713d 100644 --- a/ethereum-consensus/Cargo.toml +++ b/ethereum-consensus/Cargo.toml @@ -17,7 +17,6 @@ ec = [ "rand_core", "rayon", "hkdf", - "ruint", "uuid", "scrypt", "serde", @@ -63,7 +62,7 @@ bip39 = { version = "2.0.0", optional = true } rand_core = { version = "0.6", optional = true, features = ["std"] } rayon = { version = "1.8.0", optional = true } hkdf = { version = "0.12.3", optional = true } -ruint = { version = "1.10.1", optional = true } +# ruint = { version = "1.10.1", optional = true } uuid = { version = "1.4.1", optional = true, features = [ "v4", "fast-rng", diff --git a/ethereum-consensus/src/deneb/polynomial_commitments.rs b/ethereum-consensus/src/deneb/polynomial_commitments.rs index c5d77f28e..6d79e58ba 100644 --- a/ethereum-consensus/src/deneb/polynomial_commitments.rs +++ b/ethereum-consensus/src/deneb/polynomial_commitments.rs @@ -1,6 +1,7 @@ use crate::{primitives, ssz::prelude::*}; use alloy_primitives::{uint, U256}; -use c_kzg::{Bytes32, Bytes48, Error, KzgSettings}; +pub use c_kzg::KzgSettings; +use c_kzg::{Bytes32, Bytes48, Error}; use std::ops::Deref; pub const BLS_MODULUS: U256 = @@ -20,8 +21,8 @@ pub type Polynomial = Vec; // Should this polynomial type be an pub struct Blob(ByteVector); pub struct ProofAndEvaluation { - proof: KzgProof, - evaluation: Bytes32, + pub proof: KzgProof, + pub evaluation: Bytes32, } #[derive(SimpleSerialize, Default, Debug, Clone, PartialEq, Eq)] @@ -40,7 +41,10 @@ impl Deref for KzgCommitment { #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct KzgProof(ByteVector); -fn blob_to_kzg_commitment(blob: Blob, kzg_settings: &KzgSettings) -> Result { +pub fn blob_to_kzg_commitment( + blob: Blob, + kzg_settings: &KzgSettings, +) -> Result { let inner = &blob.0; let blob = c_kzg::Blob::from_bytes(inner.as_ref()).unwrap(); @@ -50,7 +54,7 @@ fn blob_to_kzg_commitment(blob: Blob, kzg_settings: &KzgSettings) -> Result