Skip to content

Go SDK: int16 is widened to Int32, and there's no way to encrypt a date, timestamp, decimal or 128-bit integer #1144

Closed

Description

@coderdan

Background

The Go SDK (languages/golang) encrypts Go struct fields. stashgen
generates the code, and encrypt/gensupport converts Go values into
vitaminc value kinds.

Problem

  1. int8 and int16 are widened to Int32, and the unsigned widths to
    UInt32 (encrypt/gensupport/declaration.go:22-23). That fixes the wrong
    kind into every stored ciphertext and term.
  2. time.Time could mean a date or a timestamp, and there is no date type.
  3. There is no mapping for decimals or 128-bit integers.
  4. eql_gen.go refuses every numeric and date EQL type (stashgen refuses every number, date and boolean EQL type — produce them in EQL v4 using ADR-0002's encodings #1130).

The Go SDK hasn't been released, so changing the mapping now costs nothing.
After release it needs a data migration.

Proposal

  1. Map each integer width to its own kind. Add Int128 and Uint128 value
    types.
  2. time.Time maps to Timestamp, and encrypt.Date{Year, Month, Day} is a
    date. A field whose EQL target is a date family accepts time.Time,
    truncated to its UTC calendar day.
  3. Add a decimal mapping that refuses NaN and ±Infinity.
  4. Update record.Kind, the gensupport conversions and stashgen's type
    mapping. Regenerate eql_gen.go against v4. Change the eql_v3 strings to
    eql_v4 (about 245 lines).
  5. Run vitaminc's shared value-level vectors (aead-value: a cross-language conformance corpus for the FFI transport codec vitaminc#332).

Must land before the Go SDK ships (#1046). Needs #1140 and #1142. Decided in
ADR-0002 (#1139).

Activity

  1. coderdan commented on Oct 17, 2026

    @coderdan
    ContributorAuthor

    Related: #1236 derives order terms for the new kinds (dates, timestamps, decimals) once they exist on the Go side.

  2. coderdan commented on Oct 18, 2026

    @coderdan
    ContributorAuthor

    The EQL v4 side of 128-bit integers (an EQL type to store them in, plus equality and order terms) is tracked in #1251.

  3. 2 remaining items

  4. added
    StagedDone in the next branch; closes when next merges into main
    on Oct 18, 2026
  5. self-assigned this
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

SDKStagedDone in the next branch; closes when next merges into mainenhancementNew feature or request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions