Skip to main content

ContentCrypto

Trait ContentCrypto 

Source
pub trait ContentCrypto {
    // Required methods
    fn decode_and_fold(&self, proof: &[u8]) -> Option<FoldedProof>;
    fn decrypt_chunk(
        &self,
        urn: &DigUrn,
        salt: Option<&SecretSalt>,
        chunk: &[u8],
    ) -> Option<Vec<u8>>;
}
Expand description

The crypto primitives this contract INJECTS from digstore_core (never reimplemented here).

Required Methods§

Source

fn decode_and_fold(&self, proof: &[u8]) -> Option<FoldedProof>

Decode the wire-encoded inclusion proof and fold its merkle path, returning the declared leaf and folded root. Return None on ANY malformed encoding or internally-inconsistent path (fail-closed) — the path-fold rule (3) lives here.

Source

fn decrypt_chunk( &self, urn: &DigUrn, salt: Option<&SecretSalt>, chunk: &[u8], ) -> Option<Vec<u8>>

AES-256-GCM-SIV open ONE ciphertext chunk under the key derived from urn’s rootless canonical form + optional salt. Return None on an AEAD tag failure (fail-closed).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§