Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alter field #146

Merged
merged 7 commits into from
Sep 24, 2024
Merged

Alter field #146

merged 7 commits into from
Sep 24, 2024

Conversation

serendipity-crypto
Copy link
Collaborator

@serendipity-crypto serendipity-crypto commented Sep 5, 2024

  • Add traits ConstOne, ConstZero, NegOne and ConstNegOne.
  • Rename PowReduce to ExpReduce.
  • Add ExpPowOf2Reduce for improving Goldilocks and BabyBear.
  • Remove functions mask and decompose_len of DecomposableField.
  • Remove 'static of some traits.
  • Use a trait Primitive to define Field::Value, make it supports more operations.
  • Minor improvement for Barrett modulus.

Copy link
Member

@xiangxiecrypto xiangxiecrypto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we rename algebra/src/reduce/primitive.rs as macros.rs?

@@ -2,7 +2,7 @@ use crate::{
extension::TwoAdicField, field::Field, modulus::to_monty, BabyBear, BinomialExtensionField,
BinomiallyExtendable, HasTwoAdicBionmialExtension,
};
use num_traits::{One, Zero};
use num_traits::{ConstOne, ConstZero};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep using One,Zero? otherwise, the follow up PRs need to change back and forth.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any Field not suitable with ConstOne or ConstZero?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not really, just because these things are changed back and forth a lot of times.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ConstOne and ConstZero are better. We will implement Field with them.

@serendipity-crypto
Copy link
Collaborator Author

can we rename algebra/src/reduce/primitive.rs as macros.rs?

Yes.

@xiangxiecrypto xiangxiecrypto merged commit 4c7cb97 into main Sep 24, 2024
9 checks passed
@serendipity-crypto serendipity-crypto deleted the alter_field branch September 24, 2024 07:24
xiangxiecrypto added a commit that referenced this pull request Oct 30, 2024
* range check without optimizations and random test

* fmt

* add random test

* fmt

* clippy

* comments

* record

* backup

* logup

* fmt

* fmt

* comment

* lookup num can be arbitrary integer

* fiat shamir randomness

* enable more actions for check (#133)

* enable more actions for check

* disable `asm` feature for `sha2`

* update `bytemuck` and `criterion`

* cfg `sha2`

* move batch_inverse to util

* reconstruct BitDecomposition

* finish bit decomp

* unify transcript in FF and EF

* snarks for bit decomposition

* reconstruct addition in Zq

* add snarks for addition in zq

* general lookup

* finish iop for ntt

* snarks for ntt

* add EF for RoundIOP

* snarks for round

* range check without optimizations and random test

* fmt

* add random test

* fmt

* clippy

* comments

* record

* backup

* logup

* fmt

* fmt

* comment

* lookup num can be arbitrary integer

* fiat shamir randomness

* move batch_inverse to util

* general lookup

* fix

* reconstruct RLWE * RGSW

* reconstruct snarks for RLWE * RGSW

* fmt

* add RLWE * RGSW example

* delete dead code

* rename

* rename

* reconstruct Accumulator

* check equality relations among ACC

* add snarks for ACC

* fmt

* check & clippy

* fix

* fix BabyBear

* rewrite zq to rQ

* fmt

* for merge

* snarky lookup

* fix

* fix

* add example for zq to rq

* optimize with lookup

* rename to floor

* add round

* sumcheck paralleled, >2x improved

* optimize evaluate_ext

* optimize acc evaluate_ext

* minor for lookup

* mle from poly

* revise ntt

* optimized with hashmap

* fmt & clippy & test

* clippy

* fix fmt/clippy/typo

* typo clippy

* Remove `check-msrv` (#150)

* remove `check-msrv`

* remove `typos`

* Alter field (#146)

* remake `primitive`

* add `ExpPowOf2Reduce` ops

* add `NegOne` and `ConstNegOne` trait

* clippy

* typos

* improve `CarryingMul` and `WideningMul`

* file rename

* add pcs batch open and verify

* minor

* add assertion

* minor

* update lookup

* minor

* minor

* refine lookup

* pcs for extension field polynomial

* clippy

* finish lookup

* refine bit decomposition types

* refine bit decomposition

* refine addition in Zq

* refine lookup

* refine bit decomp

* remove lookup in addition in zq and refine

* refine ntt names

* refine ntt-bare

* ntt refine first version

* refine proof struct

* refine instance info struct

* refine ntt

* refine ntt

* refine ntt example

* combine ntt normal and reverse order

* refine ntt in normal and reverse order

* refine floor

* refine round

* rename zq_to_rq to lift

* refine lift

* refine extenal product naming

* rename

* refine external product

* refine EP step 2

* refine

* refine external product

* refine acc

* Revert "refine acc"

This reverts commit 88ab2fc.

* simplify add struct

* refine acc complete

* refactor

* refactor

* optimize acc proving time

* remove dead code

* remove ds_store

* clippy

* clippy

---------

Co-authored-by: Tianyu Zhang <[email protected]>
Co-authored-by: Haofei Liang <[email protected]>
Co-authored-by: Xiang Xie <[email protected]>
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.

2 participants