-
Notifications
You must be signed in to change notification settings - Fork 6
Description
For some applications, it would helpful to persist the OPRF key across restarts, or clone it among a cluster of instances. Implementing this is somewhat sensitive, since the whole point of the PPOPRF is to keep the private key private. Currently the ppoprf crate doesn't expose the private key.
I suggest the following design:
- Add a new command-line switch so
star-randsrv --generate-keywill create appoprf::Serverand dump the private key to stdout, then terminate. - At startup, look for a
STAR_RANDSRV_PRIVATE_KEYenv variable, and if set, use that key to construct theOPRFServerstate instead of a random one.
Terminating the application after generating the key separates the step from normal invocation, making it easier to keep the key material out of logs. Likewise with reading a existing key from the environment, rather than a command-line argument.
The shared key will be unpunctured. Passing the correct epoch synchronization arguments will take care of puncturing no-longer valid epochs as they would with a random key.
To implement, we will also need to extend the ppoprf crate with something like the following interface:
pub struct ServerPrivateKey(RistrettoScalar)
impl Server {
pub fn get_private_key(&self) -> ServerPrivateKey {
...
}
pub fn from_private_key(&ServerPrivateKey) -> Self {
...
}
}