diff --git a/veilid-core/src/crypto/dh_cache.rs b/veilid-core/src/crypto/dh_cache.rs index 18c7de04..17c5d4ae 100644 --- a/veilid-core/src/crypto/dh_cache.rs +++ b/veilid-core/src/crypto/dh_cache.rs @@ -3,20 +3,20 @@ use crate::*; // Diffie-Hellman key exchange cache #[derive(Serialize, Deserialize, PartialEq, Eq, Hash)] -pub(crate) struct DHCacheKey { +pub struct DHCacheKey { pub key: PublicKey, pub secret: SecretKey, } #[derive(Serialize, Deserialize)] -pub(crate) struct DHCacheValue { +pub struct DHCacheValue { pub shared_secret: SharedSecret, } -pub(crate) type DHCache = LruCache; -pub(crate) const DH_CACHE_SIZE: usize = 4096; +pub type DHCache = LruCache; +pub const DH_CACHE_SIZE: usize = 4096; -pub(crate) fn cache_to_bytes(cache: &DHCache) -> Vec { +pub fn cache_to_bytes(cache: &DHCache) -> Vec { let cnt: usize = cache.len(); let mut out: Vec = Vec::with_capacity(cnt * (32 + 32 + 32)); for e in cache.iter() { @@ -31,7 +31,7 @@ pub(crate) fn cache_to_bytes(cache: &DHCache) -> Vec { rev } -pub(crate) fn bytes_to_cache(bytes: &[u8], cache: &mut DHCache) { +pub fn bytes_to_cache(bytes: &[u8], cache: &mut DHCache) { for d in bytes.chunks(32 + 32 + 32) { let k = DHCacheKey { key: PublicKey::new(d[0..32].try_into().expect("asdf")), diff --git a/veilid-core/src/crypto/mod.rs b/veilid-core/src/crypto/mod.rs index 618cff3f..89213932 100644 --- a/veilid-core/src/crypto/mod.rs +++ b/veilid-core/src/crypto/mod.rs @@ -15,7 +15,6 @@ pub mod vld0; pub use blake3digest512::*; pub use crypto_system::*; -pub use dh_cache::*; pub use envelope::*; pub use receipt::*; pub use types::*; @@ -27,6 +26,7 @@ pub use vld0::*; use super::*; use core::convert::TryInto; +use dh_cache::*; use hashlink::linked_hash_map::Entry; use hashlink::LruCache; diff --git a/veilid-core/src/lib.rs b/veilid-core/src/lib.rs index a13bdf81..63d7db63 100644 --- a/veilid-core/src/lib.rs +++ b/veilid-core/src/lib.rs @@ -1,6 +1,6 @@ //! # The Veilid Framework //! -//! Core library used to create a Veilid node and operate veilid services as part of an application. +//! Core library used to create a Veilid node and operate it as part of an application. //! //! `veilid-core` contains all of the core logic for Veilid and can be used in mobile applications as well as desktop //! and in-browser WebAssembly apps.