|
@@ -18,17 +18,12 @@ use curve25519_dalek::ristretto::CompressedRistretto;
|
|
|
use curve25519_dalek::ristretto::RistrettoBasepointTable;
|
|
|
use curve25519_dalek::scalar::Scalar;
|
|
|
use rand::RngCore;
|
|
|
-use serde::{Serialize, Deserialize};
|
|
|
-use serde_big_array::big_array;
|
|
|
+use serde::{Deserialize, Serialize};
|
|
|
+use serde_with::serde_as;
|
|
|
use std::collections::{HashMap, HashSet};
|
|
|
use std::convert::TryInto;
|
|
|
use subtle::ConstantTimeEq;
|
|
|
|
|
|
-big_array! {
|
|
|
- BigArray;
|
|
|
- +202,
|
|
|
-}
|
|
|
-
|
|
|
/// Each bridge information line is serialized into this many bytes
|
|
|
pub const BRIDGE_BYTES: usize = 220;
|
|
|
|
|
@@ -42,6 +37,7 @@ pub const MAX_BRIDGES_PER_BUCKET: usize = 3;
|
|
|
pub const MIN_BUCKET_REACHABILITY: usize = 2;
|
|
|
|
|
|
/// A bridge information line
|
|
|
+#[serde_as]
|
|
|
#[derive(Serialize, Deserialize, Copy, Clone, Hash, Eq, PartialEq, Debug)]
|
|
|
pub struct BridgeLine {
|
|
|
/// IPv4 or IPv6 address
|
|
@@ -50,7 +46,7 @@ pub struct BridgeLine {
|
|
|
pub port: u16,
|
|
|
/// other protocol information, including pluggable transport,
|
|
|
/// public key, etc.
|
|
|
- #[serde(with = "BigArray")]
|
|
|
+ #[serde_as(as = "[_; BRIDGE_BYTES - 18]")]
|
|
|
pub info: [u8; BRIDGE_BYTES - 18],
|
|
|
}
|
|
|
|