Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

Refractor of the skeleton and introduction of new instructions#47

Open
hdvanegasm wants to merge 15 commits into
load-store_instructionsfrom
memory-correction
Open

Refractor of the skeleton and introduction of new instructions#47
hdvanegasm wants to merge 15 commits into
load-store_instructionsfrom
memory-correction

Conversation

@hdvanegasm

@hdvanegasm hdvanegasm commented Nov 23, 2023

Copy link
Copy Markdown

General idea

Given that the current idea of StoffelMPC is to support just the HoneyBadgerMPC protocol, this PR aims to change the skeleton of the library in order to reduce the complexity and to add functionalities specific to the HoneyBadgerMPC protocol. Also, I changed the skeleton, so that the components of the VM resemble something that is more traditional according to other MPC VMs like SCALE-MAMBA and MP-SDPZ.

Changelog

November 17, 2023

  • Moved the memory from ArithmeticCore to StoffelVM according to SCALE-MAMBA specification (Section 5.1). In such framework, there is no private memory for each thread.
  • Deleted types Public , Secret , and VmType , from the MPCProtocol trait and added the type Domain, which is the underlying domain of computation of the protocol.
  • Deleted into_vm_type from the trait MPCProtocol.

November 20, 2023

  • Created a Share struct to hold the share that each party has.
  • Changed trait Number to MpcType that will be the trait that groups all the types held by the VM. In particular Share<T> and the field of the curve BLS12_381 implement the MpcType trait.
  • Memory now allows MpcTypes. The rationale behind this is that the memory will hold types Share<T> (for the secret values) and Field types (for the clear values).
  • The above point also holds for registers and stack.
  • Updated ark dependencies.

November 22, 2023

  • Added MemoryAddr as a new type for indexing memory positions.
  • Removed processor field from Instruction struct. Now Instruction does not have a generic.
  • code has been removed from StoffelVM struct and it was replaced by programs: Vec<Program>. Remmeber that we need an Schedule to manage all the programs that are being executed.
  • Added an Schedule struct to manage the prgrams. However, according to SCALE-MAMBA, the programs vector are inside the Schedule struct.
  • Created a Memory to represent the global memory, and the different arrays for each data type are MemoryArrays aiming for a better modularity during the execution.

December 1, 2023

  • Added implementations for new instructions.
  • Added tests for some of the instructions.
  • Overloaded the +/-/* operators between secret/secret and clear/secret values.

From December 4, 2023 to December 7, 2023

  • Added register for register addresses, which is a mimic for regint.
  • Added implementations for new instructions following the SCALE-MAMBA.
  • Using num-bigint crate to perform the arithmetic between BigIntegers given that this crate supports way more arithmetic operations than the library from ark-ff. I added two functions from_domain_to_bigint<T>() and from_domain_to_bigint<T>() to perform this task. We should consider if this is enough or if it needs a better level of abstraction.
  • Added tests for instructions.

December 11, 2023 to December 15, 2023.

In this commit, I deleted the Instruction struct making the old Opcode struct to be the one in charge of all of the Instruction functionality. Now, Instruction is an enum and we can implement all the functionalities as implementing it for an enum.
@hdvanegasm hdvanegasm requested a review from Mikerah November 23, 2023 19:12
@hdvanegasm hdvanegasm self-assigned this Nov 23, 2023
@hdvanegasm hdvanegasm changed the title Refractor of the skeleton Refractor of the skeleton and introduction of new instructions Dec 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants