I would like a data structure supporting two operations: $\mathsf{set}(k,v)$ and $\mathsf{get}(k)$, with the following properties:
- $k$ can be any number between $0$ and something impressively large, like $2^{256}-1$.
- If there is some $v$ such that $\mathsf{set}(k,v)$ has been called then $\mathsf{get}(k)$ returns the most recent such $v$.
- There is no way to learn anything about which $k$ and $v$ are such that $\mathsf{set}(k,v)$ has been called (but it might be possible to determine information that does not have to do with specific $k$ and $v$, e.g., it might be possible to learn how many times set has been called or on how many different $k$ it has been called).
- Space and time complexity are bounded by reasonable functions of the total number of calls to set and get (or better yet by a reasonable function of the number of keys set has been called on).
An attacker would learn everything I know, so the solution cannot be based on me retaining any secrets. But an attacker would not see the sequence of $\mathsf{set}$ and $\mathsf{get}$ operations since that would allow knowing what $\mathsf{set}$ has been called on. An example of a data structure that would meet all my demands except for the computational complexity ones is to create at time zero an array of size $2^{256}$ populated by random data and then update and query it as a normal array.
I assume a fixed field length for $v$ and also that the data being stored in $v$ is effectively random. The meaning of the last statement is a bit subtle. If $v$ is a 256-bit field then storing all zeros in a place in the array will effectively give away that it has been set. If $v$ is a 1-bit field then storing any particular value in any particular place will not give anything away, but other patterns, like storing more zeros than ones might. Imagine that the attacker has a correct guess about what the set of set keys is. Depending on how the array was used, he might be able to become more certain of his guess by querying the array. I simply want a data structure that doesn't give up any more information than strictly necessary beyond the infeasible full array of length $2^{256}$ initially stocked with random data.
Obviously it will have to give up a little more information because it will get bigger depending on how much data it has in it (compare black holes), but ideally the approximate number of keys set is all the information it will leak. Actually, it will not have to progressively give up more information if the maximum amount of data the structure can contain is fixed at creation time. And the partial solutions to the problem that are given below by otus and myself require the size to be fixed in this way anyway.
Is there such a data structure? Also, what is a good reference for this kind of question?
The attacker only gets to see the final data structure. The concept of history-independent data structures looks really interesting, but I am skeptical that literature will help with my problem. Among other things, the couple of papers I looked at seemed to use a threat model where the attacker has infinite computational resources, but it is impossible to solve the problem under that threat model.