Skip to content

Commit

Permalink
fix: executor build
Browse files Browse the repository at this point in the history
  • Loading branch information
dartdart26 committed Nov 1, 2024
1 parent 6a43675 commit 434a8a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
9 changes: 3 additions & 6 deletions fhevm-engine/executor/src/dfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()),
Expand Down
6 changes: 2 additions & 4 deletions fhevm-engine/executor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down Expand Up @@ -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()),
},
Expand Down

0 comments on commit 434a8a9

Please sign in to comment.