Right now, the creation of KeySharePublic and KeySharePrivate happens on-the-fly in a function called new_keyshare, and the fields on those types are public and mutable. It would be better to have private, read-only fields with a validated constructor so that we are more confident that those types are always correct.
Update: the fields are now private, as of #371.
Since the public key share is derived from the private, it makes sense to either derive them together in a single constructor or require that the public type be derived from an existing private instance, as for paillier::{EncryptionKey, DecryptionKey}.
Related issue: #52. PiSch public and private inputs are just key shares.
[x] Make methods to generate public / private key shares -- done in #371
[x] Make all fields on key shares private, add getter functions if necessary -- done in #371
[ ] Remove the new_keyshare function and replace with a direct call to the constructors
Right now, the creation of
KeySharePublic
andKeySharePrivate
happens on-the-fly in a function callednew_keyshare
, and the fields on those types are public and mutable. It would be better to have private, read-only fields with a validated constructor so that we are more confident that those types are always correct.Update: the fields are now private, as of #371.
Since the public key share is derived from the private, it makes sense to either derive them together in a single constructor or require that the public type be derived from an existing private instance, as for
paillier::{EncryptionKey, DecryptionKey}
.Related issue: #52. PiSch public and private inputs are just key shares.
new_keyshare
function and replace with a direct call to the constructors