From c4e254a0b8dfc709745b67430388e8220c9a9fb0 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 00:57:53 +1100 Subject: [PATCH 1/4] docs(golang): scope a cipher with Scope, not the deprecated Extend The README and the package doc scoped a cipher with Extend. Extend is deprecated and is removed in 0.1.0, so code copied from the docs fails staticcheck with SA1019 and stops compiling at 0.1.0. "The cipher" section now uses Scope and says what it takes and does: it returns a new cipher, adds to the context the tags declare, takes strings, byte slices or integers, and fails the first call with ErrEncoding on a part of any other type. The "Reading" section and the package doc now say scope instead of extension. Refs #1854 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/encrypt/README.md | 36 +++++++++++++++++++----------- languages/golang/encrypt/doc.go | 4 ++-- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 6e67a1e8a..29ecd53dc 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -199,23 +199,30 @@ key is consumed by `NewClient` and wiped, whatever the outcome. ## The cipher -A `Cipher` is the client bound to one keyset, and to any extension of the +A `Cipher` is the client bound to one keyset, and to any scopes of the context. Every generated function takes one. ```go -cipher := client.Keyset(encrypt.KeysetName("tenant-42")).Extend("tenant-42") +cipher := client.Keyset(encrypt.KeysetName("tenant-42")).Scope("tenant-42") ``` -`Extend` appends to the context that the tags declare, for every field, in -every call through the cipher: the write, the query and the read. A row -written through `Extend("tenant-42")` opens and matches only through a cipher -with the same extension. No call takes a keyset or a context, so the three +`Scope` returns a new cipher, and leaves the one it was called on unchanged. +The new cipher adds the scope to the context the tags declare, for every +field and every call: the write, the query and the read. A row +written through `Scope("tenant-42")` opens and matches only through a cipher +with the same scope. No call takes a keyset or a context, so the three cannot use different ones. +Each part of a scope is a string, a byte slice or an integer: `int32`, +`int64`, `uint32`, `uint64` or `int`. An `int` is sent as `int64`. Several parts +nest in order, so `Scope(a, b)` is the same as `Scope(a).Scope(b)`. A part of +any other type makes the first call through the cipher fail with +`ErrEncoding`. + > **Take care** > > The context binds each value to its table, its column and the cipher's -> extension. It does not bind the value to its row, so a value copied to +> scopes. It does not bind the value to its row, so a value copied to > another row of the same table decrypts there with no error. To bind each > row to a context of its own, such as its tenant, give the struct a > `context_field` instead of a `context=` tag: @@ -345,14 +352,17 @@ request. ## Reading -`users.Decrypt` takes a `Decrypter`: the `*Cipher`, which refuses a row -another keyset sealed with `ErrForeignKeyset` before any key is retrieved, or -the `*Client`, which opens each row under the keyset that sealed it. The -`*Client` opens only rows that a cipher with no extension sealed; a row -written through `Extend` opens only through a cipher with the same extension. +`users.Decrypt` takes a `Decrypter`: the `*Cipher` or the `*Client`. The +`*Cipher` refuses a row another keyset sealed with `ErrForeignKeyset`, before +any key is retrieved. The `*Client` opens each row under the keyset that +sealed it. + +The `*Client` opens only rows that a cipher with no scope sealed. A row +written through `Scope` opens only through a cipher with the same scope. + For a type with a `context_field`, the `*Cipher` from `cipher.Context(..)` also refuses a row whose stored context is another, with -`ErrContextMismatch`; the `*Client` opens each row under the context it +`ErrContextMismatch`. The `*Client` opens each row under the context it stores. ## What is stored diff --git a/languages/golang/encrypt/doc.go b/languages/golang/encrypt/doc.go index 3003f54b6..d61ba71cd 100644 --- a/languages/golang/encrypt/doc.go +++ b/languages/golang/encrypt/doc.go @@ -100,8 +100,8 @@ // wiped before the instance is freed. // // A [Cipher] is the client bound to one keyset ([Client.Keyset] and -// [Client.DefaultKeyset]) and to any extension of the context -// ([Cipher.Extend]): what changes from one caller to the next — a tenant, a +// [Client.DefaultKeyset]) and to any scopes of the context +// ([Cipher.Scope]): what changes from one caller to the next — a tenant, a // region — attaches here and not to each call, so the write, the query and // the read cannot use different ones. A Cipher opens only its own keyset's // records; the [Client] opens records from any of its keysets. Both are a From 3cd327cb7658148d7b2bc228971e7dbc68e3f3d9 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 01:44:59 +1100 Subject: [PATCH 2/4] docs(golang): name which calls fail, and the bindings the client cannot open Cipher.KeysetID never checks a refused scope part, so not every call through the cipher fails: only a write, query or read does. A row sealed through Bind has its binding in the stored context, and Client.Open adds none, so the client opens only rows sealed with no scope and no binding. Refs #1854 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/encrypt/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/languages/golang/encrypt/README.md b/languages/golang/encrypt/README.md index 29ecd53dc..450561868 100644 --- a/languages/golang/encrypt/README.md +++ b/languages/golang/encrypt/README.md @@ -216,8 +216,8 @@ cannot use different ones. Each part of a scope is a string, a byte slice or an integer: `int32`, `int64`, `uint32`, `uint64` or `int`. An `int` is sent as `int64`. Several parts nest in order, so `Scope(a, b)` is the same as `Scope(a).Scope(b)`. A part of -any other type makes the first call through the cipher fail with -`ErrEncoding`. +any other type makes the first write, query or read through the cipher fail +with `ErrEncoding`. > **Take care** > @@ -357,8 +357,9 @@ request. any key is retrieved. The `*Client` opens each row under the keyset that sealed it. -The `*Client` opens only rows that a cipher with no scope sealed. A row -written through `Scope` opens only through a cipher with the same scope. +The `*Client` opens only rows that a cipher with no scope and no binding +sealed. A row written through `Scope` or `Bind` opens only through a cipher +with the same scopes and bindings. For a type with a `context_field`, the `*Cipher` from `cipher.Context(..)` also refuses a row whose stored context is another, with From 0ff351ff6bb145b4c5b78b989c77762a8a6d9818 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 15:42:07 +1100 Subject: [PATCH 3/4] docs(golang): say scope, not extension, in the Go doc comments Several doc comments still called a scope an "extension", and the Cipher doc linked the deprecated Cipher.Extend. They now say "scope" and link Cipher.Scope. This covers Cipher, Checker.Contexts, the record methods, encrypttest.Extension, the record package, and the stashgen stub. The example and one live test comment change the same way. Only comments change. These keep their names: the unexported field extension, the plan field Extension, the deprecated Extend and Extension methods, and the error strings. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/CHANGELOG.md | 8 ++++++++ languages/golang/encrypt/checker.go | 2 +- languages/golang/encrypt/cipher.go | 17 ++++++++++------- .../golang/encrypt/encrypttest/encrypttest.go | 5 +++-- languages/golang/encrypt/example/main.go | 6 +++--- languages/golang/encrypt/live_test.go | 4 ++-- languages/golang/encrypt/records.go | 17 +++++++++-------- languages/golang/internal/record/record.go | 13 +++++++------ languages/golang/stashgen/engine.go | 2 +- .../testdata/stubsdk/encrypt/encrypt.go | 2 +- 10 files changed, 45 insertions(+), 31 deletions(-) diff --git a/languages/golang/CHANGELOG.md b/languages/golang/CHANGELOG.md index bd7ebcd19..1c4176954 100644 --- a/languages/golang/CHANGELOG.md +++ b/languages/golang/CHANGELOG.md @@ -13,6 +13,14 @@ and `languages/golang/encrypt/encrypttest/vX.Y.Z` on the same commit. ## [Unreleased] +### Changed + +- The `encrypt` package documentation, its README, and the example teach + `Cipher.Scope` (#1854). Doc comments that said "extension" now say + "scope", such as those of `Cipher` and `encrypttest.Extension`. `Cipher.Extend` and + `Cipher.Extension` still work, as deprecated aliases until 0.1.0. No + behaviour changes. + ## [0.1.0-rc.7] - 2026-11-25 ### Upgrading from rc.6 diff --git a/languages/golang/encrypt/checker.go b/languages/golang/encrypt/checker.go index ca448fbc3..ba3318f8c 100644 --- a/languages/golang/encrypt/checker.go +++ b/languages/golang/encrypt/checker.go @@ -121,7 +121,7 @@ func (k *Checker) Operators(ctx context.Context, plan *record.Plan, field string // context read from a field of each record shows as a placeholder. The text // is the engine's, and the same as a Rust record's contexts() for the same // declaration, so a test that pins it agrees with Rust. A plan the engine -// refuses is [ErrEncoding]. For the contexts a cipher's extension adds, use +// refuses is [ErrEncoding]. For the contexts a cipher's scopes add, use // [Cipher.Contexts]. func (k *Checker) Contexts(ctx context.Context, plan *record.Plan) (string, error) { if err := plan.Validate(); err != nil { diff --git a/languages/golang/encrypt/cipher.go b/languages/golang/encrypt/cipher.go index 6f4a1b77a..604070186 100644 --- a/languages/golang/encrypt/cipher.go +++ b/languages/golang/encrypt/cipher.go @@ -8,22 +8,24 @@ import ( "github.com/cipherstash/stack/languages/golang/internal/record" ) -// Cipher is a [Client] bound to one keyset, and to any extension of the +// Cipher is a [Client] bound to one keyset, and to any scopes of the // context: the Go form of the Rust crate's KeysetCipher. Generated code seals // values, derives terms and opens records through it; a program never calls // the engine directly. A Cipher opens only its own keyset's ciphertexts — a // leaf sealed under another keyset is refused as [ErrForeignKeyset] before // any key is retrieved. To open ciphertexts from any keyset, pass the // [Client] where a [Decrypter] is taken. A Client opens only rows that a -// cipher with no extension encrypted; rows sealed through [Cipher.Extend] -// open only through a cipher with the same extension. +// cipher with no scope encrypted; rows sealed through [Cipher.Scope] +// open only through a cipher with the same scopes. // // A Cipher holds no guest state: the keyset is selected on every call, and // loaded by the guest on first use, so one is cheap to make per request or // per tenant. type Cipher struct { - client *Client - keyset KeysetSelector + client *Client + keyset KeysetSelector + // extension is the caller's scopes, in order, from [Cipher.Scope]: in + // the stored context and the query context of every field. extension []any // bindings is the caller's bindings, in order, after the scopes: in the // stored context of every field, and in no query context. @@ -35,8 +37,9 @@ type Cipher struct { // request; nil sends none. The facts are never changed after they are // made, so ciphers share them. audit auditFacts - // err is a refused extension part, context or audit value, reported by - // the first call rather than by Extend, Context or Audit: a cipher is + // err is a refused scope or binding part, context or audit value, + // reported by the first call rather than by Scope, Bind, Context or + // Audit: a cipher is // made without a request, and no call on this package panics. err error } diff --git a/languages/golang/encrypt/encrypttest/encrypttest.go b/languages/golang/encrypt/encrypttest/encrypttest.go index d72919d43..813af08e9 100644 --- a/languages/golang/encrypt/encrypttest/encrypttest.go +++ b/languages/golang/encrypt/encrypttest/encrypttest.go @@ -88,8 +88,9 @@ type Placeholder struct { FromPlaintext bool } -// Extension is the optional extension a plan accepts from the call that -// runs it: "{extension?: CallerContext}". +// Extension is the optional part a plan accepts from the call that runs +// it: the scopes of an [encrypt.Cipher.Scope] cipher. The engine prints it +// by its own name: "{extension?: CallerContext}". func Extension() Placeholder { return Placeholder{Name: "extension", Type: "CallerContext", Optional: true} } diff --git a/languages/golang/encrypt/example/main.go b/languages/golang/encrypt/example/main.go index d4234d800..aed5231e7 100644 --- a/languages/golang/encrypt/example/main.go +++ b/languages/golang/encrypt/example/main.go @@ -55,9 +55,9 @@ func run(ctx context.Context) error { fmt.Printf("id %d matches bob@example.com: %v\n", e.ID, term.Equal(e.Email.Equality)) } - // Decrypt through the cipher. It carries the extension that Encrypt - // used, and it refuses rows from another keyset. The client would refuse - // these rows: it opens only rows sealed with no extension. + // Decrypt through the cipher. It carries the scope that Encrypt used, + // and it refuses rows from another keyset. The client would refuse these + // rows: it opens only rows sealed with no scope. // // Audit gives the cipher audit metadata: facts about the call, which // ZeroKMS writes to its audit log with the request for the data keys. diff --git a/languages/golang/encrypt/live_test.go b/languages/golang/encrypt/live_test.go index ce127a13d..d86b3c965 100644 --- a/languages/golang/encrypt/live_test.go +++ b/languages/golang/encrypt/live_test.go @@ -69,8 +69,8 @@ func TestLiveRecordsAndTerms(t *testing.T) { t.Fatalf("Decrypt through the client: %v %+v", err, back) } - // A context extension is part of the identity: the write, the query - // and the read all go through the extended cipher. + // A scope is part of the identity: the write, the query and the read + // all go through the scoped cipher. tenant7, tenant8 := cipher.Extend(uint64(7)), cipher.Extend(uint64(8)) ext, err := testusers.Encrypt(ctx, tenant7, livePeople) if err != nil { diff --git a/languages/golang/encrypt/records.go b/languages/golang/encrypt/records.go index 6072b2e99..502c2ec36 100644 --- a/languages/golang/encrypt/records.go +++ b/languages/golang/encrypt/records.go @@ -20,7 +20,7 @@ import ( // Decrypter opens records: a *Cipher, which refuses a record sealed under // another keyset before any key is retrieved, or a *Client, which opens each // record under the keyset that sealed it. A *Client opens only records that -// a cipher with no extension sealed, and checks no stored context field +// a cipher with no scope sealed, and checks no stored context field // against a label: that is [Cipher.Context]. Generated Decrypt functions // take one. Its method is for generated code; a program does not call it. type Decrypter interface { @@ -28,7 +28,7 @@ type Decrypter interface { } // Contexts shows the contexts this cipher seals and indexes the plan's -// fields under, with the cipher's extension applied, before any key is +// fields under, with the cipher's scopes applied, before any key is // requested: what [Cipher.Seal] will use for every row. The text is // [Checker.Contexts]'s, one line per field and one indented line with its // context. A plan the engine refuses is [ErrEncoding]. @@ -41,7 +41,7 @@ func (cph *Cipher) Contexts(ctx context.Context, plan *record.Plan) (string, err } // Seal encrypts rows under the plan, through this cipher's keyset and with -// its extension: the sealed fields of every row, in order, with one ZeroKMS +// its scopes: the sealed fields of every row, in order, with one ZeroKMS // request for each 500 sealed values. For generated code. func (cph *Cipher) Seal(ctx context.Context, plan *record.Plan, rows []record.Source) ([]record.Sealed, error) { p, err := cph.plan(plan) @@ -82,7 +82,7 @@ func (cph *Cipher) Seal(ctx context.Context, plan *record.Plan, rows []record.So return inst.call(ctx, inst.encryptRecord, buf(encodedSource), buf(encodedPlan), buf(opts)) }) if errors.Is(err, ErrTerm) { - // The plan as given: derive applies the extension itself. + // The plan as given: derive applies the scopes itself. return nil, cph.locateTermFailure(ctx, plan, rows, err) } if err != nil { @@ -127,7 +127,7 @@ func (cph *Cipher) Open(ctx context.Context, plan *record.Plan, records []record } // derive derives one index term for one value of a field, under the plan's -// context for that field and this cipher's extension: the term the record +// context for that field and this cipher's scopes: the term the record // call stores for it. It is how locateTermFailure names the field // behind a record's term failure; a query asks [Cipher.QueryTerm], which // names an operator. A plan that takes its context from a field has none of @@ -175,7 +175,7 @@ func (cph *Cipher) derive(ctx context.Context, plan *record.Plan, field string, } // queryPlan is the plan a query on field derives under: the declaration's -// plan with this cipher's extension and, for a plan that takes its context +// plan with this cipher's scopes and, for a plan that takes its context // from a field, the context named with [Cipher.Context] in that field's // place. A cipher that names none is refused as [ErrEncoding]: a term // derives under a context, and such a plan has none until a record names it. @@ -265,7 +265,8 @@ func (c *Client) openAny(ctx context.Context, audit auditFacts, plan *record.Pla return c.open(ctx, callOptions{keyset: anyKeyset{}, audit: audit}, plan, records) } -// plan is the declaration's plan with this cipher's extension, checked. A +// plan is the declaration's plan with this cipher's scopes and bindings, +// checked. A // cipher that names a context serves a plan that takes its context from a // field and no other: for one with a context of its own there is nothing // the label could be, so it is refused as two sources, as the engine @@ -560,7 +561,7 @@ func (c *Client) openEncoded(ctx context.Context, call callOptions, p *record.Pl // as the empty filter), so a term failure on a record is the scheme refusing // the value's kind under that index. derive asks the query path, which does // refuse text with no token, so that one refusal is skipped here: it cannot -// be why the record failed. p is the plan without this cipher's extension, +// be why the record failed. p is the plan without this cipher's scopes, // which derive adds. func (cph *Cipher) locateTermFailure(ctx context.Context, p *record.Plan, rows []record.Source, err error) error { for i, row := range rows { diff --git a/languages/golang/internal/record/record.go b/languages/golang/internal/record/record.go index fd3d90887..377d12328 100644 --- a/languages/golang/internal/record/record.go +++ b/languages/golang/internal/record/record.go @@ -12,7 +12,8 @@ // "float32", "float64", "decimal", "date", "timestamp", "string", // "bytes" and "json". A field's context is // its label — the plan's context segments and the field's identity — nested -// to the left under each part the caller extends it by. +// to the left under each scope the caller adds. The caller's bindings come +// after the scopes, in the stored context only. // // Passthrough fields do not appear in a Plan. The Go SDK keeps them on the // host: the FFI codec cannot carry every Go type a program stores beside a @@ -240,8 +241,8 @@ func (f Field) HasCiphertext() bool { return false } -// Plan is a declaration as the engine reads it: one context, any extension, -// and the sealed fields. +// Plan is a declaration as the engine reads it: one context, any scopes and +// bindings, and the sealed fields. type Plan struct { // Context is the label every field's label extends: at least one plain // segment. The guest requires a field's label to have two or more @@ -316,7 +317,7 @@ func CheckSegment(s string) error { // list as Rust's Label::INVISIBLE. const invisible = "\u00ad\u061c\u180e\u200b\u200c\u200d\u200e\u200f\u202a\u202b\u202c\u202d\u202e\u2060\u2061\u2062\u2063\u2064\u2066\u2067\u2068\u2069\ufeff" -// CheckPart refuses a context extension part that is not a string, a byte +// CheckPart refuses a scope part that is not a string, a byte // slice or an integer the codec carries. func CheckPart(part any) error { switch part.(type) { @@ -357,7 +358,7 @@ var Reserved = []string{"context_field", "bind"} // Validate checks what the host can check before the engine sees the plan: // a context, plain segments, at least one field, names and identities once, // outputs once and at least one, known kinds, a kind on every indexed field, -// and extension parts the codec carries. The engine's own rules — which index a kind admits, what the +// and scope and binding parts the codec carries. The engine's own rules — which index a kind admits, what the // builder refuses — are the engine's, asked through se_plan_check. func (p *Plan) Validate() error { switch { @@ -553,7 +554,7 @@ func (p *Plan) Wire() vcvalue.Object { } // FieldContext is one field's context as the guest reads it: the label as a -// flat list of its segments, then each extension part nested to the left — +// flat list of its segments, then each scope nested to the left — // [[["users", "age"], 7], "eu"] — exactly the shape se_term takes for a // probe of that field. Under a context field the label is the identity // alone: [["age"], 7]. diff --git a/languages/golang/stashgen/engine.go b/languages/golang/stashgen/engine.go index 8b3db53ed..9cc279bdd 100644 --- a/languages/golang/stashgen/engine.go +++ b/languages/golang/stashgen/engine.go @@ -441,7 +441,7 @@ func kindWord(k record.Kind) string { // describeField names what the engine was asked for a field: the EQL type // it names, or its outputs. For an EQL type the engine refuses, the refusal // is the engine's (an unknown or unproducible type, a kind other than its -// plaintext, an extended context); the name is what a reader needs. +// plaintext, a context with scopes or bindings); the name is what a reader needs. func describeField(f record.Field) string { if f.IsTarget() { return "the EQL type " + f.Target diff --git a/languages/golang/stashgen/testdata/stubsdk/encrypt/encrypt.go b/languages/golang/stashgen/testdata/stubsdk/encrypt/encrypt.go index e15eb2e04..a89e1560a 100644 --- a/languages/golang/stashgen/testdata/stubsdk/encrypt/encrypt.go +++ b/languages/golang/stashgen/testdata/stubsdk/encrypt/encrypt.go @@ -12,7 +12,7 @@ import ( "time" ) -// Cipher is a keyset with any extension of the context. +// Cipher is a keyset with any scopes of the context. type Cipher struct{ _ struct{} } // Client decrypts under the keyset that sealed each value. From 263fdffb225f6b9178452067e81ec904bf515d49 Mon Sep 17 00:00:00 2001 From: Lindsay Holmwood Date: Fri, 27 Nov 2026 15:47:49 +1100 Subject: [PATCH 4/4] docs(golang): say a Client opens only rows with no scope and no binding A row sealed through Cipher.Bind has its binding in the stored context, so a Client cannot open it either. The Cipher and Decrypter docs and the example now name both, as the README does. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CtEQzxj55RUn35dkbhdwQk --- languages/golang/encrypt/cipher.go | 5 +++-- languages/golang/encrypt/example/main.go | 2 +- languages/golang/encrypt/records.go | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/languages/golang/encrypt/cipher.go b/languages/golang/encrypt/cipher.go index 604070186..15ccd3f2c 100644 --- a/languages/golang/encrypt/cipher.go +++ b/languages/golang/encrypt/cipher.go @@ -15,8 +15,9 @@ import ( // leaf sealed under another keyset is refused as [ErrForeignKeyset] before // any key is retrieved. To open ciphertexts from any keyset, pass the // [Client] where a [Decrypter] is taken. A Client opens only rows that a -// cipher with no scope encrypted; rows sealed through [Cipher.Scope] -// open only through a cipher with the same scopes. +// cipher with no scope and no binding encrypted; rows sealed through +// [Cipher.Scope] or [Cipher.Bind] open only through a cipher with the same +// scopes and bindings. // // A Cipher holds no guest state: the keyset is selected on every call, and // loaded by the guest on first use, so one is cheap to make per request or diff --git a/languages/golang/encrypt/example/main.go b/languages/golang/encrypt/example/main.go index aed5231e7..8e996dadd 100644 --- a/languages/golang/encrypt/example/main.go +++ b/languages/golang/encrypt/example/main.go @@ -57,7 +57,7 @@ func run(ctx context.Context) error { // Decrypt through the cipher. It carries the scope that Encrypt used, // and it refuses rows from another keyset. The client would refuse these - // rows: it opens only rows sealed with no scope. + // rows: it opens only rows sealed with no scope and no binding. // // Audit gives the cipher audit metadata: facts about the call, which // ZeroKMS writes to its audit log with the request for the data keys. diff --git a/languages/golang/encrypt/records.go b/languages/golang/encrypt/records.go index 502c2ec36..3cb5676f7 100644 --- a/languages/golang/encrypt/records.go +++ b/languages/golang/encrypt/records.go @@ -20,9 +20,9 @@ import ( // Decrypter opens records: a *Cipher, which refuses a record sealed under // another keyset before any key is retrieved, or a *Client, which opens each // record under the keyset that sealed it. A *Client opens only records that -// a cipher with no scope sealed, and checks no stored context field -// against a label: that is [Cipher.Context]. Generated Decrypt functions -// take one. Its method is for generated code; a program does not call it. +// a cipher with no scope and no binding sealed, and checks no stored +// context field against a label: that is [Cipher.Context]. Generated +// Decrypt functions take one. Its method is for generated code; a program does not call it. type Decrypter interface { Open(ctx context.Context, plan *record.Plan, records []record.Sealed) ([]record.Source, error) }