Skip to content

stack-encrypt: dynamic::record::encrypt_with and decrypt_with run the lowering themselves — build a Planned instead #1669

Open

Description

@coderdan

Background

Stack Encrypt (packages/stack-encrypt) is the Rust encryption engine that every CipherStash language SDK runs on. A program whose declaration is data, such as the Go SDK, runs a record through dynamic::Planned::new(&plan, value). The functions under it, dynamic::record::encrypt_with and decrypt_with, lower the plan to the combinators through dynamic::planned::compose and opening.

Problem

#1662 asked for encrypt_with and decrypt_with to build a Planned, so that Planned is the one entry to the dynamic path. The pull request that closed #1662 (#1666) left it: today Planned calls these functions, not the other way round. Nothing observable is wrong, because both share compose. But there are still two public ways into the same lowering, which is what #1488 sets out to remove.

Proposal

  1. Make encrypt_with and decrypt_with build a Planned and run it, or make them crate-private if no caller needs them.
  2. Keep the conformance vectors unchanged: no stored byte may change.

Part of #1488 (Remove the structural API).

Metadata

Metadata

Assignees

Labels

SDKrustPull requests that update Rust code

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions