From 434a8a9e093a83010d8c5b4c95891491df27f8a9 Mon Sep 17 00:00:00 2001 From: Petar Ivanov <29689712+dartdart26@users.noreply.github.com> Date: Fri, 1 Nov 2024 17:46:17 +0200 Subject: [PATCH] fix: executor build --- fhevm-engine/executor/src/dfg.rs | 9 +++------ fhevm-engine/executor/src/server.rs | 6 ++---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/fhevm-engine/executor/src/dfg.rs b/fhevm-engine/executor/src/dfg.rs index 3fad997e..d7c05cd2 100644 --- a/fhevm-engine/executor/src/dfg.rs +++ b/fhevm-engine/executor/src/dfg.rs @@ -10,7 +10,6 @@ use anyhow::Result; use fhevm_engine_common::types::{ FhevmError, Handle, SupportedFheCiphertexts, HANDLE_LEN, SCALAR_LEN, }; -use tfhe::integer::U256; use daggy::{Dag, NodeIndex}; use std::collections::HashMap; @@ -91,11 +90,9 @@ impl<'a> DFGraph<'a> { Ok(DFGTaskInput::Dep(None)) } } - Input::Scalar(s) if s.len() == SCALAR_LEN => { - let mut scalar = U256::default(); - scalar.copy_from_be_byte_slice(s); - Ok(DFGTaskInput::Val(SupportedFheCiphertexts::Scalar(scalar))) - } + Input::Scalar(s) if s.len() == SCALAR_LEN => Ok(DFGTaskInput::Val( + SupportedFheCiphertexts::Scalar(s.clone()), + )), _ => Err(FhevmError::BadInputs.into()), }, None => Err(FhevmError::BadInputs.into()), diff --git a/fhevm-engine/executor/src/server.rs b/fhevm-engine/executor/src/server.rs index 87ed24a6..eae1e7db 100644 --- a/fhevm-engine/executor/src/server.rs +++ b/fhevm-engine/executor/src/server.rs @@ -15,7 +15,7 @@ use fhevm_engine_common::{ }; use sha3::{Digest, Keccak256}; use std::{cell::RefCell, collections::HashMap}; -use tfhe::{integer::U256, set_server_key, zk::CompactPkePublicParams}; +use tfhe::{set_server_key, zk::CompactPkePublicParams}; use tokio::task::spawn_blocking; use tonic::{transport::Server, Code, Request, Response, Status}; @@ -272,9 +272,7 @@ impl FhevmExecutorService { Ok(ct.expanded.clone()) } Input::Scalar(s) if s.len() == SCALAR_LEN => { - let mut scalar = U256::default(); - scalar.copy_from_be_byte_slice(&s); - Ok(SupportedFheCiphertexts::Scalar(scalar)) + Ok(SupportedFheCiphertexts::Scalar(s.clone())) } _ => Err(FhevmError::BadInputs.into()), },