Skip to content

TMUL Integration into Groth16 Verifier - #93

Merged
lucidLuckylee merged 36 commits into
BitVM:mainfrom
chainwayxyz:test
Sep 14, 2024
Merged

lucidLuckylee merged 36 commits into
BitVM:mainfrom
chainwayxyz:test

Conversation

@Hakkush-07

@Hakkush-07 Hakkush-07 commented Sep 13, 2024 •

Copy link
Copy Markdown
Collaborator

This PR contributes the following:

  • integrates the new tmul function into Groth16 verifier and all the functions that it uses. Hinted Groth16 Verifier is 1.43 Gb instead of 2.65 Gb. To do that, we introduce modified functions that expect inputs in the standard form instead of Montgomery since tmul expects that. These functions also returns the list of hints.

  • improves newly introduced limb_add_with_carry_prevent_overflow and limb_double_with_carry_prevent_overflow functions which results in around 1 Kb improvement in tmul.

  • adds hinted Fq.inv() so closes Compute inverses using a hint #72

  • fixes BigIntImpl::is_positive() because it was considering 0 as positive.

  • separates N_WINDOW const in tmul because it should be two separate consts for different MOD_WIDTH and VAR_WIDTH.

Note: The original tmul and also this one currently do not not work with different MOD_WIDTH and VAR_WIDTH. You need to select the same MOD_WIDTH and VAR_WIDTH, for example (4, 4) is the best option in terms of script size currently.

@lucidLuckylee
lucidLuckylee merged commit 4e5dd90 into BitVM:main Sep 14, 2024
@dylanCai9 dylanCai9 mentioned this pull request Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compute inverses using a hint

3 participants