weave-dht · private_route_v1
Source declarations, signatures and documentation for private_route_v1.
Source: sigil/weave/network/weave-dht/src/private_route_v1.rs. SHA-256: ea6d6f8224766f6c2312cd4255f5ed3faf51d05ea71c474509c441c145177ecc.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
private_route_v1::PRIVATE_ENVELOPE_VERSION
pub const PRIVATE_ENVELOPE_VERSION: u64;Source line: 28.
private_route_v1::ROUTE_SLOT_WIDTH_MS
pub const ROUTE_SLOT_WIDTH_MS: u64;Source line: 29.
private_route_v1::MAX_PRIVATE_LEASE_SLOTS
pub const MAX_PRIVATE_LEASE_SLOTS: u64;Source line: 30.
private_route_v1::PRIVATE_PADDING_BUCKETS
pub const PRIVATE_PADDING_BUCKETS: [usize; 6];Source line: 31.
private_route_v1::LOOKUP_DOMAIN
pub const LOOKUP_DOMAIN: &[u8];Source line: 32.
private_route_v1::EPOCH_HINT_DOMAIN
pub const EPOCH_HINT_DOMAIN: &[u8];Source line: 33.
private_route_v1::AEAD_KEY_CONTEXT
pub const AEAD_KEY_CONTEXT: &str;Source line: 34.
private_route_v1::KEY_SET_DIGEST_DOMAIN
pub const KEY_SET_DIGEST_DOMAIN: &[u8];Source line: 35.
private_route_v1::EPOCH_HANDLE_DOMAIN
pub const EPOCH_HANDLE_DOMAIN: &[u8];Source line: 36.
private_route_v1::ScopedDiscoverySecretsV1
Application-supplied discovery keys for one immutable privacy epoch.
The keys are zeroized on drop. The constructor rejects public profiles and identical lookup/encryption keys, but the application integration remains responsible for ensuring neither key is a repository MEK, application authentication key, DID, writer key, or raw scope identifier.
pub struct ScopedDiscoverySecretsV1 {
pub privacy_epoch: u64,
pub privacy_profile: PrivacyProfile
}Source line: 44.
private_route_v1::ScopedDiscoverySecretsV1::new
pub fn new(
lookup_key: [u8; 32],
encryption_key: [u8; 32],
privacy_epoch: u64,
privacy_profile: PrivacyProfile,
) -> Result<Self, Protocol1CodecError>;Source line: 52.
private_route_v1::ScopedDiscoverySecretsV1::discovery_key_set_digest
pub fn discovery_key_set_digest(&self) -> [u8; 32];Source line: 73.
private_route_v1::ScopedDiscoverySecretsV1::lookup_tag
pub fn lookup_tag(&self, route_slot: u32) -> [u8; 32];Source line: 77.
private_route_v1::ScopedDiscoverySecretsV1::epoch_hint
pub fn epoch_hint(&self, route_slot: u32) -> [u8; 8];Source line: 81.
private_route_v1::PaddingClass
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)]
pub enum PaddingClass {
KiB1 = 0,
KiB2 = 1,
KiB4 = 2,
KiB8 = 3,
KiB16 = 4,
KiB32 = 5,
}Source line: 92.
private_route_v1::PaddingClass::bucket_bytes
pub fn bucket_bytes(self) -> usize;Source line: 102.
private_route_v1::PrivateRouteEnvelopeV1
#[derive(Clone, PartialEq, Eq)]
pub struct PrivateRouteEnvelopeV1 {
pub lookup_tag: [u8; 32],
pub slot_epoch_hint: [u8; 8],
pub issued_bucket: u64,
pub expires_bucket: u64,
pub padding_class: PaddingClass,
pub nonce: [u8; 24],
pub ciphertext: Vec<u8>,
pub authenticator: [u8; 16]
}Source line: 130.
private_route_v1::PrivateLeasePolicy
Application/operator-owned slot policy.
The codec enforces only the frozen structural rule (expires > issued and
at most two 10-minute slots). Wall-clock skew, readable epochs, publication
jitter, and local lease state are intentionally supplied by the later D3a
provider integration through this boundary.
pub trait PrivateLeasePolicy {
fn accepts(&self, issued_bucket: u64, expires_bucket: u64) -> bool;
}Source line: 159.
private_route_v1::PrivateRouteEnvelopeV1::open_and_validate
pub fn open_and_validate<P>(
wire: &[u8],
secrets: &ScopedDiscoverySecretsV1,
lease_policy: &P,
route_context: &RouteValidationContext,
) -> Result<PeerRouteSetV1, Protocol1CodecError>
where
P: PrivateLeasePolicy,;Source line: 173.
private_route_v1::PrivateRouteEnvelopeV1::encode
pub fn encode(&self) -> Result<Vec<u8>, Protocol1CodecError>;Source line: 277.
private_route_v1::route_slot_for_time
pub fn route_slot_for_time(publication_time_ms: u64) -> Result<u32, Protocol1CodecError>;Source line: 371.
private_route_v1::reader_slots
pub fn reader_slots(current_slot: u32) -> [Option<u32>; 3];Source line: 376.
private_route_v1::privacy_epoch_handle
pub fn privacy_epoch_handle(
privacy_compartment_ref: &[u8; 32],
privacy_epoch: u64,
allowed_scope_set_digest: &[u8; 32],
discovery_key_set_digest: &[u8; 32],
) -> [u8; 32];Source line: 421.
private_route_v1::select_padding_length_for_header
pub fn select_padding_length_for_header(
content_length: usize,
issued_bucket: u64,
expires_bucket: u64,
) -> Result<(PaddingClass, usize), Protocol1CodecError>;Source line: 436.