Skip to content

Commit 5d4e0fa

Browse files
committed
fix: use blst backend to avoid conflict with FVM
1 parent f2f103f commit 5d4e0fa

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

Cargo.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ ahash = "0.8"
1414
anyhow = "1"
1515
base32 = "0.5.1"
1616
base64 = "0.22"
17-
blake2 = { git = "https://github.com/huitseeker/hashes.git", branch = "blake2x-pr", features = ["blake2x"] }
18-
bls-signatures = { version = "0.15" }
17+
blake2 = { git = "https://github.com/huitseeker/hashes.git", branch = "blake2x-pr", features = [
18+
"blake2x",
19+
] }
20+
bls-signatures = { version = "0.15", default-features = false, features = [
21+
"blst",
22+
] }
1923
bls12_381 = "0.8"
2024
cid = { version = "0.10.1", features = ["std"] }
2125
fvm_ipld_bitfield = "0.7.1"

blssig/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ rust-version.workspace = true
1212
[dependencies]
1313
blake2.workspace = true
1414
bls-signatures.workspace = true
15-
bls12_381.workspace = true
15+
blstrs = "0.7"
16+
group = "0.13"
1617
filecoin-f3-gpbft = { path = "../gpbft", version = "0.1.0" }
1718
hashlink.workspace = true
1819
parking_lot.workspace = true

blssig/src/bdn/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ use crate::verifier::BLSError;
1313
use blake2::Blake2xs;
1414
use blake2::digest::{ExtendableOutput, Update, XofReader};
1515
use bls_signatures::{PublicKey, Serialize, Signature};
16-
use bls12_381::{G1Projective, G2Projective, Scalar};
16+
use blstrs::{G1Projective, G2Projective, Scalar};
17+
use group::Group;
1718

1819
/// BDN aggregation context for managing signature and public key aggregation
1920
pub struct BDNAggregation {
@@ -106,7 +107,7 @@ impl BDNAggregation {
106107
bytes_32[..16].copy_from_slice(chunk);
107108

108109
// BLS12-381 scalars expects little-endian byte representation
109-
let scalar = Scalar::from_bytes(&bytes_32);
110+
let scalar = Scalar::from_bytes_be(&bytes_32);
110111
if scalar.is_some().into() {
111112
coefficients.push(scalar.unwrap());
112113
} else {

0 commit comments

Comments
 (0)