Skip to content

Commit

Permalink
ensure u32_backend feature works with r1cs
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Jul 18, 2024
1 parent a170cc2 commit 8421230
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
9 changes: 4 additions & 5 deletions src/fields/fp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ pub mod arkworks;
mod ops;
mod u32;

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

cfg_if! {
if #[cfg(feature = "arkworks")] {
pub type Fp = u64::Fp;
} else {
if #[cfg(feature = "u32_backend")] {
pub type Fp = u32::Fp;
} else {
pub type Fp = u64::Fp;
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/fields/fq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ pub mod arkworks;
mod ops;
mod u32;

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

cfg_if! {
if #[cfg(feature = "arkworks")] {
pub type Fq = u64::Fq;
if #[cfg(feature = "u32_backend")] {
pub type Fp = u32::Fp;
} else {
pub type Fq = u32::Fq;
pub type Fp = u64::Fp;
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/fields/fr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ pub mod arkworks;
mod ops;
pub mod u32;

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

cfg_if! {
if #[cfg(feature = "arkworks")] {
pub type Fr = u64::Fr;
if #[cfg(feature = "u32_backend")] {
pub type Fp = u32::Fp;
} else {
pub type Fr = u32::Fr;
pub type Fp = u64::Fp;
}
}

Expand Down

0 comments on commit 8421230

Please sign in to comment.