|
@@ -103,7 +103,15 @@ pub struct Credential {
|
|
|
}
|
|
|
|
|
|
// A submodule for issuing credentials with 5 attributes, none of which
|
|
|
-// are blinded to the issuer.
|
|
|
+// are blinded to the issuer. We create these submodules because the
|
|
|
+// zero knowledge proofs (ZKPs) have to have the number of attributes
|
|
|
+// hardcoded. One might imagine a Rust macro that could generate
|
|
|
+// submodules like these automatically, but for now, if you need a
|
|
|
+// different number of attributes, or different combinations of blinded
|
|
|
+// attributes, it is hopefully straighforward to adapt these given ones.
|
|
|
+// Note that "nonblind" issuing case is special: the client doesn't do a
|
|
|
+// ZKP at all. The more general blinded issuing case is the next
|
|
|
+// submodule after this one.
|
|
|
pub mod issue_nonblind_5 {
|
|
|
use curve25519_dalek::ristretto::RistrettoPoint;
|
|
|
use curve25519_dalek::ristretto::RistrettoBasepointTable;
|
|
@@ -386,6 +394,8 @@ pub mod issue_blind124_5 {
|
|
|
let d: Scalar = Scalar::random(&mut rng);
|
|
|
let D: RistrettoPoint = &d * Btable;
|
|
|
|
|
|
+ // Encrypt the attributes to be blinded (each times the
|
|
|
+ // basepoint B) to the public key we just created
|
|
|
let e1: Scalar = Scalar::random(&mut rng);
|
|
|
let e2: Scalar = Scalar::random(&mut rng);
|
|
|
let e4: Scalar = Scalar::random(&mut rng);
|
|
@@ -586,7 +596,8 @@ pub mod issue_blind124_5 {
|
|
|
}
|
|
|
|
|
|
// A submodule for showing credentials with 5 attributes, blinding
|
|
|
-// attributes 3, 4, and 5, and displaying attributes 1 and 2.
|
|
|
+// attributes 3, 4, and 5, and displaying attributes 1 and 2. As above,
|
|
|
+// this could possibly be generated by a Rust macro in the future.
|
|
|
pub mod show_blind345_5 {
|
|
|
use curve25519_dalek::ristretto::RistrettoPoint;
|
|
|
use curve25519_dalek::ristretto::RistrettoBasepointTable;
|