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

Named algebra (part 1) #400

Merged
merged 1 commit into from
Jun 25, 2024
Merged

Named algebra (part 1) #400

merged 1 commit into from
Jun 25, 2024

Conversation

mratsim
Copy link
Owner

@mratsim mratsim commented Jun 25, 2024

This PR does:

  1. Move constantine/math/config, in particular constantine/math/config/curves to a new constantine/named folder and corresponding constantine/named/algebra file.
  2. Switch import to be absolute path based on project-root instead of relative.

This does not break code that depends on public protocols like BLS signatures, KZG commitments or EVM precompiles.
It will break code that imports internals in constantine/math/config. A followup PR will rename internal methods to reflect expanding Constantine beyond elliptic curves so it is recommended to wait before upgrading.

Rationale

Curve-specific or protocol-specific code should be separated from the generic math folder.

Furthermore, we will likely support and accelerate field arithmetic for STARK proof systems which do not use elliptic curves. The current configuration assumes we use named curves. The file has been renamed to algebra instead of curves to encompass both fields and curves.

A future PR will rename the configuration functions as named curves are used everywhere in the code so just changing path ended up modifying 429 files!

Regarding the switch to absolute path imports, those avoid needing to figure out relative paths when moving files.
They also allow copying of tests or internal files or user code to other locations without having to modify the imports.

… a 'named' folder + use project-root path + prepare for using named fields and not just named curves for STARK primes
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.

1 participant