Skip to content

Commit

Permalink
refactor!: removed binary shares from wtnx extension
Browse files Browse the repository at this point in the history
Witness extension now uses only arithmetic shares and
converts between a2b if necessary

BREAKING CHANGE: Witness extension VM trait no longer has binary share
type.
  • Loading branch information
0xThemis authored and dkales committed Nov 6, 2024
1 parent cbc5905 commit 1370a7a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 350 deletions.
10 changes: 1 addition & 9 deletions co-circom/circom-mpc-vm/src/mpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ pub(crate) mod rep3;
pub trait VmCircomWitnessExtension<F: PrimeField> {
/// The arithemitc share type
type ArithmeticShare: CanonicalSerialize + CanonicalDeserialize + Clone + Default;
/// The binary share type
type BinaryShare;
/// The VM type
type VmType: Clone
+ Default
+ fmt::Debug
+ fmt::Display
+ From<F>
+ From<Self::ArithmeticShare>
+ From<Self::BinaryShare>;
type VmType: Clone + Default + fmt::Debug + fmt::Display + From<F> + From<Self::ArithmeticShare>;

/// Add two VM-types: c = a + b.
fn add(&mut self, a: Self::VmType, b: Self::VmType) -> Result<Self::VmType>;
Expand Down
2 changes: 0 additions & 2 deletions co-circom/circom-mpc-vm/src/mpc/plain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ impl<F: PrimeField> CircomPlainVmWitnessExtension<F> {
impl<F: PrimeField> VmCircomWitnessExtension<F> for CircomPlainVmWitnessExtension<F> {
type ArithmeticShare = F;

type BinaryShare = F;

type VmType = F;

fn add(&mut self, a: Self::VmType, b: Self::VmType) -> Result<Self::VmType> {
Expand Down
Loading

0 comments on commit 1370a7a

Please sign in to comment.