|
@@ -0,0 +1,38 @@
|
|
|
+use curve25519_dalek::edwards::EdwardsPoint;
|
|
|
+use curve25519_dalek::scalar::Scalar;
|
|
|
+
|
|
|
+pub type Secret = Scalar;
|
|
|
+
|
|
|
+pub struct Share {}
|
|
|
+
|
|
|
+pub struct Commitment {}
|
|
|
+
|
|
|
+/// Create secret shares for a given secret.
|
|
|
+pub fn generate_shares(secret: Secret, numshares: u32, threshold: u32) -> Result<(Commitment, Vec<Share>), &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|
|
|
+
|
|
|
+/// Verify that a share is consistent with a commitment.
|
|
|
+pub fn verify_share(share: Share, commitment: Commitment) -> Result<bool, &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|
|
|
+
|
|
|
+/// Reconstruct the secret from enough (at least the threshold) already-verified shares.
|
|
|
+pub fn reconstruct_secret(shares: &Vec<Share>) -> Result<Share, &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|
|
|
+
|
|
|
+/// Create a proactive update.
|
|
|
+pub fn create_update(numshares: u32, threshold: u32) -> Result<(Commitment, Vec<Share>), &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|
|
|
+
|
|
|
+/// Apply the commitment for the update to the master commitment.
|
|
|
+pub fn apply_commitment_update(oldcommitment: &Commitment, update: &Commitment) -> Result<Commitment, &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|
|
|
+
|
|
|
+/// Apply the share update to an existing share
|
|
|
+pub fn apply_share_update(oldshare: &Share, update: &Share) -> Result<Share, &'static str> {
|
|
|
+ unimplemented!("Not yet implemented")
|
|
|
+}
|