zkmopro / zkmopro/gpu-acceleration

Checking if zero and equality checking in `jacobian_add_2007_bl` has huge impact in performance

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
29
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Problem

metal_msm::curve::jacobian::jacobian_add_2007_bl() currently has a equality and zero check; however, the ec curve algorithm suppose that users use dbl operation whenever meeting two elements are equal.

Details

We have to check if the check impact the performance a lot

this is the checking code:

    if (is_jacobian_zero(a)) {
        return b;
    }
    if (is_jacobian_zero(b)) {
        return a;
    }
    if (a == b) return jacobian_dbl_2009_l(a, p);

Acceptance criteria

  • benchmark the jacobian_add_2007_bl with and without the checking and observer the performance while having large operations.
  • if the benchmark do not show that there is huge impact, we could keep the current version for addition for better DX

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at metal_msm::curve::jacobian::jacobian_add_2007_bl and identify the existing equality and zero checks shown in the issue. Benchmark large operations with those checks enabled and disabled, then record whether the performance impact justifies retaining the current behavior for developer experience.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cryptography, performance
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.