@@ -44,8 +44,10 @@ import {
4444 BlindSignatureType ,
4545 BoundCheckParamType ,
4646 BoundType ,
47- ID_STR , MEM_CHECK_KV_STR ,
48- MEM_CHECK_STR , NON_MEM_CHECK_KV_STR ,
47+ ID_STR ,
48+ MEM_CHECK_KV_STR ,
49+ MEM_CHECK_STR ,
50+ NON_MEM_CHECK_KV_STR ,
4951 NON_MEM_CHECK_STR ,
5052 PublicKey ,
5153 REV_CHECK_STR ,
@@ -64,43 +66,67 @@ type Credential = BBSCredential | BBSPlusCredential | PSCredential;
6466 * Creates a request for a blinded credential, i.e. where some of the attributes are not known to the signer
6567 */
6668export abstract class BlindedCredentialRequestBuilder < SigParams > extends Versioned {
67- // NOTE: Follows semver and must be updated accordingly when the logic of this class changes or the
68- // underlying crypto changes.
69+ /**
70+ * Follows semver and must be updated accordingly when the logic of this class changes or the
71+ * underlying crypto changes.
72+ */
6973 static VERSION = '0.5.0' ;
7074
71- // The schema of the whole (unblinded credential). This should include all attributes, i.e. blinded and unblinded
75+ /**
76+ * The schema of the whole (unblinded credential). This should include all attributes, i.e. blinded and unblinded
77+ */
7278 _schema ?: CredentialSchema ;
7379
74- // The attributes of the credential subject that will be blinded (hidden from the issuer)
80+ /**
81+ * The attributes of the credential subject that will be blinded (hidden from the issuer)
82+ */
7583 _subjectToBlind ?: object | object [ ] ;
7684
77- // The credential status if blinded
85+ /**
86+ * The credential status if blinded
87+ */
7888 _statusToBlind ?: object ;
7989
80- // Any top level attributes to blind
90+ /**
91+ * Any top level attributes to blind
92+ */
8193 _topLevelAttributesToBlind : Map < string , unknown > ;
8294
8395 protected sigParams ?: SignatureParams ;
8496
85- // A blinded credential request will contain a presentation that will prove predicates about the credential attributes and blinded attributes.
97+ /**
98+ * A blinded credential request will contain a presentation that will prove predicates about the credential attributes and blinded attributes.
99+ */
86100 presentationBuilder : PresentationBuilder ;
87101
88- // Equalities between blinded and credential attributes
102+ /**
103+ * Equalities between blinded and credential attributes
104+ */
89105 attributeEqualities : BlindedAttributeEquality [ ] ;
90106
91- // Attributes proved inequal to a public value in zero knowledge. An attribute can be proven inequal to any number of values
107+ /**
108+ * Attributes proved inequal to a public value in zero knowledge. An attribute can be proven inequal to any number of values
109+ */
92110 attributeInequalities : Map < string , [ IPresentedAttributeInequality , Uint8Array ] [ ] > ;
93111
94- // Bounds on blinded attributes
112+ /**
113+ * Bounds on blinded attributes
114+ */
95115 bounds : Map < string , IPresentedAttributeBound [ ] > ;
96116
97- // Encryption of blinded attributes
117+ /**
118+ * Encryption of blinded attributes
119+ */
98120 verifEnc : Map < string , IPresentedAttributeVE [ ] > ;
99121
100- // Circom predicates on blinded attributes
122+ /**
123+ * Circom predicates on blinded attributes
124+ */
101125 circomPredicates : IProverCircomPredicate [ ] ;
102126
103- // Pseudonyms on blinded and credential attributes
127+ /**
128+ * Pseudonyms on blinded and credential attributes
129+ */
104130 boundedPseudonyms : IProverBoundedPseudonymInBlindedCredReq [ ] ;
105131
106132 constructor ( ) {
@@ -140,10 +166,12 @@ export abstract class BlindedCredentialRequestBuilder<SigParams> extends Version
140166 * @param memberValue - Only this will be blinded.
141167 * @param revType
142168 */
143- statusToBlind ( registryId : string , revCheck : string , memberValue : unknown , revType = RevocationStatusProtocol . Vb22 ) {
169+ statusToBlind ( registryId : string , revCheck : string , memberValue : unknown , revType = RevocationStatusProtocol . Vb22 ) {
144170 if ( revType === RevocationStatusProtocol . Vb22 ) {
145171 if ( revCheck !== MEM_CHECK_STR && revCheck !== NON_MEM_CHECK_STR && revCheck !== MEM_CHECK_KV_STR ) {
146- throw new Error ( `Revocation check should be either ${ MEM_CHECK_STR } or ${ NON_MEM_CHECK_STR } or ${ MEM_CHECK_KV_STR } but was ${ revCheck } ` ) ;
172+ throw new Error (
173+ `Revocation check should be either ${ MEM_CHECK_STR } or ${ NON_MEM_CHECK_STR } or ${ MEM_CHECK_KV_STR } but was ${ revCheck } `
174+ ) ;
147175 }
148176 }
149177 if ( revType == RevocationStatusProtocol . KbUni24 ) {
@@ -519,9 +547,9 @@ export abstract class BlindedCredentialRequestBuilder<SigParams> extends Version
519547 [ STATUS_STR ] : {
520548 [ TYPE_STR ] : this . _statusToBlind [ TYPE_STR ] ,
521549 [ ID_STR ] : this . _statusToBlind [ ID_STR ] ,
522- [ REV_CHECK_STR ] : this . _statusToBlind [ REV_CHECK_STR ] ,
550+ [ REV_CHECK_STR ] : this . _statusToBlind [ REV_CHECK_STR ]
523551 }
524- }
552+ } ;
525553 }
526554
527555 const blindedAttributes = unflatten ( attributesWithoutVals ) as object ;
0 commit comments