mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-12 17:41:22 +00:00
core/: Introduce rsa
feature flag to avoid ring
dependency (#2860)
- Introduce `rsa` feature flag to `libp2p-core`. - Expose `rsa` feature in `libp2p`. - Add `rsa` feature to `libp2p` `default`.
This commit is contained in:
committed by
GitHub
parent
a40180c3d8
commit
8644c65a22
@ -613,6 +613,7 @@ mod tests {
|
||||
struct TestKeypair(Keypair);
|
||||
|
||||
impl Arbitrary for TestKeypair {
|
||||
#[cfg(feature = "rsa")]
|
||||
fn arbitrary<G: Gen>(g: &mut G) -> Self {
|
||||
let keypair = if g.gen() {
|
||||
// Small enough to be inlined.
|
||||
@ -624,6 +625,12 @@ mod tests {
|
||||
};
|
||||
TestKeypair(keypair)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "rsa"))]
|
||||
fn arbitrary<G: Gen>(_g: &mut G) -> Self {
|
||||
// Small enough to be inlined.
|
||||
TestKeypair(Keypair::generate_ed25519())
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for TestKeypair {
|
||||
|
Reference in New Issue
Block a user