diff --git a/rust-toolchain b/rust-toolchain index cad2ef94..ef8b0923 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.72.0 \ No newline at end of file +1.77.0 \ No newline at end of file diff --git a/taiga_halo2/src/circuit/vp_circuit.rs b/taiga_halo2/src/circuit/vp_circuit.rs index 01c62494..3449d9e6 100644 --- a/taiga_halo2/src/circuit/vp_circuit.rs +++ b/taiga_halo2/src/circuit/vp_circuit.rs @@ -31,7 +31,7 @@ use crate::{ proof::Proof, resource::{RandomSeed, Resource, ResourceCommitment}, resource_encryption::{ResourceCiphertext, SecretKey}, - utils::{mod_r_p, read_base_field}, + utils::mod_r_p, vp_vk::ValidityPredicateVerifyingKey, }; use dyn_clone::{clone_trait_object, DynClone}; @@ -206,6 +206,7 @@ impl BorshDeserialize for VPVerifyingInfo { fn deserialize_reader(reader: &mut R) -> std::io::Result { // Read vk use crate::circuit::vp_examples::TrivialValidityPredicateCircuit; + use crate::utils::read_base_field; let params = SETUP_PARAMS_MAP.get(&VP_CIRCUIT_PARAMS_SIZE).unwrap(); let vk = VerifyingKey::read::<_, TrivialValidityPredicateCircuit>(reader, params)?; // Read proof diff --git a/taiga_halo2/src/circuit/vp_examples.rs b/taiga_halo2/src/circuit/vp_examples.rs index 6adb3daf..adaa99ef 100644 --- a/taiga_halo2/src/circuit/vp_examples.rs +++ b/taiga_halo2/src/circuit/vp_examples.rs @@ -9,7 +9,6 @@ use crate::{ error::TransactionError, proof::Proof, resource::{RandomSeed, Resource}, - utils::read_base_field, vp_commitment::ValidityPredicateCommitment, vp_vk::ValidityPredicateVerifyingKey, }; @@ -134,7 +133,7 @@ impl BorshSerialize for TrivialValidityPredicateCircuit { #[cfg(feature = "borsh")] impl BorshDeserialize for TrivialValidityPredicateCircuit { fn deserialize_reader(reader: &mut R) -> std::io::Result { - let owned_resource_id = read_base_field(reader)?; + let owned_resource_id = crate::utils::read_base_field(reader)?; let input_resources: Vec<_> = (0..NUM_RESOURCE) .map(|_| Resource::deserialize_reader(reader)) .collect::>()?; diff --git a/taiga_halo2/src/merkle_tree.rs b/taiga_halo2/src/merkle_tree.rs index 4336cbed..9674a5ec 100644 --- a/taiga_halo2/src/merkle_tree.rs +++ b/taiga_halo2/src/merkle_tree.rs @@ -2,7 +2,7 @@ use std::hash::{Hash, Hasher}; use crate::merkle_tree::LR::{L, R}; use crate::resource::ResourceCommitment; -use crate::utils::{poseidon_hash, read_base_field}; +use crate::utils::poseidon_hash; use crate::{constant::TAIGA_COMMITMENT_TREE_DEPTH, resource::Resource}; use ff::PrimeField; use halo2_proofs::arithmetic::Field; @@ -68,7 +68,7 @@ impl BorshSerialize for Anchor { #[cfg(feature = "borsh")] impl BorshDeserialize for Anchor { fn deserialize_reader(reader: &mut R) -> std::io::Result { - let value = read_base_field(reader)?; + let value = crate::utils::read_base_field(reader)?; Ok(Self(value)) } } @@ -204,7 +204,7 @@ impl BorshSerialize for Node { #[cfg(feature = "borsh")] impl BorshDeserialize for Node { fn deserialize_reader(reader: &mut R) -> std::io::Result { - let value = read_base_field(reader)?; + let value = crate::utils::read_base_field(reader)?; Ok(Self(value)) } } diff --git a/taiga_halo2/src/nullifier.rs b/taiga_halo2/src/nullifier.rs index d591ee8b..a8ff1c8a 100644 --- a/taiga_halo2/src/nullifier.rs +++ b/taiga_halo2/src/nullifier.rs @@ -2,7 +2,7 @@ use std::hash::Hash; use crate::{ resource::ResourceCommitment, - utils::{poseidon_hash_n, prf_nf, read_base_field}, + utils::{poseidon_hash_n, prf_nf}, }; use halo2_proofs::arithmetic::Field; use pasta_curves::group::ff::PrimeField; @@ -91,7 +91,7 @@ impl BorshSerialize for Nullifier { #[cfg(feature = "borsh")] impl BorshDeserialize for Nullifier { fn deserialize_reader(reader: &mut R) -> std::io::Result { - let value = read_base_field(reader)?; + let value = crate::utils::read_base_field(reader)?; Ok(Self(value)) } } diff --git a/taiga_halo2/src/resource.rs b/taiga_halo2/src/resource.rs index 05590a0f..f8c28cdf 100644 --- a/taiga_halo2/src/resource.rs +++ b/taiga_halo2/src/resource.rs @@ -11,7 +11,7 @@ use crate::{ merkle_tree::{Anchor, MerklePath, Node}, nullifier::{Nullifier, NullifierKeyContainer}, shielded_ptx::ResourceVPVerifyingInfoSet, - utils::{poseidon_hash_n, poseidon_to_curve, read_base_field}, + utils::{poseidon_hash_n, poseidon_to_curve}, }; use blake2b_simd::Params as Blake2bParams; use ff::{FromUniformBytes, PrimeField}; @@ -67,7 +67,7 @@ impl BorshSerialize for ResourceCommitment { #[cfg(feature = "borsh")] impl BorshDeserialize for ResourceCommitment { fn deserialize_reader(reader: &mut R) -> std::io::Result { - let value = read_base_field(reader)?; + let value = crate::utils::read_base_field(reader)?; Ok(Self(value)) } } @@ -329,6 +329,7 @@ impl BorshSerialize for Resource { #[cfg(feature = "borsh")] impl BorshDeserialize for Resource { fn deserialize_reader(reader: &mut R) -> std::io::Result { + use crate::utils::read_base_field; use byteorder::{LittleEndian, ReadBytesExt}; use std::io; // Read logic diff --git a/taiga_halo2/src/shielded_ptx.rs b/taiga_halo2/src/shielded_ptx.rs index 1774c454..c20399ac 100644 --- a/taiga_halo2/src/shielded_ptx.rs +++ b/taiga_halo2/src/shielded_ptx.rs @@ -11,7 +11,6 @@ use crate::merkle_tree::Anchor; use crate::nullifier::Nullifier; use crate::proof::Proof; use crate::resource::{ResourceCommitment, ResourceValidityPredicates}; -use crate::utils::read_scalar_field; use halo2_proofs::plonk::Error; use pasta_curves::pallas; use rand::RngCore; @@ -354,7 +353,7 @@ impl BorshDeserialize for ShieldedPartialTransaction { let binding_sig_r = if binding_sig_r_type == 0 { None } else { - let r = read_scalar_field(reader)?; + let r = crate::utils::read_scalar_field(reader)?; Some(r) };