Skip to content

Move vitaminc's AEAD crates into the stack and define the value types once #1831

Todo
7 of 7 issues completed

Description

@coderdan

Background

Stack Encrypt (the Rust crate stack-encrypt) seals values with vitaminc, CipherStash's cryptography library, which lives in cipherstash/vitaminc. vitaminc's AEAD crates (AEAD: authenticated encryption with associated data) define the value types, how each is encoded, and how a value is sealed. The language SDKs (Go, TypeScript) reach the engine through stack_encrypt::dynamic.

Problem

The list of value types is written down in vitaminc, written again in the engine (ValueKind, the allow-list in ValueFrame), and reconciled a third time in each language SDK. The copies disagree. A UUID is read by the JavaScript bridge and refused by the engine (#1821). A JavaScript Date is written in milliseconds and rewritten to nanoseconds by the engine. An integer is converted to its declared type by Go, refused by the engine on a write, and sent at its narrowest width by the JavaScript bridge.

Work on the TypeScript SDK stops until this is fixed.

Proposal

Follow the plan in docs/plans/2026-11-14-move-vitaminc-aead-into-the-stack.md (#1717). This issue tracks its steps. Each step gets its own issue when work starts, sized to one pull request.

No stored format changes. A change to stored bytes is a defect.

Decisions recorded since the plan merged

  • An order index takes no UUID. stack-encrypt does not turn on vitaminc-ore's uuid feature, and nothing in the workspace does today. If vitaminc-ore moves into this repository, its uuid feature, and the UUID order target behind it, are removed. Until then, stage 2.3 refuses a UUID in the engine's order index.
  • An order index takes no bytes. vitaminc-ore has a bytes order target that is not behind a feature, and stack-encrypt names no bytes target today. If vitaminc-ore moves into this repository, the bytes order target is removed. Until then, stage 2.3 refuses bytes in the engine's order index.

Relationship to other work

Sub-issues

Sub-issues

7 of 7 Issues completed
Loading 7 sub-issues

Metadata

Metadata

Assignees

Labels

RustSDKenhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions