|
|
@@ -1,48 +0,0 @@
|
|
|
-use curve25519_dalek::ristretto::RistrettoPoint;
|
|
|
-use std::collections::HashMap;
|
|
|
-
|
|
|
-// The `CMZ` attribute will automatically add a `MAC: (Point,Point)` field
|
|
|
-// to the struct, create a `Privates` struct for the attributes, and a
|
|
|
-// `Publics` struct for the public keys for the credential. It will also
|
|
|
-// add issuing and showing methods, which each consume an indication of
|
|
|
-// which attributes to hide, reveal, issue jointly, etc., and produce
|
|
|
-// a `Statement` that attests to the correctness of the issue or the show.
|
|
|
-// Then the Extension layer can use an `AndStatement` combinator to combine
|
|
|
-// that with whatever higher-layer logic is needed.
|
|
|
-
|
|
|
-pub enum IssueType {
|
|
|
- Select,
|
|
|
- Joint,
|
|
|
- Reveal,
|
|
|
- Hide,
|
|
|
-}
|
|
|
-
|
|
|
-pub enum ShowType {
|
|
|
- Reveal,
|
|
|
- Hide,
|
|
|
-}
|
|
|
-
|
|
|
-pub trait CMZ {
|
|
|
-
|
|
|
- AnnotatedCredential;
|
|
|
-
|
|
|
- // All fields will be cast as mapping from String -> Scalar
|
|
|
- // The annotated credential is ouput
|
|
|
- fn annotate(&self, Credential, IssuerKeys) -> Self;
|
|
|
- // All fields will be cast as mapping from String -> ShowType
|
|
|
- // Outputs AnnotatedShowCredential to be related to AnnotatedIssueCredential by Statement
|
|
|
- fn show_annotation(&self, HashMap<String, ShowType>) -> AnnotatedShowCredential;
|
|
|
-
|
|
|
- // All fields will be cast as mapping from String -> IssueType with an output statement
|
|
|
- // Outputs AnnotatedIssueCredential to be related to AnnotatedShowCredential by Statement
|
|
|
- fn issue_annotation(&self, HashMap<String, IssueType>) -> AnnotatedIssueCredential;
|
|
|
-
|
|
|
- // Takes the annotated show and issue type credentials as well as a statement that relates them
|
|
|
- // outputs the State, which contains the client generated attributes/scalars required to
|
|
|
- // build the new credential
|
|
|
- fn issue_request(&self, Vec<AnnotatedShowCredential>, Vec<AnnotatedIssueCredential>, Statement) -> (Request, State);
|
|
|
-
|
|
|
- //Takes the annotated credential and statement received from the issuer and builds the updated
|
|
|
- //credential
|
|
|
- fn handle_response(&self, AnnotatedIssueCredential, Statement) -> Credential;
|
|
|
-}
|