cargo: Update `cyphernet` from 0.5.2 to 0.5.3
The main change that needs adjustment on our side is that
`impl EcPk for ec25519::PublicKey` changed from `Compressed = [u8; 32]`
to `Compressed = amplify::Bytes32`.
Also remove `impl Deref for PublicKey` to avoid dependents of
`radicle-crypto` depend on a particular implementation, and make the
anonymous member private.
See
<f42396139a>.
This commit is contained in:
parent
91b2fd8986
commit
9b9b5ca996
|
|
@ -714,9 +714,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cypheraddr"
|
name = "cypheraddr"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba5c54d2ad4ab9941383519471b75d12abc1a7b4779265e233168f2703a730d9"
|
checksum = "4204e8808fcdd40bed39e49371f13f56d6984c32bc03dcb577d2a40b989b9d68"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amplify",
|
"amplify",
|
||||||
"base32",
|
"base32",
|
||||||
|
|
@ -738,9 +738,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cyphernet"
|
name = "cyphernet"
|
||||||
version = "0.5.2"
|
version = "0.5.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ac949369884a7a1d802cc669821269c707be8cec4d65043382e253733d2e62e1"
|
checksum = "2de2031ff4b9fc77e4dad022047341b55d285398164cc698e4082f4754b2e684"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cypheraddr",
|
"cypheraddr",
|
||||||
"cyphergraphy",
|
"cyphergraphy",
|
||||||
|
|
@ -3977,9 +3977,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "socks5-client"
|
name = "socks5-client"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ffc7dcf6fab1d65d82d633006a4cc658d76ce436e01cf1a7c71873c0eeba324c"
|
checksum = "a87421b87207f5d39606da1ac9edd9a5333f4809d26a1fa9bbac58ca42913535"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"amplify",
|
"amplify",
|
||||||
"cypheraddr",
|
"cypheraddr",
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,8 @@ bytes = "1.11.1"
|
||||||
chrono = { version = "0.4.26", default-features = false }
|
chrono = { version = "0.4.26", default-features = false }
|
||||||
colored = "2.1.0"
|
colored = "2.1.0"
|
||||||
crossbeam-channel = "0.5.6"
|
crossbeam-channel = "0.5.6"
|
||||||
cypheraddr = "0.4.0"
|
cypheraddr = "0.4.1"
|
||||||
cyphernet = "0.5.2"
|
cyphernet = "0.5.3"
|
||||||
dunce = "1.0.5"
|
dunce = "1.0.5"
|
||||||
fastrand = { version = "2.0.0", default-features = false }
|
fastrand = { version = "2.0.0", default-features = false }
|
||||||
git2 = { version = "0.20.4", default-features = false, features = ["vendored-libgit2"] }
|
git2 = { version = "0.20.4", default-features = false, features = ["vendored-libgit2"] }
|
||||||
|
|
|
||||||
|
|
@ -138,7 +138,7 @@ impl TryFrom<String> for Signature {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The public/verification key.
|
/// The public/verification key.
|
||||||
#[derive(Hash, Serialize, Deserialize, PartialEq, Eq, Copy, Clone)]
|
#[derive(Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Copy, Clone)]
|
||||||
#[serde(into = "String", try_from = "String")]
|
#[serde(into = "String", try_from = "String")]
|
||||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
|
|
@ -154,12 +154,28 @@ impl TryFrom<String> for Signature {
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
pub struct PublicKey(pub ed25519::PublicKey);
|
pub struct PublicKey(amplify::Bytes32);
|
||||||
|
|
||||||
|
impl PublicKey {
|
||||||
|
/// Verify the signature for a given payload.
|
||||||
|
pub fn verify(
|
||||||
|
&self,
|
||||||
|
payload: impl AsRef<[u8]>,
|
||||||
|
signature: &ed25519::Signature,
|
||||||
|
) -> Result<(), ed25519::Error> {
|
||||||
|
ed25519::PublicKey::new(self.0.to_byte_array()).verify(payload, signature)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a byte array representation of the public key.
|
||||||
|
#[inline]
|
||||||
|
pub fn to_byte_array(&self) -> [u8; 32] {
|
||||||
|
self.0.to_byte_array()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl signature::Verifier<Signature> for PublicKey {
|
impl signature::Verifier<Signature> for PublicKey {
|
||||||
fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), signature::Error> {
|
fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), signature::Error> {
|
||||||
self.0
|
self.verify(msg, signature)
|
||||||
.verify(msg, signature)
|
|
||||||
.map_err(signature::Error::from_source)
|
.map_err(signature::Error::from_source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -176,7 +192,7 @@ impl cyphernet::display::MultiDisplay<cyphernet::display::Encoding> for PublicKe
|
||||||
#[cfg(feature = "ssh")]
|
#[cfg(feature = "ssh")]
|
||||||
impl From<PublicKey> for ssh_key::PublicKey {
|
impl From<PublicKey> for ssh_key::PublicKey {
|
||||||
fn from(key: PublicKey) -> Self {
|
fn from(key: PublicKey) -> Self {
|
||||||
ssh_key::PublicKey::from(ssh_key::public::Ed25519PublicKey(**key))
|
ssh_key::PublicKey::from(ssh_key::public::Ed25519PublicKey(key.to_byte_array()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -185,24 +201,24 @@ impl cyphernet::EcPk for PublicKey {
|
||||||
const COMPRESSED_LEN: usize = 32;
|
const COMPRESSED_LEN: usize = 32;
|
||||||
const CURVE_NAME: &'static str = "Edwards25519";
|
const CURVE_NAME: &'static str = "Edwards25519";
|
||||||
|
|
||||||
type Compressed = [u8; 32];
|
type Compressed = amplify::Bytes32;
|
||||||
|
|
||||||
fn base_point() -> Self {
|
fn base_point() -> Self {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn to_pk_compressed(&self) -> Self::Compressed {
|
fn to_pk_compressed(&self) -> Self::Compressed {
|
||||||
*self.0.deref()
|
amplify::Bytes32::from_byte_array(self.to_byte_array())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_pk_compressed(pk: Self::Compressed) -> Result<Self, cyphernet::EcPkInvalid> {
|
fn from_pk_compressed(pk: Self::Compressed) -> Result<Self, cyphernet::EcPkInvalid> {
|
||||||
Ok(PublicKey::from(pk))
|
Ok(PublicKey::from(pk.to_byte_array()))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn from_pk_compressed_slice(slice: &[u8]) -> Result<Self, cyphernet::EcPkInvalid> {
|
fn from_pk_compressed_slice(slice: &[u8]) -> Result<Self, cyphernet::EcPkInvalid> {
|
||||||
ed25519::PublicKey::from_slice(slice)
|
ed25519::PublicKey::from_slice(slice)
|
||||||
.map_err(|_| cyphernet::EcPkInvalid::default())
|
.map_err(|_| cyphernet::EcPkInvalid::default())
|
||||||
.map(Self)
|
.map(Self::from)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -214,7 +230,8 @@ impl SecretKey {
|
||||||
/// Elliptic-curve Diffie-Hellman.
|
/// Elliptic-curve Diffie-Hellman.
|
||||||
pub fn ecdh(&self, pk: &PublicKey) -> Result<[u8; 32], ed25519::Error> {
|
pub fn ecdh(&self, pk: &PublicKey) -> Result<[u8; 32], ed25519::Error> {
|
||||||
let scalar = self.seed().scalar();
|
let scalar = self.seed().scalar();
|
||||||
let ge = edwards25519::GeP3::from_bytes_vartime(pk).ok_or(Error::InvalidPublicKey)?;
|
let ge = edwards25519::GeP3::from_bytes_vartime(&pk.to_byte_array())
|
||||||
|
.ok_or(Error::InvalidPublicKey)?;
|
||||||
|
|
||||||
Ok(edwards25519::ge_scalarmult(&scalar, &ge).to_bytes())
|
Ok(edwards25519::ge_scalarmult(&scalar, &ge).to_bytes())
|
||||||
}
|
}
|
||||||
|
|
@ -291,18 +308,6 @@ pub enum PublicKeyError {
|
||||||
InvalidKey(#[from] ed25519::Error),
|
InvalidKey(#[from] ed25519::Error),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialOrd for PublicKey {
|
|
||||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
|
||||||
Some(self.cmp(other))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Ord for PublicKey {
|
|
||||||
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
|
|
||||||
self.0.as_ref().cmp(other.as_ref())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl fmt::Display for PublicKey {
|
impl fmt::Display for PublicKey {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(f, "{}", self.to_human())
|
write!(f, "{}", self.to_human())
|
||||||
|
|
@ -323,13 +328,19 @@ impl fmt::Debug for PublicKey {
|
||||||
|
|
||||||
impl From<ed25519::PublicKey> for PublicKey {
|
impl From<ed25519::PublicKey> for PublicKey {
|
||||||
fn from(other: ed25519::PublicKey) -> Self {
|
fn from(other: ed25519::PublicKey) -> Self {
|
||||||
Self(other)
|
Self(amplify::Bytes32::from_byte_array(*other.deref()))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<PublicKey> for ed25519::PublicKey {
|
||||||
|
fn from(val: PublicKey) -> Self {
|
||||||
|
ed25519::PublicKey::new(val.to_byte_array())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<[u8; 32]> for PublicKey {
|
impl From<[u8; 32]> for PublicKey {
|
||||||
fn from(other: [u8; 32]) -> Self {
|
fn from(other: [u8; 32]) -> Self {
|
||||||
Self(ed25519::PublicKey::new(other))
|
Self(amplify::Bytes32::from_byte_array(other))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -337,7 +348,7 @@ impl TryFrom<&[u8]> for PublicKey {
|
||||||
type Error = ed25519::Error;
|
type Error = ed25519::Error;
|
||||||
|
|
||||||
fn try_from(other: &[u8]) -> Result<Self, Self::Error> {
|
fn try_from(other: &[u8]) -> Result<Self, Self::Error> {
|
||||||
ed25519::PublicKey::from_slice(other).map(Self)
|
ed25519::PublicKey::from_slice(other).map(Self::from)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -352,7 +363,7 @@ impl PublicKey {
|
||||||
pub fn to_human(&self) -> String {
|
pub fn to_human(&self) -> String {
|
||||||
let mut buf = [0; 2 + ed25519::PublicKey::BYTES];
|
let mut buf = [0; 2 + ed25519::PublicKey::BYTES];
|
||||||
buf[..2].copy_from_slice(&Self::MULTICODEC_TYPE);
|
buf[..2].copy_from_slice(&Self::MULTICODEC_TYPE);
|
||||||
buf[2..].copy_from_slice(self.0.deref());
|
buf[2..].copy_from_slice(self.to_byte_array().as_slice());
|
||||||
|
|
||||||
multibase::encode(multibase::Base::Base58Btc, buf)
|
multibase::encode(multibase::Base::Base58Btc, buf)
|
||||||
}
|
}
|
||||||
|
|
@ -387,7 +398,7 @@ impl FromStr for PublicKey {
|
||||||
if let Some(bytes) = bytes.strip_prefix(&Self::MULTICODEC_TYPE) {
|
if let Some(bytes) = bytes.strip_prefix(&Self::MULTICODEC_TYPE) {
|
||||||
let key = ed25519::PublicKey::from_slice(bytes)?;
|
let key = ed25519::PublicKey::from_slice(bytes)?;
|
||||||
|
|
||||||
Ok(Self(key))
|
Ok(key.into())
|
||||||
} else {
|
} else {
|
||||||
Err(PublicKeyError::Multicodec(Self::MULTICODEC_TYPE))
|
Err(PublicKeyError::Multicodec(Self::MULTICODEC_TYPE))
|
||||||
}
|
}
|
||||||
|
|
@ -402,14 +413,6 @@ impl TryFrom<String> for PublicKey {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Deref for PublicKey {
|
|
||||||
type Target = ed25519::PublicKey;
|
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "git-ref-format-core")]
|
#[cfg(feature = "git-ref-format-core")]
|
||||||
impl From<&PublicKey> for git_ref_format_core::Component<'_> {
|
impl From<&PublicKey> for git_ref_format_core::Component<'_> {
|
||||||
fn from(id: &PublicKey) -> Self {
|
fn from(id: &PublicKey) -> Self {
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,9 @@ impl ExtendedSignature {
|
||||||
/// Convert to OpenSSH standard PEM format.
|
/// Convert to OpenSSH standard PEM format.
|
||||||
pub fn to_pem(&self) -> Result<String, ExtendedSignatureError> {
|
pub fn to_pem(&self) -> Result<String, ExtendedSignatureError> {
|
||||||
ssh_key::SshSig::new(
|
ssh_key::SshSig::new(
|
||||||
ssh_key::public::KeyData::from(ssh_key::public::Ed25519PublicKey(**self.key)),
|
ssh_key::public::KeyData::from(ssh_key::public::Ed25519PublicKey(
|
||||||
|
self.key.to_byte_array(),
|
||||||
|
)),
|
||||||
String::from("radicle"),
|
String::from("radicle"),
|
||||||
ssh_key::HashAlg::Sha256,
|
ssh_key::HashAlg::Sha256,
|
||||||
ssh_key::Signature::new(ssh_key::Algorithm::Ed25519, **self.sig)?,
|
ssh_key::Signature::new(ssh_key::Algorithm::Ed25519, **self.sig)?,
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ impl Agent {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn key_data(key: &PublicKey) -> KeyData {
|
fn key_data(key: &PublicKey) -> KeyData {
|
||||||
KeyData::Ed25519(Ed25519PublicKey(***key))
|
KeyData::Ed25519(Ed25519PublicKey(key.to_byte_array()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -191,7 +191,6 @@ mod test {
|
||||||
use ssh_agent_lib::blocking::Client;
|
use ssh_agent_lib::blocking::Client;
|
||||||
use ssh_agent_lib::proto::SignRequest;
|
use ssh_agent_lib::proto::SignRequest;
|
||||||
use ssh_agent_lib::ssh_key::public::{Ed25519PublicKey, KeyData};
|
use ssh_agent_lib::ssh_key::public::{Ed25519PublicKey, KeyData};
|
||||||
use std::ops::Deref;
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_agent_encoding_remove() {
|
fn test_agent_encoding_remove() {
|
||||||
|
|
@ -216,7 +215,7 @@ mod test {
|
||||||
// since we are not actually connected to SSH agent.
|
// since we are not actually connected to SSH agent.
|
||||||
assert!(
|
assert!(
|
||||||
matches!(client.remove_identity(ssh_agent_lib::proto::RemoveIdentity {
|
matches!(client.remove_identity(ssh_agent_lib::proto::RemoveIdentity {
|
||||||
pubkey: KeyData::Ed25519(Ed25519PublicKey(**pk.deref())),
|
pubkey: KeyData::Ed25519(Ed25519PublicKey(pk.to_byte_array())),
|
||||||
}),
|
}),
|
||||||
Err(
|
Err(
|
||||||
super::AgentError::Proto(ssh_agent_lib::proto::ProtoError::IO(err)),
|
super::AgentError::Proto(ssh_agent_lib::proto::ProtoError::IO(err)),
|
||||||
|
|
@ -251,7 +250,7 @@ mod test {
|
||||||
|
|
||||||
client
|
client
|
||||||
.sign(SignRequest {
|
.sign(SignRequest {
|
||||||
pubkey: KeyData::Ed25519(Ed25519PublicKey(**pk.deref())),
|
pubkey: KeyData::Ed25519(Ed25519PublicKey(pk.to_byte_array())),
|
||||||
data,
|
data,
|
||||||
flags: 0,
|
flags: 0,
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -332,7 +332,7 @@ impl MemorySigner {
|
||||||
.ok_or_else(|| MemorySignerError::NotFound(public_path.to_path_buf()))?;
|
.ok_or_else(|| MemorySignerError::NotFound(public_path.to_path_buf()))?;
|
||||||
|
|
||||||
secret
|
secret
|
||||||
.validate_public_key(&public)
|
.validate_public_key(&public.into())
|
||||||
.map_err(|_| MemorySignerError::KeyMismatch {
|
.map_err(|_| MemorySignerError::KeyMismatch {
|
||||||
secret: keystore.secret_key_path().to_path_buf(),
|
secret: keystore.secret_key_path().to_path_buf(),
|
||||||
public: public_path.to_path_buf(),
|
public: public_path.to_path_buf(),
|
||||||
|
|
@ -345,7 +345,7 @@ impl MemorySigner {
|
||||||
/// the public key from the secret key.
|
/// the public key from the secret key.
|
||||||
pub fn from_secret(secret: Zeroizing<SecretKey>) -> Self {
|
pub fn from_secret(secret: Zeroizing<SecretKey>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
public: PublicKey(secret.public_key()),
|
public: secret.public_key().into(),
|
||||||
secret,
|
secret,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,6 @@ impl Arbitrary for PublicKey {
|
||||||
let seed = Seed::new(bytes);
|
let seed = Seed::new(bytes);
|
||||||
let keypair = KeyPair::from_seed(seed);
|
let keypair = KeyPair::from_seed(seed);
|
||||||
|
|
||||||
PublicKey(keypair.pk)
|
keypair.pk.into()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,9 @@ impl signature::Signer<Signature> for MockSigner {
|
||||||
|
|
||||||
impl signature::Verifier<Signature> for MockSigner {
|
impl signature::Verifier<Signature> for MockSigner {
|
||||||
fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), signature::Error> {
|
fn verify(&self, msg: &[u8], signature: &Signature) -> Result<(), signature::Error> {
|
||||||
self.pk.verify(msg, signature)
|
self.pk
|
||||||
|
.verify(msg, signature)
|
||||||
|
.map_err(signature::Error::from_source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ impl Fingerprint {
|
||||||
home: &Home,
|
home: &Home,
|
||||||
secret_key: &impl std::ops::Deref<Target = crypto::SecretKey>,
|
secret_key: &impl std::ops::Deref<Target = crypto::SecretKey>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let public_key = crypto::PublicKey(secret_key.deref().public_key());
|
let public_key = secret_key.deref().public_key().into();
|
||||||
let mut file = std::fs::OpenOptions::new()
|
let mut file = std::fs::OpenOptions::new()
|
||||||
.create_new(true)
|
.create_new(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
|
|
@ -86,7 +86,7 @@ impl Fingerprint {
|
||||||
&self,
|
&self,
|
||||||
secret_key: &impl std::ops::Deref<Target = crypto::SecretKey>,
|
secret_key: &impl std::ops::Deref<Target = crypto::SecretKey>,
|
||||||
) -> FingerprintVerification {
|
) -> FingerprintVerification {
|
||||||
let public_key = crypto::PublicKey(secret_key.deref().public_key());
|
let public_key = secret_key.deref().public_key().into();
|
||||||
if crypto::ssh::fmt::fingerprint(&public_key) == self.0 {
|
if crypto::ssh::fmt::fingerprint(&public_key) == self.0 {
|
||||||
FingerprintVerification::Match
|
FingerprintVerification::Match
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ impl Encode for u64 {
|
||||||
|
|
||||||
impl Encode for PublicKey {
|
impl Encode for PublicKey {
|
||||||
fn encode(&self, buf: &mut impl BufMut) {
|
fn encode(&self, buf: &mut impl BufMut) {
|
||||||
self.deref().encode(buf)
|
self.to_byte_array().encode(buf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,8 @@ impl Arbitrary for Address {
|
||||||
AddressType::Onion => {
|
AddressType::Onion => {
|
||||||
let pk = PublicKey::arbitrary(g);
|
let pk = PublicKey::arbitrary(g);
|
||||||
let addr = OnionAddrV3::from(
|
let addr = OnionAddrV3::from(
|
||||||
cyphernet::ed25519::PublicKey::from_pk_compressed(**pk).unwrap(),
|
cyphernet::ed25519::PublicKey::from_pk_compressed(pk.to_byte_array())
|
||||||
|
.unwrap(),
|
||||||
);
|
);
|
||||||
cyphernet::addr::HostName::Tor(addr)
|
cyphernet::addr::HostName::Tor(addr)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue