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

make 32-bit backend the default, prepare 1.0.0 release #108

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
name: Test Suite
runs-on: buildjet-16vcpu-ubuntu-2204
# We want to run the tests twice, once with the
# default backend (u64) and one with the u32_backend,
# default backend (u32) and one with the u64_backend,
# in both cases with the r1cs feature enabled.
strategy:
matrix:
backend: ["r1cs", "r1cs,u32_backend"]
backend: ["r1cs", "r1cs,u64_backend"]
steps:
- uses: actions/checkout@v4
- name: Install rust toolchain
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@
# 0.10.1

* Fix recursion causing infinite loop in 32-bit backend * operator for Element

# 1.0.0

* Make 32-bit backend the default, add `u64_backend` feature
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "decaf377"
version = "0.10.1"
version = "1.0.0"
authors = [
"Henry de Valence <hdevalence@hdevalence.ca>",
"redshiftzero <jen@penumbralabs.xyz>",
Expand Down Expand Up @@ -68,7 +68,7 @@ arkworks = [
"hashbrown",
]
r1cs = ["arkworks", "ark-groth16", "ark-r1cs-std", "ark-relations", "ark-snark"]
u32_backend = []
u64_backend = ["arkworks"]

[dev-dependencies]
proptest = "1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ website](https://protocol.penumbra.zone/main/crypto/decaf377.html).
* `std`: default, for use in `std` environments,
* `alloc`: default, for use in `alloc` environments,
* `arkworks`: default, uses Arkworks crates for elliptic curve operations,
* `u32_backend`: uses 32-bit finite field arithmetic (default is 64-bit),
* `u64_backend`: uses 64-bit finite field arithmetic (default is 32-bit),
* `r1cs`: enables rank-1 constraint system gadgets,
* `parallel`: enables the use of parallelism.

Expand Down
5 changes: 2 additions & 3 deletions src/fields/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ pub mod arkworks;
mod ops;
mod u32;

// The u64 backend requires arkworks
#[cfg(feature = "arkworks")]
#[cfg(feature = "u64_backend")]
mod u64;

cfg_if! {
if #[cfg(feature = "arkworks")] {
if #[cfg(feature = "u64_backend")] {
pub type Fp = u64::Fp;
} else {
pub type Fp = u32::Fp;
Expand Down
5 changes: 2 additions & 3 deletions src/fields/fq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ pub mod arkworks;
mod ops;
mod u32;

// The u64 backend requires arkworks
#[cfg(feature = "arkworks")]
#[cfg(feature = "u64_backend")]
mod u64;

cfg_if! {
if #[cfg(feature = "arkworks")] {
if #[cfg(feature = "u64_backend")] {
pub type Fq = u64::Fq;
} else {
pub type Fq = u32::Fq;
Expand Down
5 changes: 2 additions & 3 deletions src/fields/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ pub mod arkworks;
mod ops;
pub mod u32;

// The u64 backend requires arkworks
#[cfg(feature = "arkworks")]
#[cfg(feature = "u64_backend")]
pub mod u64;

cfg_if! {
if #[cfg(feature = "arkworks")] {
if #[cfg(feature = "u64_backend")] {
pub type Fr = u64::Fr;
} else {
pub type Fr = u32::Fr;
Expand Down
Loading