vss.rs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. use curve25519_dalek::edwards::EdwardsPoint;
  2. use curve25519_dalek::scalar::Scalar;
  3. pub type Secret = Scalar;
  4. pub struct Share {}
  5. pub struct Commitment {}
  6. /// Create secret shares for a given secret.
  7. pub fn generate_shares(secret: Secret, numshares: u32, threshold: u32) -> Result<(Commitment, Vec<Share>), &'static str> {
  8. unimplemented!("Not yet implemented")
  9. }
  10. /// Verify that a share is consistent with a commitment.
  11. pub fn verify_share(share: Share, commitment: Commitment) -> Result<bool, &'static str> {
  12. unimplemented!("Not yet implemented")
  13. }
  14. /// Reconstruct the secret from enough (at least the threshold) already-verified shares.
  15. pub fn reconstruct_secret(shares: &Vec<Share>) -> Result<Share, &'static str> {
  16. unimplemented!("Not yet implemented")
  17. }
  18. /// Create a proactive update.
  19. pub fn create_update(numshares: u32, threshold: u32) -> Result<(Commitment, Vec<Share>), &'static str> {
  20. unimplemented!("Not yet implemented")
  21. }
  22. /// Apply the commitment for the update to the master commitment.
  23. pub fn apply_commitment_update(oldcommitment: &Commitment, update: &Commitment) -> Result<Commitment, &'static str> {
  24. unimplemented!("Not yet implemented")
  25. }
  26. /// Apply the share update to an existing share
  27. pub fn apply_share_update(oldshare: &Share, update: &Share) -> Result<Share, &'static str> {
  28. unimplemented!("Not yet implemented")
  29. }