Skip to content

Commit be7afa8

Browse files
authored
Support BigUint plaintext moduli in BFV (#358)
1 parent 8d67113 commit be7afa8

34 files changed

Lines changed: 1298 additions & 371 deletions

.github/workflows/lint-fmt.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- uses: actions-rs/toolchain@v1
2121
with:
2222
profile: minimal
23-
toolchain: nightly
23+
toolchain: stable
2424
override: true
2525
components: rustfmt
2626
- uses: actions-rs/cargo@v1
@@ -35,13 +35,15 @@ jobs:
3535
CARGO_TERM_COLOR: always
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v6
38+
- name: Install protoc
39+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libprotobuf-dev
3940
- uses: actions-rs/toolchain@v1
4041
with:
4142
profile: minimal
4243
toolchain: stable
4344
override: true
4445
components: clippy
46+
- uses: actions/checkout@v6
4547
- uses: actions-rs/cargo@v1
4648
with:
4749
command: clippy

.github/workflows/rust.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ jobs:
2121
CARGO_TERM_COLOR: always
2222
runs-on: ubuntu-latest
2323
steps:
24-
- uses: actions/checkout@v6
24+
- name: Install protoc
25+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libprotobuf-dev
2526
- uses: actions-rs/toolchain@v1
2627
with:
2728
profile: minimal
2829
toolchain: stable
2930
override: true
31+
- uses: actions/checkout@v6
3032
- uses: actions-rs/cargo@v1
3133
with:
3234
command: check
@@ -38,12 +40,14 @@ jobs:
3840
CARGO_TERM_COLOR: always
3941
runs-on: ubuntu-latest
4042
steps:
41-
- uses: actions/checkout@v6
43+
- name: Install protoc
44+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libprotobuf-dev
4245
- uses: actions-rs/toolchain@v1
4346
with:
4447
profile: minimal
4548
toolchain: stable
4649
override: true
50+
- uses: actions/checkout@v6
4751
- uses: actions-rs/cargo@v1
4852
with:
4953
command: test

Cargo.lock

Lines changed: 102 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ tfhe-ntt = "^0.7.0"
2121
console = "^0.16.2"
2222
criterion = "^0.8.1"
2323
doc-comment = "^0.3.4"
24-
env_logger = "^0.11.3"
25-
ethnum = "^1.5.0"
24+
env_logger = "^0.11.8"
25+
ethnum = "^1.5.2"
2626
indicatif = "^0.18.3"
2727
itertools = "^0.14.0"
2828
log = "^0.4.29"
2929
ndarray = "^0.17.2"
30-
num-bigint = "^0.4.4"
30+
num-bigint = "^0.4.6"
3131
num-bigint-dig = "^0.9.1"
32-
num-traits = "^0.2.18"
33-
num-complex = { version = "^0.4.6", features = ["libm"] }
32+
num-traits = "^0.2.19"
3433
proptest = "^1.9.0"
3534
prost = "^0.14.3"
35+
prost-build = "^0.14.3"
3636
pulp = "^0.22.2"
3737
rand = "^0.9.2"
3838
rand_chacha = "^0.9.0"
39-
sha2 = "^0.10.8"
39+
sha2 = "^0.10.9"
4040
thiserror = "^2.0.18"
4141
zeroize = "^1.8.2"
4242
zeroize_derive = "^1.4.3"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ To install, add the following to your project's `Cargo.toml` file:
2828

2929
```toml
3030
[dependencies]
31-
fhe = "0.1.1"
32-
fhe-traits = "0.1.1"
31+
fhe = "0.2"
32+
fhe-traits = "0.2"
3333
```
3434

3535
## Minimum supported version / toolchain

crates/fhe-math/Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ edition.workspace = true
66
license.workspace = true
77
repository.workspace = true
88
rust-version.workspace = true
9-
version = "0.1.1"
9+
version = "0.2.0"
1010

1111
[lints]
1212
workspace = true
@@ -21,8 +21,8 @@ tfhe-ntt = []
2121
fhe-traits = { version = "=0.1.1", path = "../fhe-traits" }
2222
fhe-util = { version = "=0.1.1", path = "../fhe-util" }
2323

24-
tfhe-ntt.workspace = true
2524
ethnum.workspace = true
25+
tfhe-ntt.workspace = true
2626
itertools.workspace = true
2727
ndarray.workspace = true
2828
num-bigint.workspace = true
@@ -35,12 +35,14 @@ rand_chacha.workspace = true
3535
thiserror.workspace = true
3636
zeroize.workspace = true
3737
sha2.workspace = true
38-
num-complex.workspace = true
3938

4039
[dev-dependencies]
4140
criterion.workspace = true
4241
proptest.workspace = true
4342

43+
[build-dependencies]
44+
prost-build.workspace = true
45+
4446
[[bench]]
4547
name = "zq"
4648
harness = false

crates/fhe-math/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Add the following to your `Cargo.toml`:
1515

1616
```toml
1717
[dependencies]
18-
fhe-math = "0.1.1"
18+
fhe-math = "0.2.0"
1919
```
2020

2121
## Testing

crates/fhe-math/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![allow(missing_docs)]
2+
3+
fn main() -> Result<(), Box<dyn std::error::Error>> {
4+
let proto_path = "src/proto/rq.proto";
5+
let proto_dir = "src/proto";
6+
7+
println!("cargo:rerun-if-changed={proto_path}");
8+
9+
let mut config = prost_build::Config::new();
10+
config.compile_protos(&[proto_path], &[proto_dir])?;
11+
Ok(())
12+
}

0 commit comments

Comments
 (0)