You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7840c3a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(stack-encrypt)!: order text, encrypting every order term through cllw-ore's vitaminc schemes
Text could not be ordered: no ordering operator was answered on a text
field, and the ORE and OPE terms stored for text went through cllw-ore's
own collation, which keeps case, so Zoe ordered before alice and é after
z. ADR-0002 defines text's order key as its fold (Unicode 16 NFC with
case and accents folded), and vitaminc 0.6 ships it in vitaminc-ore.
cllw-ore 0.5.2-rc.1 implements vitaminc-ore's `OrderScheme` behind its
`vitaminc` feature, so Stack Encrypt encodes nothing for ordering itself.
An ORE or OPE term is now cllw-ore's `vitaminc::Ore` or `vitaminc::Ope`
encryption of the value: the engine names the value's order target
through the new sealed `sem::Orderable` (integers at their own width,
`f32`/`f64` as `F64`, text as `Text`, bytes as `Bytes`) and passes the
value straight through, on the typed path and for each scalar of a
dynamic value alike; cllw-ore encodes it with vitaminc-ore, text by the
fold. Café, cafe, CAFÉ and cafe with a combining accent are one term.
Text holding a code point Unicode 16 does not assign has no fold and no
order term, as it has no equality or match term; ADR-0002 is amended to
say vitaminc 0.6 refuses such a code point rather than passing it
through.
The per-index key derivation is kept: the PRF block keys the scheme
inside the visitor and is wiped there, and the column is opened with the
value's target and the empty context, since the key is already the
index's own. The key labels move to `/v2` because every order term
changes bytes (new column salt, cllw-ore's marker byte for text and
bytes). Every source type's term is now one ciphertext type
(`OreCllw8VariableV1`, `OpeCllw8VariableV1`); `OreTerm<T>`/`OpeTerm<T>`
keep `T` as a marker so typed callers compile unchanged, and
`sem::CllwOreEncrypt`/`CllwOpeEncrypt` are no longer re-exported. The
term pins and the record, query and value-kinds fixtures are re-recorded.
op::Ordered covers String, and the data path answers the orderings on
text too, refusing order text with no fold at its boundary, for one
value and for each bound of a range, through `vitaminc_ore::text`, the
encoding the `Text` target uses. The Go generator writes Lt, Lte, Gt,
Gte and Between on a string field with ore or ope; its notice is left
for order indexes on bytes or a float, and for a second order index.
Closes#1234.
Copy file name to clipboardExpand all lines: languages/golang/cmd/stashgen/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -124,7 +124,7 @@ For `-type User`, the file `user_stash.go` holds:
124
124
-`Fields`, with one entry for each sealed field.
125
125
An opaque struct, or a struct with no sealed field outside an opaque one, gets no `Fields`: nothing in it is sealed on its own, so nothing can be queried.
126
126
An entry encrypts one value, and has one query method for each operator the engine answers on the field: `Eq`, `Lt`, `Lte`, `Gt`, `Gte`, `Between` or `Matches`.
127
-
stashgen asks the embedded engine which operators each field answers, and which index answers each one, so it holds no copy of those rules: an equality index answers `Eq`, a match index on a string `Matches`, and an ORE or OPE index on an integer the four orderings and `Between`, through ORE when the field declares both.
127
+
stashgen asks the embedded engine which operators each field answers, and which index answers each one, so it holds no copy of those rules: an equality index answers `Eq`, a match index on a string `Matches`, and an ORE or OPE index on an integer or a string the four orderings and `Between`, through ORE when the field declares both. A string orders by its folded form: case and accents folded, under Unicode 16.
128
128
`encrypt_into=TextEq` answers `Eq`, which returns the type's query value, `eql.TextEqQuery`.
129
129
`encrypt_into=TextMatch` answers `Matches`, which returns an `encrypt.EQLMatchQuery`: the `eql.TextMatchQuery` operand, with `Verify` and `TargetLimit`.
130
130
The query of `Matches` carries `Verify` and `TargetLimit`, because its answer can hold rows that do not match; an exact operator's query carries neither.
| `index=ore` or `index=ope`, on an integer of any width | `Lt`, `Lte`, `Gt`, `Gte` | `encrypt.OreTerm`, or `encrypt.OpeTerm` when the field declares no `ore` |
305
+
| `index=ore` or `index=ope`, on an integer of 16 bits or wider or a string | `Lt`, `Lte`, `Gt`, `Gte` | `encrypt.OreTerm`, or `encrypt.OpeTerm` when the field declares no `ore` |
302
306
| the same | `Between(ctx, cipher, lo, hi)` | `encrypt.Range[encrypt.OreTerm]` or `encrypt.Range[encrypt.OpeTerm]`, the two bounds' terms |
303
307
| `index=match`, on a string | `Matches` | `encrypt.MatchQuery[T]` |
0 commit comments