Skip to content

Commit

Permalink
baby bear field only (#1696)
Browse files Browse the repository at this point in the history
Most minimal attempt at adding BabyBear, only adds the field and field
tests, but no powdr tests using the field.
  • Loading branch information
leonardoalt authored Aug 16, 2024
1 parent b1431e5 commit c7fdc6c
Show file tree
Hide file tree
Showing 7 changed files with 485 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use env_logger::{Builder, Target};
use log::LevelFilter;
use powdr_backend::BackendType;
use powdr_number::{buffered_write_file, read_polys_csv_file, CsvRenderMode};
use powdr_number::{BigUint, Bn254Field, FieldElement, GoldilocksField};
use powdr_number::{BabyBearField, BigUint, Bn254Field, FieldElement, GoldilocksField};
use powdr_pipeline::Pipeline;
use std::io;
use std::path::PathBuf;
Expand Down Expand Up @@ -56,6 +56,8 @@ fn bind_cli_args<F: FieldElement>(

#[derive(Clone, EnumString, EnumVariantNames, Display)]
pub enum FieldArgument {
#[strum(serialize = "bb")]
Bb,
#[strum(serialize = "gl")]
Gl,
#[strum(serialize = "bn254")]
Expand Down
1 change: 1 addition & 0 deletions cli/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ macro_rules! clap_enum_variants {
macro_rules! call_with_field {
($function:ident::<$field:ident>($($args:expr),*) ) => {
match $field {
FieldArgument::Bb => $function::<BabyBearField>($($args),*),
FieldArgument::Gl => $function::<GoldilocksField>($($args),*),
FieldArgument::Bn254 => $function::<Bn254Field>($($args),*),
}
Expand Down
14 changes: 10 additions & 4 deletions number/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,23 @@ repository = { workspace = true }

[dependencies]
ark-bn254 = { version = "0.4.0", default-features = false, features = [
"scalar_field",
"scalar_field",
] }
ark-ff = "0.4.2"
ark-serialize = "0.4.2"
p3-baby-bear = "0.1.0"
p3-field = "0.1.0"
num-bigint = { version = "0.4.3", features = ["serde"] }
num-traits = "0.2.15"
csv = "1.3"
serde = { version = "1.0", default-features = false, features = ["alloc", "derive", "rc"] }
serde = { version = "1.0", default-features = false, features = [
"alloc",
"derive",
"rc",
] }
serde_with = "3.6.1"
schemars = { version = "0.8.16", features = ["preserve_order"]}
ibig = { version = "0.3.6", features = ["serde"]}
schemars = { version = "0.8.16", features = ["preserve_order"] }
ibig = { version = "0.3.6", features = ["serde"] }
serde_cbor = "0.11.2"
derive_more = "0.99.17"

Expand Down
Loading

0 comments on commit c7fdc6c

Please sign in to comment.