cred.rs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*! The various credentials used by the system. In each case, (P,Q)
  2. * forms the MAC on the credential. This MAC is verifiable only by the
  3. * issuing party, or if the issuing party issues a zero-knowledge proof
  4. * of its correctness (as it does at issuing time). */
  5. use curve25519_dalek::ristretto::RistrettoPoint;
  6. use curve25519_dalek::scalar::Scalar;
  7. /// A migration credential. This credential authorizes the holder of
  8. /// the Lox credential with the given id to switch from bucket
  9. /// from_bucket to bucket to_bucket.
  10. pub struct Migration {
  11. pub P: RistrettoPoint,
  12. pub Q: RistrettoPoint,
  13. pub lox_id: Scalar,
  14. pub from_bucket: Scalar,
  15. pub to_bucket: Scalar,
  16. }
  17. /// The main user credential in the Lox system. Its id is jointly
  18. /// generated by the user and the BA (bridge authority), but known only
  19. /// to the user. The level_since date is the Julian date of when this
  20. /// user was changed to the current trust level. (P_noopmigration,
  21. /// Q_noopmigration) are the MAC on the implicit no-op migration
  22. /// credential formed by the attributes (id, bucket, bucket), which
  23. /// authorizes the user to switch from its current bucket to the same
  24. /// bucket (i.e., a no-op). This can be useful for hiding from the BA
  25. /// whether or not the user is performing a bucket migration.
  26. pub struct Lox {
  27. pub P: RistrettoPoint,
  28. pub Q: RistrettoPoint,
  29. pub id: Scalar,
  30. pub bucket: Scalar,
  31. pub trust_level: Scalar,
  32. pub level_since: Scalar,
  33. pub invites_remaining: Scalar,
  34. pub invites_issued: Scalar,
  35. pub P_noopmigration: RistrettoPoint,
  36. pub Q_noopmigration: RistrettoPoint,
  37. }