Browse Source

Change the macro name for CMZ14 from CMZProtocol to CMZ14Protocol

The macro name for µCMZ is still called muCMZProtocol
Ian Goldberg 5 months ago
parent
commit
42e06646a9
4 changed files with 15 additions and 15 deletions
  1. 7 7
      README.md
  2. 6 6
      cmzcred_derive/src/lib.rs
  3. 1 1
      tests/basic.rs
  4. 1 1
      tests/wallet.rs

+ 7 - 7
README.md

@@ -97,10 +97,10 @@ also unknown to the issuer, so that the issuer cannot track clients from
 transaction to transaction.  Items for purchase are represented by
 transaction to transaction.  Items for purchase are represented by
 credentials that anyone can download from the issuer's website.
 credentials that anyone can download from the issuer's website.
 
 
-The primary way to create a protocol is with the `CMZProtocol!` macro.
+The primary way to create a protocol is with the `muCMZProtocol!` macro.
 
 
 ```rust
 ```rust
-    CMZProtocol! { wallet_spend,
+    muCMZProtocol! { wallet_spend,
       [ W: Wallet { randid: R, balance: H },
       [ W: Wallet { randid: R, balance: H },
         I: Item { serialno: H, price: H } ],
         I: Item { serialno: H, price: H } ],
       N: Wallet { randid: J, balance: H },
       N: Wallet { randid: J, balance: H },
@@ -247,7 +247,7 @@ attributes.  It is the job of the `fill_creds` callback to:
 
 
 The `handle` function will then check that the credentials shown by the
 The `handle` function will then check that the credentials shown by the
 client are all valid, and that the statements given in the
 client are all valid, and that the statements given in the
-`CMZProtocol!` macro call are all true.  If not, it will return with an
+`muCMZProtocol!` macro call are all true.  If not, it will return with an
 `Err`.  If so, `handle` will call the `authorize` callback, which can do
 `Err`.  If so, `handle` will call the `authorize` callback, which can do
 any final application-specific checks on the credentials (and any other
 any final application-specific checks on the credentials (and any other
 state it can access in its closure).  If `authorize` returns `Err`, so
 state it can access in its closure).  If `authorize` returns `Err`, so
@@ -281,17 +281,17 @@ or if as in this case, there's just one, as a single element.
 
 
 A protocol can optionally be declared as having _parameters_, which are
 A protocol can optionally be declared as having _parameters_, which are
 public Scalar constants that will be filled in at runtime.  You declare
 public Scalar constants that will be filled in at runtime.  You declare
-parameters by changing the first line of the `CMZProtocol!` macro
+parameters by changing the first line of the `muCMZProtocol!` macro
 invocation from, for example:
 invocation from, for example:
 
 
 ```rust
 ```rust
-    CMZProtocol! { proto_name,
+    muCMZProtocol! { proto_name,
 ```
 ```
 
 
 to:
 to:
 
 
 ```rust
 ```rust
-    CMZProtocol! { proto_name<param1, param2>,
+    muCMZProtocol! { proto_name<param1, param2>,
 ```
 ```
 
 
 then you can use `param1` and `param2` wherever you could have used a
 then you can use `param1` and `param2` wherever you could have used a
@@ -299,7 +299,7 @@ literal Scalar constant in the statements in the statement list.  For
 example:
 example:
 
 
 ```rust
 ```rust
-    CMZProtocol! { wallet_spend<fee>,
+    muCMZProtocol! { wallet_spend<fee>,
       [ W: Wallet { randid: R, balance: H },
       [ W: Wallet { randid: R, balance: H },
         I: Item { serialno: H, price: H } ],
         I: Item { serialno: H, price: H } ],
       N: Wallet { randid: J, balance: H },
       N: Wallet { randid: J, balance: H },

+ 6 - 6
cmzcred_derive/src/lib.rs

@@ -1,4 +1,4 @@
-// We want the macros like CMZProtocol to be camel case
+// We want the macros like CMZ14Protocol to be camel case
 #![allow(non_snake_case)]
 #![allow(non_snake_case)]
 
 
 /*! The implementation of the CMZCred derive.
 /*! The implementation of the CMZCred derive.
@@ -192,7 +192,7 @@ pub fn cmzcred_derive(input: TokenStream) -> TokenStream {
 
 
    The format is:
    The format is:
 
 
-   let proto = CMZProtocol! { proto_name<param1,param2>,
+   let proto = muCMZProtocol! { proto_name<param1,param2>,
      [ A: Cred {
      [ A: Cred {
          attr1: H,
          attr1: H,
          attr2: R,
          attr2: R,
@@ -2038,7 +2038,7 @@ fn protocol_macro(
 }
 }
 
 
 /** There are six variants of the `CMZProtocol` macro.  The ones starting
 /** There are six variants of the `CMZProtocol` macro.  The ones starting
-  with "CMZ" create protocol implementations using the original CMZ14
+  with "CMZ14" create protocol implementations using the original CMZ14
   issuing protocol.  The ones starting with "muCMZ" using the more
   issuing protocol.  The ones starting with "muCMZ" using the more
   efficient µCMZ protocol.  The ones with "Cli" only create the code
   efficient µCMZ protocol.  The ones with "Cli" only create the code
   for the client side of the protocol.  The ones with "Iss" only create
   for the client side of the protocol.  The ones with "Iss" only create
@@ -2046,17 +2046,17 @@ fn protocol_macro(
   either create the code for both sides of the protocol.)
   either create the code for both sides of the protocol.)
 */
 */
 #[proc_macro]
 #[proc_macro]
-pub fn CMZProtocol(input: TokenStream) -> TokenStream {
+pub fn CMZ14Protocol(input: TokenStream) -> TokenStream {
     protocol_macro(input, false, true, true)
     protocol_macro(input, false, true, true)
 }
 }
 
 
 #[proc_macro]
 #[proc_macro]
-pub fn CMZCliProtocol(input: TokenStream) -> TokenStream {
+pub fn CMZ14CliProtocol(input: TokenStream) -> TokenStream {
     protocol_macro(input, false, true, false)
     protocol_macro(input, false, true, false)
 }
 }
 
 
 #[proc_macro]
 #[proc_macro]
-pub fn CMZIssProtocol(input: TokenStream) -> TokenStream {
+pub fn CMZ14IssProtocol(input: TokenStream) -> TokenStream {
     protocol_macro(input, false, false, true)
     protocol_macro(input, false, false, true)
 }
 }
 
 

+ 1 - 1
tests/basic.rs

@@ -10,7 +10,7 @@ CMZ! { Basic<RistrettoPoint> :
     attr2
     attr2
 }
 }
 
 
-CMZProtocol! { basic_proto,
+CMZ14Protocol! { basic_proto,
 A: Basic {
 A: Basic {
     attr1: H,
     attr1: H,
     attr2: H,
     attr2: H,

+ 1 - 1
tests/wallet.rs

@@ -204,7 +204,7 @@ macro_rules! protos_def {
     };
     };
 }
 }
 
 
-protos_def! {CMZProtocol, cmz14_wallet_issue, cmz14_item_issue, cmz14_wallet_spend,
+protos_def! {CMZ14Protocol, cmz14_wallet_issue, cmz14_item_issue, cmz14_wallet_spend,
 cmz14_wallet_spend_with_fee, cmz_gen_keys, test_cmz14_wallet}
 cmz14_wallet_spend_with_fee, cmz_gen_keys, test_cmz14_wallet}
 
 
 protos_def! {muCMZProtocol, mu_wallet_issue, mu_item_issue,
 protos_def! {muCMZProtocol, mu_wallet_issue, mu_item_issue,