<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<!-- name="GENERATOR" content="github.com/mmarkdown/mmark Mmark Markdown Processor - mmark.miek.nl" -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" version="3" ipr="trust200902" docName="draft-kalos-bbs-per-verifier-linkability-00" submissionType="IETF" category="info" xml:lang="en" indexInclude="true" consensus="true">

<front>
<title abbrev="BBS per Verifier Linkability">BBS per Verifier Linkability</title><seriesInfo value="draft-kalos-bbs-per-verifier-linkability-00" status="informational" name="Internet-Draft"/>
<author initials="V." surname="Kalos" fullname="Vasilis Kalos"><organization>MATTR</organization><address><postal><street/>
</postal><email>vasilis.kalos@mattr.global</email>
</address></author><author initials="G." surname="Bernstein" fullname="Greg Bernstein"><organization>Grotto Networking</organization><address><postal><street/>
</postal><email>gregb@grotto-networking.com</email>
</address></author><date/>
<area>Internet</area>
<workgroup>none</workgroup>

<abstract>
<t>The BBS Signatures scheme defined in <xref target="I-D.irtf-cfrg-bbs-signatures"/>, describes a multi-message digital signature, that supports selectively disclosing the messages through unlinkable presentations, built using zero-knowledge proofs. Each BBS proof reveals no information other than the signed messages that the Prover chooses to disclose in that specific instance. As such, the Verifier (i.e., the recipient) of the BBS proof, may not be able to track those presentations over time. Although in many applications this is desirable, there are use cases that require the Verifier be able to track the BBS proofs they receive from the same Prover. Examples include monitoring the use of access credentials for abnormal activity, monetization etc.. This document presents the use of pseudonyms with BBS proofs.</t>
<t>A pseudonym, is a value that will remain constant each time a Prover presents a BBS proof to the same Verifier, but will be different (and unlinkable), when the Prover interacts with a different Verifier. This provides a way for a recipient (Verifier) to track the presentations intended for them, while also hindering them from tracking the Prover's interactions with other Verifiers.</t>
</abstract>

</front>

<middle>

<section anchor="introduction"><name>Introduction</name>
<t>The BBS Signature Scheme, originally described in the academic work by Dan Boneh, Xavier Boyen, and Hovav Shacham <xref target="BBS04"/>, is a signature scheme able to sign multiple messages at once, allowing for selectively disclosing those message while not revealing the signature it self. It does so by creating unlinkable, zero-knowledge proofs-of-knowledge of a signature value on (among other) the disclosed set of messages. More specifically, the BBS Prover, will create a BBS proof that if validated by the Verifier, guarantees that the prover knows a BBS signature on the disclosed messages, guaranteeing the revealed messages authenticity and integrity.</t>
<t>The BBS Proof is by design unlinkable, meaning that given two different BBS proofs, there is no way to tell if they originated from the same BBS signature. This means that if a Prover does not reveal any other identifying information (for example if they are using proxies to hide their IP address etc.), the Verifier of the proof will not be able "track" or "correlate" the different proof presentations  or the Provers activity via cryptographic artifacts. This helps enhance user privacy in applications where the Verifier only needs to know that the Prover is in possession of a valid BBS signature over a list of disclosed messages.</t>
<t>In some applications, however, the Verifier needs to track the presentations made by the Prover over time, as to provide security monitoring, monetization services, configuration persistance etc.. To promote privacy reason, the Prover should not reveal or be bound to a unique identifier that would remain constant across proof presentations to different Verifiers and which could be used to link a Provers interactions with different Verifiers.</t>
<t>The goal of this document is to provide a way for a Verifier to track the proof presentations that are intended for them, while at the same time not allowing the tracking of the Prover's activities with other Verifiers. This is done through the use of Pseudonyms. A pseudonym as defined by this document, is a value that will be constant when the Prover presents BBS proofs to the same Verifier, but will change when the Prover interacts with different recipients (with no way to link the two distinct pseudonym values together). This is done by constructing the pseudonym value by combining a unique Verifier identifier with a unique Prover identifier.</t>
<t>To avoid forging requests, the Prover's identifier will be signed by the same BBS signature used to generate the BBS proof. This requires extending the BBS proof generation and verification operations with some additional computations that will be used to prove correctness of the pseudonym, i.e., that it was correctly calculated using the Verifier identifier, as well as, the undisclosed and signed Prover identifier. The Prover identifier MUST be considered secret from the point of view of the Prover, since, if it is revealed, any entity will be able to track the Prover's activity across any Verifiers.</t>
<t>This document will define new BBS Interfaces for use with pseudonyms, however it will not define new ciphersuites. Rather it will re-use the ciphersuites defined in <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-03.html#name-ciphersuites">Section 6</eref> of <xref target="I-D.irtf-cfrg-bbs-signatures"/>).</t>
<t>Pseudonyms when used appropriately prevent verifiers from linking prover (proof) presentations between them. We call this verifier-verifier collusion. In addition pseudonyms can be used to prevent the signer from linking prover presentations to a verifier. We call this verifier-signer collusion. This second property is not always desirable in all use cases, for example to allow tracking of purchases a controlled substance by a prover by a central authority while preventing tracking by individual shops.</t>

<section anchor="terminology"><name>Terminology</name>
<t>The following terminology is used throughout this document:</t>

<dl spacing="compact">
<dt>SK</dt>
<dd>The secret key for the signature scheme.</dd>
<dt>PK</dt>
<dd>The public key for the signature scheme.</dd>
<dt>L</dt>
<dd>The total number of signed messages.</dd>
<dt>R</dt>
<dd>The number of message indexes that are disclosed (revealed) in a proof-of-knowledge of a signature.</dd>
<dt>U</dt>
<dd>The number of message indexes that are undisclosed in a proof-of-knowledge of a signature.</dd>
<dt>scalar</dt>
<dd>An integer between 0 and r-1, where r is the prime order of the selected groups, defined by each ciphersuite (see also <eref target="#notation">Notation</eref>).</dd>
<dt>generator</dt>
<dd>A valid point on the selected subgroup of the curve being used that is employed to commit a value.</dd>
<dt>signature</dt>
<dd>The digital signature output.</dd>
<dt>presentation_header (ph)</dt>
<dd>A payload generated and bound to the context of a specific spk.</dd>
<dt>INVALID, ABORT</dt>
<dd>Error indicators. INVALID refers to an error encountered during the Deserialization or Procedure steps of an operation. An INVALID value can be returned by a subroutine and handled by the calling operation. ABORT indicates that one or more of the initial constraints defined by the operation are not met. In that case, the operation will stop execution. An operation calling a subroutine that aborted must also immediately abort.</dd>
</dl>
</section>

<section anchor="notation"><name>Notation</name>
<t>The following notation and primitives are used:</t>

<dl spacing="compact">
<dt>a || b</dt>
<dd>Denotes the concatenation of octet strings a and b.</dd>
<dt>I \ J</dt>
<dd>For sets I and J, denotes the difference of the two sets i.e., all the elements of I that do not appear in J, in the same order as they were in I.</dd>
<dt>X[a..b]</dt>
<dd>Denotes a slice of the array <tt>X</tt> containing all elements from and including the value at index <tt>a</tt> until and including the value at index <tt>b</tt>. Note when this syntax is applied to an octet string, each element in the array <tt>X</tt> is assumed to be a single byte.</dd>
<dt>X[-1]</dt>
<dd>Denotes the last element of the array X</dd>
<dt>range(a, b)</dt>
<dd>For integers a and b, with a &lt;= b, denotes the ascending ordered list of all integers between a and b inclusive (i.e., the integers "i" such that a &lt;= i &lt;= b).</dd>
<dt>length(input)</dt>
<dd>Takes as input either an array or an octet string. If the input is an array, returns the number of elements of the array. If the input is an octet string, returns the number of bytes of the inputted octet string.</dd>
</dl>
<t>Terms specific to pairing-friendly elliptic curves that are relevant to this document are restated below, originally defined in <xref target="I-D.irtf-cfrg-pairing-friendly-curves"/>.</t>

<dl spacing="compact">
<dt>E1, E2</dt>
<dd>elliptic curve groups defined over finite fields. This document assumes that E1 has a more compact representation than E2, i.e., because E1 is defined over a smaller field than E2. For a pairing-friendly curve, this document denotes operations in E1 and E2 in additive notation, i.e., P + Q denotes point addition and x * P denotes scalar multiplication.</dd>
<dt>G1, G2</dt>
<dd>subgroups of E1 and E2 (respectively) having prime order r.</dd>
<dt>GT</dt>
<dd>a subgroup, of prime order r, of the multiplicative group of a field extension.</dd>
<dt>e</dt>
<dd>G1 x G2 -&gt; GT: a non-degenerate bilinear map.</dd>
<dt>r</dt>
<dd>The prime order of the G1 and G2 subgroups.</dd>
<dt>BP1, BP2</dt>
<dd>base (constant) points on the G1 and G2 subgroups respectively.</dd>
<dt>Identity_G1, Identity_G2, Identity_GT</dt>
<dd>The identity element for the G1, G2, and GT subgroups respectively.</dd>
<dt>hash_to_curve_g1(ostr, dst) -&gt; P</dt>
<dd>A cryptographic hash function that takes an arbitrary octet string as input and returns a point in G1, using the hash_to_curve operation defined in <xref target="I-D.irtf-cfrg-hash-to-curve"/> and the inputted dst as the domain separation tag for that operation (more specifically, the inputted dst will become the DST parameter for the hash_to_field operation, called by hash_to_curve).</dd>
<dt>point_to_octets_g1(P) -&gt; ostr, point_to_octets_g2(P) -&gt; ostr</dt>
<dd>returns the canonical representation of the point P for the respective subgroup as an octet string. This operation is also known as serialization.</dd>
<dt>octets_to_point_g1(ostr) -&gt; P, octets_to_point_g2(ostr) -&gt; P</dt>
<dd>returns the point P for the respective subgroup corresponding to the canonical representation ostr, or INVALID if ostr is not a valid output of the respective point_to_octets_g* function. This operation is also known as deserialization.</dd>
</dl>
</section>
</section>

<section anchor="conventions-and-definitions"><name>Conventions and Definitions</name>
<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
</section>

<section anchor="key-concepts"><name>Key Concepts</name>
<t>A <em>pseudonym</em> will be cryptographically generated for each prover-context of usage pair. Its value is dependent on a pseudonym secret (<tt>nym_secret</tt>) and a context identifier (<tt>context_id</tt>).</t>

<section anchor="context-identifier"><name>Context Identifier</name>
<t>The Context Identifier (<tt>context_id</tt>) is an octet string that represents a specific context of usage, within which, the pseudonym will have a constant value. Context Identifiers can take the form of unique Verifier Identifiers, Session Identifiers etc., depending on the needs of the application. Verifiers will be able to use the Pseudonym values to track the presentations generated by a Prover, using the same signature, for that specific context.</t>
</section>

<section anchor="pseudonyms"><name>Pseudonyms</name>
<t>The <em>pseudonym</em> is a cryptographic value computed by the prover based on the <tt>nym_secret</tt> and the <tt>context_id</tt>. At a high level this is computed by hashing the <tt>context_id</tt> to the elliptic curve group G1 and then multiplying it by the <tt>nym_secret</tt> value. See Section <xref target="pseudonym-calculation-procedure"/> for details. The Pseudonym is sent to a verifier along with the BBS proof.</t>
<t>This document defines a pseudonym as point of the G1 group different from the Identity (<tt>Identity_G1</tt>) or the base point (<tt>BP1</tt>) of G1. A pseudonym remains constant for the same context, when combined with the same signature, but is unique (and unlinkable) across different contexts. In other words, when the Prover presents multiple BBS proofs with a pseudonym to a Verifier, the pseudonym value will be constant across those presentations, if the same <tt>context_id</tt> value is used. When presenting a BBS proof with a pseudonym to a different context, the pseudonym value will be different. Note that since pseudonyms are group points, their value will necessarily change if a different a ciphersuite with a different curve will be used. Serialization and deserialization of the pseudonym point MUST be done using the <tt>point_to_octets_g1</tt> and <tt>octets_to_point_g1</tt> defined by the BBS ciphersuite used (see <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-03.html#name-ciphersuites">Section 6</eref> of <xref target="I-D.irtf-cfrg-bbs-signatures"/>).</t>
<t>This document specifies pseudonyms to be BBS Interface specific (see Section TBD of <xref target="I-D.irtf-cfrg-bbs-signatures"/> for the definition of the BBS Interface). It is outside the scope of this document to provide a procedure for "linking" the pseudonyms that are used by different Interfaces or that are based on different ciphersuites. An option is for the Prover to present both Pseudonyms with the relevant BBS proofs to the Verifier, and upon validation of both, the Verifier to internally link the 2 pseudonyms together.</t>
</section>

<section anchor="mapping-messages-to-scalars"><name>Mapping Messages to Scalars</name>
<t>Each BBS Interface defines an operation that will map the inputted messages to scalar values, required by the core BBS operations. Each Interface can use a different mapping procedure, as long as it comforts to the requirements outlined in <xref target="I-D.irtf-cfrg-bbs-signatures"/>. For using BBS with pseudonyms, the mapping operation used by the interface is REQUIRED to additionally adhere the following rule;</t>

<artwork>For each set of messages and separate message msg',
if C1 = messages_to_scalars(messages.push(msg')),
and msg_prime_scalar = messages_to_scalars((msg')),
and C2 = messages_to_scalars(messages).push(msg_prime_scalar),
it will always hold that C1 == C2.
</artwork>
<t>Informally, the above means that each message is mapped to a scalar independently from all the other messages. For example, if <tt>a = messages_to_scalars((msg_1))</tt> and <tt>b = messages_to_scalars((msg_2))</tt>, then <tt>(a, b) = messages_to_scalars((msg_1, msg_2))</tt>. Its trivial to see that the <tt>messages_to_scalars</tt> operation that is defined in Section TBD of <xref target="I-D.irtf-cfrg-bbs-signatures"/>, has the required property. That operation will be used by the Interface defined in this document to map the messages to scalars. Note that the above operation (and hence the defined by this document Interface), only accepts messages that are octet strings.</t>
</section>
</section>

<section anchor="pseudonym-calculation-procedure"><name>Pseudonym Calculation Procedure</name>
<t>The following section describes how to calculate a pseudonym from a secret held by the Prover and the public context unique identifier. The pseudonym will be unique for different contexts (e.g., unique Verifier identifiers) and constant under constant inputs (i.e., the same <tt>context_id</tt> and <tt>nym_secret</tt>). The <tt>context_id</tt> is an octet string representing the unique identifier of the context in which the Pseudonym will have the same value. The <tt>nym_secret</tt> value is a scalar calculated from secret input provided by the Prover and random (but not secret) input provided by the Signer. This will guarantee uniqueness of the <tt>nym_secret</tt> between different signatures and users.</t>

<artwork>Pseudonym = hash_to_curve_g1(context_id) * nym_secret
</artwork>
<t>Additionally, the <tt>nym_secret</tt> value will be signed by the BBS Signature. This will bind the Pseudonym to a specific signature, held by the Prover. During proof generation, along the normal BBS proof, the Prover will generate a proof of correctness of the Pseudonym, i.e., that it has the form described above, and that it was constructed using a <tt>nym_secret</tt> signed by the BBS signature used to generate that proof.</t>
</section>

<section anchor="high-level-procedures-and-information-flows"><name>High Level Procedures and Information Flows</name>
<t>To prevent forgeries in all cases all BBS messages are signed with the inclusion of some form of the provider pseudonym secret (<tt>nym_secret</tt>). In addition the pseudonym is always computed by the prover and sent with the proof to the verifier. While two different variations of signature and proof generation are given below based on the previously discussed unlinkability requirements there MUST be only one verification algorithm for the verifier to use.</t>

<ol spacing="compact">
<li>The Prover computes their input for the <tt>nym_secret</tt> (called <tt>prover_nym</tt>) and retained for use when calculating the <tt>nym_secret</tt> value.</li>
<li>The Prover will wrap up in a cryptographic commitment using the <em>Commit</em> procedures of Blind BBS the messages they want to include in the signature (<tt>committed_messages</tt>) and the <tt>prover_nym</tt> value, generating a <tt>commitment_with_proof</tt> and a <tt>secret_prover_blind</tt>.</li>
<li>The <tt>commitment_with_proof</tt> is conveyed to the signer which then uses the signing procedures in Section <xref target="signature-generation-and-verification-with-pseudonym"/> to create a BBS signature and their input for the <tt>nym_secret</tt> value, called <tt>signer_nym_entropy</tt>. They will convey both to the Prover.</li>
<li>On receipt of the signature and the <tt>signer_nym_entropy</tt> value, the Prover verifies the signature using the procedure of section <xref target="signature-generation-and-verification-with-pseudonym"/> and calculates the <tt>nym_secret</tt> value by adding their <tt>prover_nym</tt> secret and the provided <tt>signer_nym_entropy</tt> values.</li>
<li>The Prover computes the <em>pseudonym</em> based on the <tt>nym_secret</tt> and the pseudonym's context identifier <tt>context_id</tt>.</li>
<li>The Prover generates a proof using <tt>nym_secret</tt>, <tt>secret_prover_blind</tt>, <tt>signature</tt>, <tt>messages</tt>, <tt>committed_messages</tt> and the indexes of the messages to be reveled from those two lists (i.e., <tt>disclosed_indexes</tt> and <tt>disclosed_committed_indexes</tt>)  using the procedures of Section <xref target="proof-generation-with-pseudonym"/>.</li>
<li>The Prover conveys the <tt>proof</tt> and <tt>Pseudonym</tt> to the verifier. The verifier uses the procedure of Section <xref target="proof-verification-with-pseudonym"/> to verify the proof.</li>
</ol>
</section>

<section anchor="bbs-pseudonym-interface"><name>BBS Pseudonym Interface</name>
<t>The following section defines a BBS Interface that will make use of per-origin pseudonyms where the <tt>nym_secret</tt> value is only known to the prover. The identifier of the Interface, api_id,  is defined as <tt>ciphersuite_id || H2G_HM2S_PSEUDONYM_</tt>, where <tt>ciphersuite_id</tt> the unique identifier of the BBS ciphersuite used, as is defined in <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-03.html#name-ciphersuites">Section 6</eref> of <xref target="I-D.irtf-cfrg-bbs-signatures"/>).</t>
<t>The prover create a <tt>nym_secret</tt> value and keeps it secret. Only sending a commitment with the proof of the <tt>nym_secret</tt> that the signer will used when creating the signature.</t>

<section anchor="signature-generation-and-verification-with-pseudonym"><name>Signature Generation and Verification with Pseudonym</name>

<section anchor="commitment"><name>Commitment</name>
<t>This section will describe the steps with which the Signer will generate a blind signature over an array of messages provided (and committed) by the Prover (<tt>committed_messages</tt>) and a pseudonym secret <tt>prover_nym</tt>, also chosen by the Prover. During signature generation, the Signer will provide their own randomness into the pseudonym secret. This will ensure that the pseudonym secret will always be unique, among different signature generation events.</t>
<t>This section will provide a high level description of the required operations, by detailing the modifications required in the relevant BBS blind signature operations, to also consider the use of pseudonyms. The full formal description of the operation can be seen at Appendix. We will reference those operations where appropriate in this section.</t>
<t>Initially, the Prover will chose a set of messages <tt>committed_messages</tt> that they want to be included in the signature, without reveling them to the Signer. They will also choose their part of the pseudonym secret <tt>prover_nym</tt> as a random scalar value.</t>

<artwork>1. committed_messages.append(prover_nym)
2. (commitment_with_proof, secret_prover_blind) = Commit(
                                                   committed_messages,
                                                   api_id)
3. convey commitment_with_proof to Signer.
</artwork>
</section>

<section anchor="blind-issuance"><name>Blind Issuance</name>
<t>The Signer generate a signature from a secret key (SK), the commitment with proof, and optionally over a <tt>header</tt> and vector of <tt>messages</tt> using
the BlindSign procedure from <xref target="I-D.kalos-bbs-blind-signatures"/>, substituting the call on the <tt>B_calculate</tt> of step 6, with the call to <tt>B_calculate_with_nym</tt> defined in Section <xref target="calculate-b"/>. More specifically, to issue a blind signature over a pseudonym, the Issuer will use BlindSign from <xref target="I-D.kalos-bbs-blind-signatures"/>, substituting steps 6, 7 and 8 with the following three steps</t>

<artwork>6. res = B_calculate_with_nym(generators, commit,
                                  blind_generators[-1], message_scalars)
7. if res is INVALID, return INVALID
8. (B, signer_nym_entropy) = res
</artwork>
<t>Lastly, the return statement of <tt>BlindSign</tt> should be updated to return the <tt>signer_nym_entropy</tt> value, returned by the call to the <tt>B_calculate</tt> operation.</t>
<t>The complete operation is defined in Appendix <xref target="detailed-blind-signature-generation-with-pseudonym"/>.</t>

<section anchor="calculate-b"><name>Calculate B</name>
<t>The <tt>B_calculate_with_nym</tt> operation is defined as follows,</t>

<artwork>(B, signer_nym_entropy)  = B_calculate_with_nym(generators,
                                                commitment,
                                                nym_generator,
                                                message_scalars)

Inputs:

- generators (REQUIRED), an array of at least one point from the
                         G1 group.
- commitment (REQUIRED), a point from the G1 group
- nym_generator (REQUIRED), a point from the G1 group
- message_scalars (OPTIONAL), an array of scalar values. If not
                              supplied, it defaults to the empty
                              array ("()").

Deserialization:

1. L = length(messages)
2. if length(generators) != L + 1, return INVALID
3. (Q_1, H_1, ..., H_L) = generators

Procedure:

1. B = Q_1 + H_1 * msg_1 + ... + H_L * msg_L + commitment
2. signer_nym_entropy = get_random(1)
3. B = B + nym_generator * signer_nym_entropy
4. If B is Identity_G1, return INVALID
5. return (B, signer_nym_entropy)
</artwork>
</section>
</section>

<section anchor="verification-and-finalization"><name>Verification and Finalization</name>
<t>The following operation both verifies the generated blind signature, as well as calculating and returning the final <tt>nym_secret</tt>, used to calculate the Pseudonym value during proof generation.</t>
<t>This operation uses the <tt>BlindBBS.Verify</tt> function as defined in <eref target="https://www.ietf.org/archive/id/draft-kalos-bbs-blind-signatures-01.html#name-blind-signature-verificatio">Section 4.2.2</eref> of the Blind BBS document <xref target="BlindBBS"/></t>

<artwork>nym_secret = Finalize(PK,
                      signature,
                      header,
                      messages,
                      committed_messages,
                      prover_nym,
                      signer_nym_entropy,
                      secret_prover_blind)

Inputs:

- PK (REQUIRED), an octet string of the form outputted by the SkToPk
                 operation.
- signature (REQUIRED), an octet string of the form outputted by the
                        Sign operation.
- header (OPTIONAL), an octet string containing context and application
                     specific information. If not supplied, it defaults
                     to an empty string.
- messages (OPTIONAL), a vector of octet strings. If not supplied, it
                       defaults to the empty array "()".
- committed_messages (OPTIONAL), a vector of octet strings. If not
                                 supplied, it defaults to the empty
                                 array "()".
- prover_nym (OPTIONAL), scalar value. If not supplied, it defaults to
                         the zero scalar (0).
- signer_nym_entropy (OPTIONAL), a scalar value. If not supplied, it
                                 defaults to the zero scalar (0).
- secret_prover_blind (OPTIONAL), a scalar value. If not supplied it
                                  defaults to zero "0".

Procedure:

1. nym_secret = prover_nym + signer_nym_entropy
2. committed_messages.append(nym_secret)
3. res = BlindBBS.Verify(PK, signature, header, messages,
                                committed_messages, secret_prover_blind)
4. if res is INVALID, return INVALID
5. return nym_secret
</artwork>
</section>
</section>

<section anchor="proof-generation-with-pseudonym"><name>Proof Generation with Pseudonym</name>
<t>This section defines the <tt>ProofGenWithPseudonym</tt> operations, for calculating a BBS proof with a pseudonym. The BBS proof is extended to include a zero-knowledge proof of correctness of the pseudonym value, i.e., that is correctly calculated using the (undisclosed) pseudonym secret (<tt>nym_secret</tt>), and that is "bound" to the underlying BBS signature (i.e., that the <tt>nym_secret</tt> value is signed by the Signer).</t>
<t>Validating the proof (see <tt>ProofVerifyWithPseudonym</tt> defined in <xref target="proof-verification-with-pseudonym"/>), guarantees authenticity and integrity of the header, presentation header and disclosed messages, knowledge of a valid BBS signature as well as correctness and ownership of the pseudonym.</t>
<t>To support pseudonyms, the <tt>ProofGen</tt> procedure will be extended to accept the pseudonym secret <tt>nym_secret</tt>, as well as the context identifier <tt>context_id</tt>, which the pseudonym will be bounded to. The <tt>nym_secret</tt> scalar value should be added to the <tt>committed_message_scalars</tt> list computed in <tt>ProofGen</tt>. More specifically, step 4 of the <tt>ProofGen</tt> Procedure, defined in Section TBD will be substituted with the following step</t>

<artwork>4.  committed_message_scalars
            .append(BBS.messages_to_scalars(committed_messages, api_id))
            .append(nym_secret)
</artwork>
<t>This operation makes use of <tt>CoreProofGenWithPseudonym</tt> as defined in <xref target="core-proof-generation"/>.</t>
<t>Further more, the call to the <tt>BBS.CoreProofGen</tt> operation at step 10 of the <tt>BlindProofGen</tt> Procedure will be substituted with a call to <tt>CoreProofGenWithNym</tt> operation, defined in Section <xref target="core-proof-generation"/>. More specifically, step 11 of <tt>BlindProofGen</tt> will be substituted by the following step.</t>

<artwork>11. proof = CoreProofGenWithNym(PK,
                                signature,
                                generators.append(blind_generators),
                                header,
                                ph,
                                context_id,
                                message_scalars.append(committed_message_scalars),
                                indexes,
                                api_id)
</artwork>
<t>The <tt>ProofGenWithPseudonym</tt> operation is described in detail in Appendix <xref target="detailed-proof-generation-with-pseudonym"/></t>
</section>

<section anchor="proof-verification-with-pseudonym"><name>Proof Verification with Pseudonym</name>
<t>This operation validates a BBS proof with a pseudonym, given the Signer's public key (PK), the proof, the pseudonym, the context identifier that was used to create it, a header and presentation header, the disclosed messages and committed messages as well as the, the indexes those messages had in the original vectors of signed messages. Validating the proof also validates the correctness and ownership by the Prover of the received pseudonym.</t>
<t>To support pseudonyms, the <tt>BlindProofVerify</tt> procedure will be extended to accept the pseudonym value <tt>Pseudonym</tt>, as well as the context identifier <tt>context_id</tt>, which the pseudonym is bounded to. Additionally, the call to the <tt>BBS.CoreProofVerify</tt> operation at step 9, will be replaced with a call to the core proof verification operation with pseudonyms defined in this document, i.e., of <tt>CoreProofVerifyWithPseudonym</tt> as defined in <xref target="core-proof-verification"/>.</t>
<t>More specifically, step 9 of the <tt>BlindProofVerify</tt> Procedure will be replaced with the following step,</t>

<artwork>9.  result = CoreProofVerifyWithPseudonym(
                                    PK,
                                    proof,
                                    Pseudonym,
                                    context_id,
                                    generators.append(blind_generators),
                                    header,
                                    ph,
                                    message_scalars,
                                    indexes,
                                    api_id)
</artwork>
<t>The <tt>ProofVerifyWithPseudonym</tt> operation is described in detail in Appendix <xref target="detailed-proof-verification-with-pseudonym"/>.</t>
</section>
</section>

<section anchor="core-operations"><name>Core Operations</name>

<section anchor="core-proof-generation"><name>Core Proof Generation</name>
<t>This operations computes a BBS proof and a zero-knowledge proof of correctness of the pseudonym in "parallel" (meaning using common randomness), as to both create a proof that the pseudonym was correctly calculated using an undisclosed value that the Prover knows (i.e., the <tt>nym_secret</tt> value), but also that this value is "signed" by the BBS signature (the last undisclosed message). As a result, validating the proof guarantees that the pseudonym is correctly computed and that it was computed using the Prover identifier that was included in the BBS signature.</t>
<t>The operation uses the <tt>BBS.ProofInit</tt> and <tt>BBS.ProofFinalize</tt> operations defined in <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-07.html#name-proof-initialization">Section 3.7.1</eref> and <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-07.html#name-proof-finalization">Section 3.7.2</eref> correspondingly of <xref target="I-D.irtf-cfrg-bbs-signatures"/>, the <tt>PseudonymProofInit</tt> operation defined in <xref target="pseudonym-proof-generation-initialization"/> and the <tt>ProofWithPseudonymChallengeCalculate</tt> defined in <xref target="challenge-calculation"/>.</t>

<artwork>proof = CoreProofGenWithPseudonym(PK,
                                  signature,
                                  Pseudonym,
                                  verifier_id,
                                  generators,
                                  header,
                                  ph,
                                  messages,
                                  disclosed_indexes,
                                  api_id)

Inputs:

- PK (REQUIRED), an octet string of the form outputted by the SkToPk
                 operation.
- signature (REQUIRED), an octet string of the form outputted by the
                        Sign operation.
- Pseudonym (REQUIRED), A point of G1, different from the Identity of
                        G1, as outputted by the CalculatePseudonym
                        operation.
- context_id (REQUIRED), an octet string, representing the unique proof
                          Verifier identifier.
- generators (REQUIRED), vector of points in G1.
- header (OPTIONAL), an octet string containing context and application
                     specific information. If not supplied, it defaults
                     to an empty string.
- ph (OPTIONAL), an octet string containing the presentation header. If
                 not supplied, it defaults to an empty string.
- message_scalars (OPTIONAL), a vector of scalars representing the
                              messages. If not supplied, it defaults to
                              the empty array "()" must include the
                              nym_secret scalar as last element.
- disclosed_indexes (OPTIONAL), vector of unsigned integers in ascending
                                order. Indexes of disclosed messages. If
                                not supplied, it defaults to the empty
                                array "()".
- api_id (OPTIONAL), an octet string. If not supplied it defaults to the
                     empty octet string ("").

Parameters:

- P1, fixed point of G1, defined by the ciphersuite.

Outputs:

- proof, an octet string; or INVALID.

Deserialization:

1.  signature_result = octets_to_signature(signature)
2.  if signature_result is INVALID, return INVALID
3.  (A, e) = signature_result
4.  L = length(message_scalars)
5.  R = length(disclosed_indexes)
6.  (i1, ..., iR) = disclosed_indexes
7.  if R &gt; L - 1, return INVALID, Note: we never reveal the nym_secret.
8.  U = L - R

// Note: nym_secret is last message and is not revealed.
9.  undisclosed_indexes = (0, 1, ..., L - 1) \ disclosed_indexes
10. (i1, ..., iR) = disclosed_indexes
11. (j1, ..., jU) = undisclosed_indexes
12. disclosed_messages = (message_scalars[i1], ..., message_scalars[iR])
13. undisclosed_messages = (message_scalars[j1], ...,
                                                    message_scalars[jU])

ABORT if:

1. for i in disclosed_indexes, i &lt; 0 or i &gt; L - 1, // Note: nym_secret
                                                   // is the Lth message
                                                   // and not revealed.

Procedure:

1. random_scalars = calculate_random_scalars(5+U)
2. init_res = BBS.ProofInit(PK,
                        signature_res,
                        header,
                        random_scalars,
                        generators,
                        message_scalars,
                        undisclosed_indexes,
                        api_id)
3. if init_res is INVALID, return INVALID

4. pseudonym_init_res = PseudonymProofInit(context_id,
                                           message_scalars[-1],
                                           random_scalars[-1])
5. if pseudonym_init_res is INVALID, return INVALID
6. Pseudonym = pseudonym_init_res[0]

7. challenge = ProofWithPseudonymChallengeCalculate(init_res,
                                                    pseudonym_init_res,
                                                    disclosed_indexes,
                                                    disclosed_messages,
                                                    ph,
                                                    api_id)
8. proof = BBS.ProofFinalize(init_res, challenge, e_value,
                                   random_scalars, undisclosed_messages)
9. return (proof, Pseudonym)
</artwork>
</section>

<section anchor="core-proof-verification"><name>Core Proof Verification</name>
<t>This operation validates a BBS proof that also includes a pseudonym. Validating the proof, other than the correctness and integrity of the revealed messages, the header and the presentation header values, also guarantees that the supplied pseudonym was correctly calculated, i.e., that it was produced using the Verifier's identifier and the signed (but undisclosed) Prover's identifier, following the operation defined in <xref target="pseudonym-calculation-procedure"/>.</t>
<t>The operation uses the <tt>BBS.ProofVerifyInit</tt> operation defined <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-07.html#name-proof-verification-initiali">Section 3.7.3</eref> of <xref target="I-D.irtf-cfrg-bbs-signatures"/>, the <tt>PseudonymProofVerifyInit</tt> operation defined in <xref target="pseudonym-proof-verification-initialization"/> and the <tt>ProofWithPseudonymChallengeCalculate</tt> operation defined in <xref target="challenge-calculation"/>.</t>

<artwork>result = CoreProofVerifyWithPseudonym(PK,
                                      proof,
                                      Pseudonym,
                                      context_id,
                                      generators,
                                      header,
                                      ph,
                                      disclosed_messages,
                                      disclosed_indexes,
                                      api_id)

Inputs:

- PK (REQUIRED), an octet string of the form outputted by the SkToPk
                 operation.
- proof (REQUIRED), an octet string of the form outputted by the
                    ProofGen operation.
- Pseudonym (REQUIRED), A point of G1, different from the Identity of
                        G1, as outputted by the CalculatePseudonym
                        operation.
- context_id (REQUIRED), an octet string, representing the unique proof
                         Verifier identifier.
- generators (REQUIRED), vector of points in G1.
- header (OPTIONAL), an optional octet string containing context and
                     application specific information. If not supplied,
                     it defaults to an empty string.
- ph (OPTIONAL), an octet string containing the presentation header. If
                 not supplied, it defaults to an empty string.
- disclosed_messages (OPTIONAL), a vector of scalars representing the
                                 messages. If not supplied, it defaults
                                 to the empty array "()".
- disclosed_indexes (OPTIONAL), vector of unsigned integers in ascending
                                order. Indexes of disclosed messages. If
                                not supplied, it defaults to the empty
                                array "()".
- api_id (OPTIONAL), an octet string. If not supplied it defaults to the
                     empty octet string ("").

Parameters:

- P1, fixed point of G1, defined by the ciphersuite.

Outputs:

- result, either VALID or INVALID.

Deserialization:

1. proof_result = octets_to_proof(proof)
2. if proof_result is INVALID, return INVALID
3. (Abar, Bbar, r2^, r3^, commitments, cp) = proof_result
4. W = octets_to_pubkey(PK)
5. if W is INVALID, return INVALID
6. R = length(disclosed_indexes)
7. (i1, ..., iR) = disclosed_indexes

ABORT if:

1. for i in disclosed_indexes, i &lt; 1 or i &gt; R + length(commitments) - 1

Procedure:

1. init_res = BBS.ProofVerifyInit(PK, proof_result, header, generators,
                                    messages, disclosed_indexes, api_id)

2. pseudonym_init_res = PseudonymProofVerifyInit(Pseudonym,
                                                 context_id,
                                                 commitments[-1],
                                                 cp)
3. if pseudonym_init_res is INVALID, return INVALID

4. challenge = ProofWithPseudonymChallengeCalculate(init_res,
                                                    pseudonym_init_res,
                                                    disclosed_indexes,
                                                    messages,
                                                    ph,
                                                    api_id)
5. if cp != challenge, return INVALID
6. if e(Abar, W) * e(Bbar, -BP2) != Identity_GT, return INVALID
7. return VALID
</artwork>
</section>

<section anchor="pseudonym-proof-generation-utilities"><name>Pseudonym Proof Generation Utilities</name>

<section anchor="pseudonym-proof-generation-initialization"><name>Pseudonym Proof Generation Initialization</name>

<artwork>pseudonym_init_res = PseudonymProofInit(context_id,
                                          nym_secret, random_scalar)

Inputs:

- context_id (REQUIRED), an octet string
- nym_secret (REQUIRED), a scalar value
- random_scalar (REQUIRED), a scalar value

Outputs:

- a tuple consisting of three elements from the G1 group, or INVALID.

Procedure:

1. OP = hash_to_curve_g1(context_id, api_id)
2. Pseudonym = OP * nym_secret
3. Ut = OP * random_scalar
4. if Pseudonym == Identity_G1 or Ut == Identity_G1, return INVALID
5. return (Pseudonym, OP, Ut)
</artwork>
</section>

<section anchor="pseudonym-proof-verification-initialization"><name>Pseudonym Proof Verification Initialization</name>

<artwork>pseudonym_init_res = PseudonymProofVerifyInit(Pseudonym,
                                              context_id,
                                              nym_secret_commitment
                                              proof_challenge)

Inputs:

- Pseudonym (REQUIRED), an element of the G1 group.
- context_id (REQUIRED), an octet string.
- nym_secret_commitment (REQUIRED), a scalar value.
- proof_challenge (REQUIRED), a scalar value.

Outputs:

- a tuple consisting of three elements from the G1 group, or INVALID.

Procedure:

1. OP = hash_to_curve_g1(context_id)
2. Uv = OP * nym_secret_commitment - Pseudonym * proof_challenge
3. if Uv == Identity_G1, return INVALID
4. return (Pseudonym, OP, Uv)
</artwork>
</section>
</section>
</section>

<section anchor="utility-operations"><name>Utility Operations</name>

<section anchor="challenge-calculation"><name>Challenge Calculation</name>

<artwork>challenge = ProofWithPseudonymChallengeCalculate(init_res,
                                                 pseudonym_init_res,
                                                 i_array,
                                                 msg_array,
                                                 ph, api_id)

Inputs:
- init_res (REQUIRED), vector representing the value returned after
                       initializing the proof generation or verification
                       operations, consisting of 5 points of G1 and a
                       scalar value, in that order.
- pseudonym_init_res (REQUIRED), vector representing the value returned
                                 after initializing the pseudonym proof,
                                 consisting of 3 points of G1.
- i_array (REQUIRED), array of non-negative integers (the indexes of
                      the disclosed messages).
- msg_array (REQUIRED), array of scalars (the disclosed messages after
                        mapped to scalars).
- ph (OPTIONAL), an octet string. If not supplied, it must default to
                 the empty octet string ("").
- api_id (OPTIONAL), an octet string. If not supplied it defaults to the
                     empty octet string ("").

Outputs:

- challenge, a scalar.

Definitions:

1. challenge_dst, an octet string representing the domain separation
                  tag: api_id || "H2S_" where "H2S_" is an ASCII string
                  comprised of 4 bytes.

Deserialization:

1. R = length(i_array)
2. (i1, ..., iR) = i_array
3. (msg_i1, ..., msg_iR) = msg_array
4. (Abar, Bbar, D, T1, T2, domain) = init_res
5. (Pseudonym, OP, Ut) = pseudonym_init_res

ABORT if:

1. R &gt; 2^64 - 1 or R != length(msg_array)
2. length(ph) &gt; 2^64 - 1

Procedure:
1. c_arr = (R, i1, msg_i1, i2, msg_i2, ..., iR, msg_iR, Abar, Bbar,
                                   D, T1, T2, Pseudonym, OP, Ut, domain)
2. c_octs = serialize(c_arr) || I2OSP(length(ph), 8) || ph
3. return hash_to_scalar(c_octs, challenge_dst)
</artwork>
</section>
</section>

<section anchor="security-considerations"><name>Security Considerations</name>
<t>TODO Security</t>
</section>

<section anchor="ciphersuites"><name>Ciphersuites</name>
<t>This document does not define new BBS ciphersuites. Its ciphersuite defined in <eref target="https://www.ietf.org/archive/id/draft-irtf-cfrg-bbs-signatures-03.html#name-ciphersuites">Section 6</eref> of <xref target="I-D.irtf-cfrg-bbs-signatures"/>) can be used to instantiate the operations of the described scheme.</t>
</section>

<section anchor="iana-considerations"><name>IANA Considerations</name>
<t>This document has no IANA actions.</t>
</section>

</middle>

<back>
<references><name>Normative References</name>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.irtf-cfrg-bbs-signatures.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.irtf-cfrg-hash-to-curve.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.irtf-cfrg-pairing-friendly-curves.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml-ids/reference.I-D.kalos-bbs-blind-signatures.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
</references>
<references><name>Informative References</name>
<reference anchor="BBS04" target="https://link.springer.com/chapter/10.1007/978-3-540-28628-8_3">
  <front>
    <title>Short Group Signatures</title>
    <author fullname="Dan Boneh" initials="D." surname="Boneh"/>
    <author fullname="Xavier Boyen" initials="X." surname="Boyen"/>
    <author fullname="Hovav Scacham" initials="H." surname="Shacham"/>
    <date year="2004"/>
  </front>
  <seriesInfo name="In" value="Advances in Cryptology"/>
  <seriesInfo name="pages" value="41-55"/>
</reference>
<reference anchor="BlindBBS" target="https://datatracker.ietf.org/doc/draft-kalos-bbs-blind-signatures/">
  <front>
    <title> Blind BBS Signatures</title>
    <author>
      <organization>IETF</organization>
    </author>
  </front>
</reference>
</references>

<section anchor="acknowledgments"><name>Acknowledgments</name>
<t>TODO acknowledge.</t>
</section>

<section anchor="detailed-operations"><name>Detailed Operations</name>

<section anchor="detailed-blind-signature-generation-with-pseudonym"><name>Detailed Blind Signature Generation with Pseudonym</name>

<artwork>BlindSignWithNym(SK, PK, commitment_with_proof, header, messages)

Inputs:

- SK (REQUIRED), a secret key in the form outputted by the KeyGen
                 operation.
- PK (REQUIRED), an octet string of the form outputted by SkToPk
                 provided the above SK as input.
- commitment_with_proof (OPTIONAL), an octet string, representing a
                                    serialized commitment and
                                    commitment_proof, as the first
                                    element outputted by the Commit
                                    operation. If not supplied, it
                                    defaults to the empty string ("").
- header (OPTIONAL), an octet string containing context and application
                     specific information. If not supplied, it defaults
                     to an empty string ("").
- messages (OPTIONAL), a vector of octet strings. If not supplied, it
                       defaults to the empty array ("()").

Deserialization:

1. L = length(messages)

// calculate the number of blind generators used by the commitment,
// if any.
2. M = length(commitment_with_proof)
3. if M != 0, M = M - octet_point_length - octet_scalar_length
4. M = M / octet_scalar_length
5. if M &lt; 0, return INVALID

Procedure:

1.  generators = BBS.create_generators(L + 1, api_id)
2.  blind_generators = BBS.create_generators(M, "BLIND_" || api_id)

3.  commit = deserialize_and_validate_commit(commitment_with_proof,
                                               blind_generators, api_id)
4.  if commit is INVALID, return INVALID

5.  message_scalars = BBS.messages_to_scalars(messages, api_id)

6.  res = B_calculate(message_scalars, generators, blind_generators[-1])
7.  if res is INVALID, return INVALID
8.  (B, signer_nym_entropy) = res

9.  blind_sig = FinalizeBlindSign(SK,
                                  PK,
                                  B,
                                  generators,
                                  blind_generators,
                                  header,
                                  api_id)

10. if blind_sig is INVALID, return INVALID
11. return (blind_sig, signer_nym_entropy)
</artwork>
</section>

<section anchor="detailed-proof-generation-with-pseudonym"><name>Detailed Proof Generation with Pseudonym</name>

<artwork>proof = ProofGenWithNym(PK,
                        signature,
                        header,
                        ph,
                        nym_secret,
                        context_id,
                        messages,
                        committed_messages,
                        disclosed_indexes,
                        disclosed_commitment_indexes,
                        secret_prover_blind)

Inputs:

- PK (REQUIRED), an octet string of the form outputted by the SkToPk
                 operation.
- signature (REQUIRED), an octet string of the form outputted by the
                        Sign operation.
- header (OPTIONAL), an octet string containing context and application
                     specific information. If not supplied, it defaults
                     to an empty string.
- ph (OPTIONAL), an octet string containing the presentation header. If
                 not supplied, it defaults to an empty string.
- messages (OPTIONAL), a vector of octet strings. If not supplied, it
                       defaults to the empty array "()".
- committed_messages (OPTIONAL), a vector of octet strings. If not
                                 supplied, it defaults to the empty
                                 array "()".
- disclosed_indexes (OPTIONAL), vector of unsigned integers in ascending
                                order. Indexes of disclosed messages. If
                                not supplied, it defaults to the empty
                                array "()".
- disclosed_commitment_indexes (OPTIONAL), vector of unsigned integers
                                           in ascending order. Indexes
                                           of disclosed committed
                                           messages. If not supplied, it
                                           defaults to the empty array
                                           "()".
- secret_prover_blind (OPTIONAL), a scalar value. If not supplied it
                                  defaults to zero "0".


Parameters:

- api_id, the octet string ciphersuite_id || "BLIND_H2G_HM2S_", where
          ciphersuite_id is defined by the ciphersuite and
          "BLIND_H2G_HM2S_"is an ASCII string composed of 15 bytes.


Outputs:

- proof, an octet string; or INVALID.

Deserialization:

1. L = length(messages)
2. M = length(committed_messages)
3. if length(disclosed_indexes) &gt; L, return INVALID
4. for i in disclosed_indexes, if i &lt; 0 or i &gt;= L, return INVALID
5. if length(disclosed_commitment_indexes) &gt; M, return INVALID
6. for j in disclosed_commitment_indexes,
                               if i &lt; 0 or i &gt;= M, return INVALID

Procedure:

1.  message_scalars = BBS.messages_to_scalars(messages, api_id)

2.  committed_message_scalars = ()
3.  committed_message_scalars.append(secret_prover_blind)
4.  committed_message_scalars.append(BBS.messages_to_scalars(
                                            committed_messages, api_id))
5.  committed_message_scalars.append(nym_secret)


6.  generators = BBS.create_generators(length(message_scalars) + 1, api_id)
7.  blind_generators = BBS.create_generators(length(committed_message_scalars) + 1, "BLIND_" || api_id)

8.  indexes = ()
9.  indexes.append(disclosed_indexes)
10. for j in disclosed_commitment_indexes: indexes.append(j + L + 1)

11. proof = CoreProofGenWithNym(PK,
                                signature,
                                generators.append(blind_generators),
                                header,
                                ph,
                                context_id,
                                message_scalars.append(committed_message_scalars),
                                indexes,
                                api_id)
12. return proof
</artwork>
</section>

<section anchor="detailed-proof-verification-with-pseudonym"><name>Detailed Proof Verification with Pseudonym</name>

<artwork>result = ProofVerifyWithPseudonym(PK,
                                  proof,
                                  header,
                                  ph,
                                  Pseudonym,
                                  context_id,
                                  L,
                                  disclosed_messages,
                                  disclosed_committed_messages,
                                  disclosed_indexes,
                                  disclosed_committed_indexes)

Inputs:

- PK (REQUIRED), an octet string of the form outputted by the SkToPk
                 operation.
- proof (REQUIRED), an octet string of the form outputted by the
                    ProofGen operation.
- header (OPTIONAL), an optional octet string containing context and
                     application specific information. If not supplied,
                     it defaults to the empty octet string ("").
- ph (OPTIONAL), an octet string containing the presentation header. If
                 not supplied, it defaults to the empty octet
                 string ("").
- L (OPTIONAL), an integer, representing the total number of Signer
                known messages if not supplied it defaults to 0.
- disclosed_messages (OPTIONAL), a vector of octet strings. If not
                                 supplied, it defaults to the empty
                                 array ("()").
- disclosed_indexes (OPTIONAL), vector of unsigned integers in ascending
                                order. Indexes of disclosed messages. If
                                not supplied, it defaults to the empty
                                array ("()").

Parameters:

- api_id, the octet string ciphersuite_id || "H2G_HM2S_", where
          ciphersuite_id is defined by the ciphersuite and "H2G_HM2S_"is
          an ASCII string comprised of 9 bytes.
- (octet_point_length, octet_scalar_length), defined by the ciphersuite.

Outputs:

- result, either VALID or INVALID.

Deserialization:

1. proof_len_floor = 2 * octet_point_length + 3 * octet_scalar_length
2. if length(proof) &lt; proof_len_floor, return INVALID
3. U = floor((length(proof) - proof_len_floor) / octet_scalar_length)
4. total_no_messages = length(disclosed_indexes) +
                                 length(disclosed_committed_indexes) + U
5. M = total_no_messages - L

Procedure:

1.  generators = BBS.create_generators(L + 1, api_id)
2.  blind_generators = BBS.create_generators(M + 1, "BLIND_" || api_id)

3.  disclosed_message_scalars = messages_to_scalars(
                                             disclosed_messages, api_id)
4.  disclosed_committed_message_scalars = messages_to_scalars(
                                   disclosed_committed_messages, api_id)
5.  message_scalars = disclosed_message_scalars.append(
                                    disclosed_committed_message_scalars)

6.  indexes = ()
7.  indexes.append(disclosed_indexes)
8.  for j in disclosed_commitment_indexes: indexes.append(j + L + 1)

9.  result = CoreProofVerifyWithPseudonym(
                                    PK,
                                    proof,
                                    Pseudonym,
                                    context_id,
                                    generators.append(blind_generators),
                                    header,
                                    ph,
                                    message_scalars,
                                    indexes,
                                    api_id)
10. return result
</artwork>
</section>
</section>

</back>

</rfc>
