Summary
Expose encrypted array indexing in squid: given a Ciphertext<T> encoding an index, select one Ciphertext<T> from a collection without revealing which element was chosen.
Background
Poulpy's bdd_arithmetic module exposes three primitives for this, each with different trade-offs:
GLWEBlindSelection — binary CMux tree over a HashMap; best for random map access
GLWEBlindRetriever — stateful streaming accumulator (add / flush); best for large collections processed one element at a time
GLWEBlindRetrieval — in-place Cswap butterfly network over a Vec; best when the full collection needs to stay in memory after selection
All three bootstrap on every gate (CMux / Cswap), so they do not accumulate unbounded noise.
Work
- Define a default path (likely
GLWEBlindSelection as the simplest) exposed via ctx.select(&selector, inputs, &ek)
- Document when users should prefer each of the three alternatives over the default
- Follow the safe-defaults convention from
conventions.mdc
Summary
Expose encrypted array indexing in squid: given a
Ciphertext<T>encoding an index, select oneCiphertext<T>from a collection without revealing which element was chosen.Background
Poulpy's
bdd_arithmeticmodule exposes three primitives for this, each with different trade-offs:GLWEBlindSelection— binary CMux tree over aHashMap; best for random map accessGLWEBlindRetriever— stateful streaming accumulator (add/flush); best for large collections processed one element at a timeGLWEBlindRetrieval— in-place Cswap butterfly network over aVec; best when the full collection needs to stay in memory after selectionAll three bootstrap on every gate (CMux / Cswap), so they do not accumulate unbounded noise.
Work
GLWEBlindSelectionas the simplest) exposed viactx.select(&selector, inputs, &ek)conventions.mdc