Skip to main content

encapsulate_scope

Function encapsulate_scope 

Source
pub fn encapsulate_scope(
    material: &ScopeMaterial,
    fragment_secret: &[u8; 32],
    opaque_id: &[u8; 16],
    passphrase: Option<&str>,
    argon2: Argon2Params,
) -> Result<WrappedScope, SharingError>
Expand description

Encapsulate material around a fresh link secret, optionally adding the Argon2id passphrase layer. Pure crypto — the caller supplies the CSPRNG-drawn secrets and the resolved material, so it is unit-testable without a Workspace.

The issuer-side primitive open_scope reverses. Public so the cross-language KAT generator (cargo xtask share-kat) can seal fixtures byte-identically to the native issuer, then have the browser (capsule-wasm) reopen them.