Repository navigation
Commit dd50714
committed
feat(stack-encrypt): indexes as types, passthrough and run_decryption
The plan builder is meant to be a thin lowering onto the combinators, and
three things it needs were missing.
Indexes. Every caller (the derive, dynamic::record) spelled out
ciphertext().accepting().zip(equality()).zip(..).map(..) itself, with the
nested-pair bookkeeping. Index<S> makes one index a type, implemented only
for the plaintexts its scheme is defined over, so a match index on an
integer does not compile. Indexes<S> is one index or a tuple of two to
four, and deliberately not (), so an indexed field with no index is a
compile error rather than a quiet ciphertext-only field. indexed(idx) does
the composition once and returns Encrypted<Terms>: the ciphertext and the
terms as a tuple, read by destructuring. spec() lowers an index to data
(IndexSpec) for the FFI and saved plans, with a match index's options;
Indexes::select picks one index for the query side. The bytes are the hand
composition's and the derive's, which the tests pin.
passthrough(). A plan can carry a field unsealed. The engine had no
operation that just returns the source; this is it, moving the value in
owned mode and cloning it in borrowed mode, ignoring the context. Its
rustdoc says it is not authenticated and what to use instead.
run_decryption(). KeysetCipher::run already executes an Encryption held in
a variable; this is the Decryption counterpart, on the keyset (which
refuses a foreign leaf) and on the client.1 parent be7359f commit dd50714
12 files changed
Lines changed: 1189 additions & 3 deletions
File tree
- packages/stack-encrypt
- src
- target
- tests
- ui
- pass
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
295 | | - | |
| 295 | + | |
| 296 | + | |
296 | 297 | | |
297 | 298 | | |
298 | 299 | | |
| |||
0 commit comments