Skip to content

Commit a1d38f1

Browse files
committed
fix target visibility
1 parent 3c4be85 commit a1d38f1

File tree

5 files changed

+31
-22
lines changed

5 files changed

+31
-22
lines changed

bls-signatures/src/proof_of_possession/mod.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@ pub mod conversion;
33
pub mod points;
44

55
// Re-export public types and constants
6+
pub use bytes::{
7+
ProofOfPossession, ProofOfPossessionCompressed, BLS_PROOF_OF_POSSESSION_AFFINE_BASE64_SIZE,
8+
BLS_PROOF_OF_POSSESSION_AFFINE_SIZE, BLS_PROOF_OF_POSSESSION_COMPRESSED_BASE64_SIZE,
9+
BLS_PROOF_OF_POSSESSION_COMPRESSED_SIZE,
10+
};
11+
#[cfg(not(target_os = "solana"))]
612
pub use {
7-
bytes::{
8-
AsProofOfPossession, ProofOfPossession, ProofOfPossessionCompressed,
9-
BLS_PROOF_OF_POSSESSION_AFFINE_BASE64_SIZE, BLS_PROOF_OF_POSSESSION_AFFINE_SIZE,
10-
BLS_PROOF_OF_POSSESSION_COMPRESSED_BASE64_SIZE, BLS_PROOF_OF_POSSESSION_COMPRESSED_SIZE,
11-
},
13+
bytes::AsProofOfPossession,
1214
points::{
1315
AsProofOfPossessionProjective, ProofOfPossessionProjective, VerifiableProofOfPossession,
1416
},

bls-signatures/src/pubkey/bytes.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#[cfg(all(not(target_os = "solana"), feature = "std"))]
2+
use crate::pubkey::points::NEG_G1_GENERATOR_AFFINE;
3+
#[cfg(not(feature = "std"))]
4+
use blstrs::G1Projective;
15
#[cfg(feature = "bytemuck")]
26
use bytemuck::{Pod, PodInOption, Zeroable, ZeroableInOption};
37
#[cfg(not(target_os = "solana"))]
@@ -6,7 +10,7 @@ use {
610
error::BlsError,
711
hash::{hash_message_to_point, hash_pubkey_to_g2},
812
proof_of_possession::{AsProofOfPossession, ProofOfPossession},
9-
pubkey::points::{PubkeyProjective, NEG_G1_GENERATOR_AFFINE},
13+
pubkey::points::PubkeyProjective,
1014
signature::{AsSignature, Signature},
1115
},
1216
blstrs::{Bls12, G1Affine, G2Affine, G2Prepared, Gt},

bls-signatures/src/pubkey/mod.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ pub mod bytes;
22
pub mod conversion;
33
pub mod points;
44

5+
pub use bytes::{
6+
Pubkey, PubkeyCompressed, BLS_PUBLIC_KEY_AFFINE_BASE64_SIZE, BLS_PUBLIC_KEY_AFFINE_SIZE,
7+
BLS_PUBLIC_KEY_COMPRESSED_BASE64_SIZE, BLS_PUBLIC_KEY_COMPRESSED_SIZE,
8+
};
9+
#[cfg(not(target_os = "solana"))]
510
pub use {
6-
bytes::{
7-
AsPubkey, Pubkey, PubkeyCompressed, VerifiablePubkey, BLS_PUBLIC_KEY_AFFINE_BASE64_SIZE,
8-
BLS_PUBLIC_KEY_AFFINE_SIZE, BLS_PUBLIC_KEY_COMPRESSED_BASE64_SIZE,
9-
BLS_PUBLIC_KEY_COMPRESSED_SIZE,
10-
},
11+
bytes::{AsPubkey, VerifiablePubkey},
1112
points::{AsPubkeyProjective, PubkeyProjective},
1213
};
1314

@@ -23,6 +24,8 @@ mod tests {
2324
core::str::FromStr,
2425
std::string::ToString,
2526
};
27+
#[cfg(feature = "parallel")]
28+
use {crate::error::BlsError, rayon::prelude::*};
2629

2730
#[test]
2831
fn test_pubkey_verify_signature() {

bls-signatures/src/pubkey/points.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#[cfg(all(feature = "parallel", not(target_os = "solana")))]
22
use rayon::prelude::*;
3-
#[cfg(all(not(target_os = "solana"), feature = "std"))]
4-
use std::sync::LazyLock;
53
#[cfg(not(target_os = "solana"))]
64
use {
75
crate::{error::BlsError, secret_key::SecretKey},
8-
blstrs::{G1Affine, G1Projective},
6+
blstrs::G1Projective,
97
group::Group,
108
};
9+
#[cfg(all(not(target_os = "solana"), feature = "std"))]
10+
use {blstrs::G1Affine, std::sync::LazyLock};
1111

1212
#[cfg(all(not(target_os = "solana"), feature = "std"))]
1313
pub(crate) static NEG_G1_GENERATOR_AFFINE: LazyLock<G1Affine> =

bls-signatures/src/signature/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ pub mod bytes;
22
pub mod conversion;
33
pub mod points;
44

5+
pub use bytes::{
6+
Signature, SignatureCompressed, BLS_SIGNATURE_AFFINE_BASE64_SIZE, BLS_SIGNATURE_AFFINE_SIZE,
7+
BLS_SIGNATURE_COMPRESSED_BASE64_SIZE, BLS_SIGNATURE_COMPRESSED_SIZE,
8+
};
9+
#[cfg(not(target_os = "solana"))]
510
pub use {
6-
bytes::{
7-
AsSignature, Signature, SignatureCompressed, BLS_SIGNATURE_AFFINE_BASE64_SIZE,
8-
BLS_SIGNATURE_AFFINE_SIZE, BLS_SIGNATURE_COMPRESSED_BASE64_SIZE,
9-
BLS_SIGNATURE_COMPRESSED_SIZE,
10-
},
11+
bytes::AsSignature,
1112
points::{AsSignatureProjective, SignatureProjective, VerifiableSignature},
1213
};
1314

1415
#[cfg(test)]
1516
mod tests {
17+
#[cfg(feature = "parallel")]
18+
use rayon::prelude::*;
1619
use {
1720
super::*,
1821
crate::{
@@ -26,9 +29,6 @@ mod tests {
2629
std::{string::ToString, vec::Vec},
2730
};
2831

29-
#[cfg(feature = "parallel")]
30-
use rayon::prelude::*;
31-
3232
#[test]
3333
fn test_signature_verification() {
3434
let keypair = Keypair::new();

0 commit comments

Comments
 (0)