From 341d7dbc442f7dd57cc515180feb575e44004b33 Mon Sep 17 00:00:00 2001 From: Monica Moniot Date: Tue, 22 Aug 2023 11:58:20 -0400 Subject: [PATCH] attempted fix --- src/lib.rs | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2ab8553..f3d93d1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -33,24 +33,29 @@ pub use zssp; #[macro_export] macro_rules! impl_zssp_crypto { ($t:ty, $session_data:ty, $packet_buffer:ty) => { - impl ::zerotier_crypto_glue::zssp::application::CryptoLayer for $t { - type Rng = ::zerotier_crypto_glue::random::SecureRandom; + mod __tmp { + use ::zerotier_crypto_glue::zssp; + use ::zerotier_crypto_glue::random; + use ::zerotier_crypto_glue::hash; + impl ::zerotier_crypto_glue::zssp::application::CryptoLayer for $t { + type Rng = ::zerotier_crypto_glue::random::SecureRandom; - type PrpEnc = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAes256Enc; - type PrpDec = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAes256Dec; + type PrpEnc = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAes256Enc; + type PrpDec = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAes256Dec; - type Aead = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAesGcm; - type AeadPool = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAesGcmPool; + type Aead = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAesGcm; + type AeadPool = ::zerotier_crypto_glue::zssp::crypto_impl::OpenSSLAesGcmPool; - type Hash = ::zerotier_crypto_glue::hash::SHA512; - type Hmac = ::zerotier_crypto_glue::hash::HMACSHA512; + type Hash = ::zerotier_crypto_glue::hash::SHA512; + type Hmac = ::zerotier_crypto_glue::hash::HMACSHA512; - type PublicKey = ::zerotier_crypto_glue::p384::P384PublicKey; - type KeyPair = ::zerotier_crypto_glue::p384::P384KeyPair; - type Kem = ::zerotier_crypto_glue::zssp::crypto_impl::CrateKyber1024PrivateKey; + type PublicKey = ::zerotier_crypto_glue::p384::P384PublicKey; + type KeyPair = ::zerotier_crypto_glue::p384::P384KeyPair; + type Kem = ::zerotier_crypto_glue::zssp::crypto_impl::CrateKyber1024PrivateKey; - type SessionData = $session_data; - type IncomingPacketBuffer = $packet_buffer; + type SessionData = $session_data; + type IncomingPacketBuffer = $packet_buffer; + } } } }