Skip to content
Snippets Groups Projects
  1. Aug 01, 2024
    • STEVAN Antoine's avatar
      isolate Semi-AVID (!160) · 0977677f
      STEVAN Antoine authored
      this is a refactor to prepare the addition of other cryptographic methods.
      
      ## changelog
      - moves Semi-AVID code from `lib.rs` to `semi_avid.rs`
      0977677f
  2. Apr 12, 2024
    • STEVAN Antoine's avatar
      update the API (dragoon/komodo!71) · 6f6647cd
      STEVAN Antoine authored
      ## changelog
      - rename the `encode` function to `prove` and have it take _shards_ instead of an _encoding matrix_: this is to isolate the "encoding" process inside the `fec` module and leave the main `komodo::prove` only compute the "proof", i.e. the commits of the data
      
      from
      ```rust
      fn encode<F, G, P>(
          bytes: &[u8],
          encoding_mat: &Matrix<F>,
          powers: &Powers<F, G>,
      ) -> Result<Vec<Block<F, G>>, KomodoError>
      ```
      to
      ```rust
      fn prove<F, G, P>(
          bytes: &[u8],
          powers: &Powers<F, G>,
          k: usize,
      ) -> Result<Vec<Commitment<F, G>>, KomodoError>
      ```
      - rename `fec::Shard.combine` to `fec::Shard.recode_with` to get rid of "combine"
      - rename `fec::recode` to `fec::recode_with_coeffs` to show that this version takes a list of coefficients
      - rename `Block.commit` to `Block.proof`: "commit" should be "commits" and it's usually refered to as "proof"
      - split `prove` further into `prove` and `build`: `prove` now outputs a `Vec<Commitment<F>>`, `build` simply takes a `Vec<Shard<F>>` and a `Vec<Commitment<F>>` and outputs a `Vec<Block<F>>`
      - add `fec::recode_random` that does the "shard" part of `recode` to wrap around `fec::recode_with_coeffs`
      - remove `R: RngCore` from the signature of `zk::setup`, to avoid having to pass a generic `_` annotation everywhere `zk::setup` is used, same change has been applied to `recode` and the `generate_random_powers` in `main.rs`
      
      from
      ```rust
      fn setup<R: RngCore, F: PrimeField, G: CurveGroup<ScalarField = F>>(
          max_degree: usize,
          rng: &mut R,
      ) -> Result<Powers<F, G>, KomodoError> {
      ```
      to
      ```rust
      fn setup<F: PrimeField, G: CurveGroup<ScalarField = F>>(
          max_degree: usize,
          rng: &mut impl RngCore,
      ) -> Result<Powers<F, G>, KomodoError> {
      ```
      
      ### some extra minor changes
      - remove some useles generic type annotations, e.g. `prove::<F, G, P>` can become a simpler `prove` most of the time, i.e. when there is at least one generic annotation somewhere in the scope
      0.2.0
      6f6647cd
  3. Apr 04, 2024
    • STEVAN Antoine's avatar
      refactor imports for consistency (dragoon/komodo!56) · 9136212f
      STEVAN Antoine authored
      as per title, this is a minor MR that just makes sure the imports are consistent across modules.
      
      in order
      - `std`
      - `ark_...`
      - others
      - `komodo` or `crate` or `super`
      9136212f
    • STEVAN Antoine's avatar
      remove requirements on _pairing_ and `ark-poly-commit` (dragoon/komodo!54) · 3c91ef12
      STEVAN Antoine authored
      ## changelog
      - remove `ark-poly-commit` from the dependencies
      - remove the old `setup.rs`
      - add temporary `foo.rs` which define (some details are ommited for brevity)
        - `struct Powers<F, G>` 
        - `struct Commitment<F, G>`
        - `fn build_powers<F, G>(...) -> Powers<F, G>`
        - `fn commit<F, G, P>(powers: &Powers<F, G>, polynomial: &P) -> Commitment<F, G>`
        - tests
      - `foo.rs` is then renamed to `setup.rs`
      - two new `KomodoError` variants have been created to replace `ark_poly_commit::Error`
        - `DegreeIsZero`
        - `TooFewPowersInTrustedSetup(usize, usize)`
      - finally, all the past mentions to `E: Pairing` and `setup::random` have been replaced with `F, G` and `setup::build_powers` respectively
      3c91ef12
  4. Apr 02, 2024
  5. Mar 26, 2024
    • STEVAN Antoine's avatar
      cleanup and documentation (dragoon/komodo!45) · e06a9b5d
      STEVAN Antoine authored
      > **Note**  
      > this MR is best reviewed commit by commit, it's hopefully clear enough.
      
      > **Note**  
      > waiting for dragoon/komodo!47 to land
      
      ## changelog
      - add missing format to the `KomodoError`s
      - rename `fec::Shard::bytes` to `fec::Shard::data` because these are no _bytes_
      - rename the `blocks: Vec<Shard<E>>` argument of `fec::decode` to `shards`
      - refactor the tests of `fec` and `lib.rs`
      - remove the `batch_verify` function entirely as it's pretty useless
      - simplify the `linalg::Matrix::random` function
      - add tests for the function in the `setup` module
      - add documentation where it was missing
      e06a9b5d
    • DISSOUBRAY Nathan's avatar
      Move functions defined in the main to the lib (dragoon/komodo!47) · b567b1bd
      DISSOUBRAY Nathan authored and STEVAN Antoine's avatar STEVAN Antoine committed
      ## Description
      
      Those functions in the main could be useful later as they are operations that an external user might actually want to do directly (instead of just rewriting the functions in the main).
      
      ## List of changes
      - Create a dump function (to be be used by both dump_blocks and generate_powers as they write to disk)
      - Created a fs mod for actions related to writing on disk
      - moved functions into their relevant module (though some might be up to discussion, as noted in some commits)
      - Use anyhow to be able to return Result from functions with multiple error types (since before they just threw errors in the main)
      
      ## Additional notes
      
      Should I include the example that I was working on (ie writing blocks of files recursively), which was the thing that prompted me to actually move the functions from the main to the lib (as I noticed I was rewriting what was in the main to be able to do that) ?
      b567b1bd