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
stack-encrypt: a set of terms that names one index twice compiles and is refused only at run time — refuse it at compile time #1670
Stack Encrypt (packages/stack-encrypt) is the Rust encryption engine that every CipherStash language SDK runs on. Encrypted<(EqualityTerm, OreTerm<u32>)> stores a ciphertext with one search term for each index in the tuple. A field may declare at most one index for each operator: two equality terms, two match terms, or ORE beside OPE are not allowed.
Problem
Since #1666, Encrypted<Terms> and a derived plaintext = T record refuse such a set with PlanError::DuplicateIndex or IndexOverlap before any key is requested. That is a run-time refusal. The plan's item Field markers and the encryption plan says a typed index set that repeats an index is refused at compile time. So Encrypted<(EqualityTerm, EqualityTerm)> still compiles, and the mistake shows only when the program runs.
Proposal
Refuse a repeated or overlapping index set in the type system, for example with a trait implemented only for valid tuples, or a const assertion over each index's declared operators.
Add tests/ui cases for (EqualityTerm, EqualityTerm) and (OreTerm<u32>, OpeTerm<u32>).
Keep target::check_indexes for the combinators composed by hand, or document that they do not check.
Activity