1.1. Dataserver
The dataserver is untrusted storage for arbitrary bytes.
It provides a hash map interface (i.e. key-value store interface) between memory location identifiers (see Memloc
) and file data (arbitrary bytes). Clients can add data to the dataserver by first requesting a fresh memory location (Memloc
, essentially a random string), then adding a new record to the dataserver that maps that location to the desired set of bytes.
All entries in the dataserver exist in a single, global namespace, and dataserver does not perform any access control. As a result, any entry on the dataserver can be overwritten or deleted by any user who knows the corresponding Memloc
.
As a reminder, the adversary can persistently observe operations made to either of the servers. Thus, the adversary can observe which users store each \((\mathrm{location}, \mathrm{data})\) pair in each of the servers, the Memloc
s used, and the order in which dataserver entries are stored, accessed, or deleted.
- dataserver.Set(location: Memloc, value: bytes)
Stores
value
at locationlocation
on the dataserver.If
location
already has an existing value, overwrites the old value atlocation
withvalue
.- Parameters:
location (
Memloc
) – The location to storevalue
atvalue (bytes) – The value to store at
location
- Raises:
ValueError – if
value
is not of typebytes
- dataserver.Get(location: Memloc) bytes
Returns the value stored at
location
on the dataserver.Raises an error if
location
does not exist in the dataserver.- Parameters:
location (
Memloc
) – The location to retrieve a value from- Raises:
ValueError – if
location
does not exist in the dataserver
- dataserver.Delete(location: Memloc)
Deletes the given value at
location
from the dataserver, if it exists.Acts as a no-op if
location
has no associated value on the dataserver.- Parameters:
location (
Memloc
) – The location to delete
1.1.1. Extra Testing Functions
For testing purposes only (i.e. you are not permitted to use the API in this section in your client implementation), we also provide the following function:
- dataserver.GetMap() dict[Memloc, bytes]
Returns the entries stored on the dataserver as a Python dictionary.
This may be useful for testing purposes and simulating adversary attacks against your implementation. Specifically, you can compare the entries in the dictionary before (and after) calling a client function and use the difference to deduce where things are stored.
- Returns:
The entries stored on the dataserver
- Return type:
dict[Memloc, bytes]