From e6d98cb22db41f5c1fec021d2ff3a9d5fb8931aa Mon Sep 17 00:00:00 2001
From: Manu Sporny
Date: Mon, 4 Mar 2024 19:10:55 -0500
Subject: [PATCH 1/5] Add cryptosuite instantiation algorithm.
---
index.html | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/index.html b/index.html
index d2fa4f2..cf09b6d 100644
--- a/index.html
+++ b/index.html
@@ -487,6 +487,45 @@ Algorithms
by default, and abort processing upon detection.
+
+ Instantiate Cryptosuite
+
+
+This algorithm is used to configure a cryptographic suite to be used by the
+Add Proof and
+Verify Proof
+functions in [[[VC-DATA-INTEGRITY]]]. The algorithm takes an options object
+([=map=] |options|) as input and returns a [=data integrity cryptographic suite
+instance|cryptosuite instance=] ([=struct=] |cryptosuite|).
+
+
+
+ -
+Initialize |cryptosuite| to an empty [=struct=].
+
+ -
+If |options|.|type| does not equal `DataIntegrityProof`, return |cryptosuite|.
+
+ -
+If |options|.|cryptosuite| is `bbs-2023` then:
+
+ -
+Set |cryptosuite|.|createProof| to the algorithm in Section
+[[[#create-base-proof-bbs-2023]]].
+
+ -
+Set |cryptosuite|.|verifyProof| to the algorithm in Section
+[[[#verify-derived-proof-bbs-2023]]].
+
+
+
+ -
+Return |cryptosuite|.
+
+
+
+
+
Selective Disclosure Functions
From 2c71d939106db7728c659fcbe7fcc8795c5f4182 Mon Sep 17 00:00:00 2001
From: Manu Sporny
Date: Mon, 4 Mar 2024 19:16:39 -0500
Subject: [PATCH 2/5] Add Create Base Proof to align w/ new cryptosuite
interface.
---
index.html | 55 +++++++++++++++++++++++++++++++++++++++---------------
1 file changed, 40 insertions(+), 15 deletions(-)
diff --git a/index.html b/index.html
index cf09b6d..ec6a0e6 100644
--- a/index.html
+++ b/index.html
@@ -1091,24 +1091,49 @@ bbs-2023
- Add Base Proof (bbs-2023)
+ Create Base Proof (bbs-2023)
-To generate a base proof, the algorithm in
-
-Section 4.1: Add Proof of the Data Integrity
-[[VC-DATA-INTEGRITY]] specification MUST be executed.
-For that algorithm, the cryptographic suite specific
-
-transformation algorithm is defined in Section
-, the
-
-hashing algorithm is defined in Section ,
-and the
-
-proof serialization algorithm is defined in Section
-.
+The following algorithm specifies how to create a [=data integrity proof=] given
+an unsecured data document. Required inputs are an
+unsecured data document ([=map=] |unsecuredDocument|), and a set of proof
+options ([=map=] |options|). A [=data integrity proof=] ([=map=]), or an error,
+is produced as output.
+
+
+ -
+Let |proof| be a clone of the proof options, |options|.
+
+ -
+Let |proofConfig| be the result of running the algorithm in
+Section [[[#base-proof-configuration-bbs-2023]]] with
+|options| passed as a parameter.
+
+ -
+Let |transformedData| be the result of running the algorithm in Section with |unsecuredDocument|,
+|proofConfig|, and |options| passed as parameters.
+
+ -
+Let |hashData| be the result of running the algorithm in Section
+[[[#base-proof-hashing-bbs-2023]]] with |transformedData| and |proofConfig|
+passed as a parameters.
+
+ -
+Let |proofBytes| be the result of running the algorithm in Section
+[[[#base-proof-serialization-bbs-2023]]] with |hashData| and
+|options| passed as parameters.
+
+ -
+Let |proof|.|proofValue| be a
+base64url-encoded Multibase value of the |proofBytes|.
+
+ -
+Return |proof| as the [=data integrity proof=].
+
+
+
From b0b5f6bfcf4f4f4a49e8c1a8c7418a2596bed026 Mon Sep 17 00:00:00 2001
From: Manu Sporny
Date: Mon, 4 Mar 2024 19:32:25 -0500
Subject: [PATCH 3/5] Update Verify Derived Proof to use new cryptosuite
interface.
---
index.html | 59 +++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 45 insertions(+), 14 deletions(-)
diff --git a/index.html b/index.html
index ec6a0e6..8b95372 100644
--- a/index.html
+++ b/index.html
@@ -1435,27 +1435,49 @@ Add Derived Proof (bbs-2023)
-
Verify Derived Proof (bbs-2023)
-The following algorithm attempts verification of a `bbs-2023` derived
-proof. This algorithm is called by a verifier of an BBS-protected
-verifiable credential. The inputs include a JSON-LD document
-(document), a BBS disclosure proof (proof), and any
-custom JSON-LD API options (such as a document loader). A single boolean
-verification result value is produced as output.
+The following algorithm specifies how to verify a [=data integrity proof=] given
+an secured data document. Required inputs are an
+secured data document ([=map=] |securedDocument|). This algorithm returns
+a verification result, which is a [=struct=] whose
+[=struct/items=] are:
+
+
+
+ - verified
+ - `true` or `false`
+ - verifiedDocument
+ -
+Null, if [=verification result/verified=] is
+`false`; otherwise, an [=unsecured data document=]
+
+
+
+
+To verify a derived proof, perform the following steps:
-
+ -
+Let |unsecuredDocument| be a copy of |securedDocument| with
+the `proof` value removed.
+
+ -
+Let |proofConfig| be a copy of |securedDocument|.|proof| with `proofValue`
+removed.
+
+ -
+Let |proof| be the value of |securedDocument|.|proof|.
+
-
Initialize `bbsProof`, `proofHash`, `mandatoryHash`, `selectedIndexes`,
`presentationHeader`, `pseudonym`, and `nonMandatory` to the values associated with their
property names in the object returned when calling the algorithm in Section
-, passing the `document`, `proof`, and any
-custom JSON-LD API options (such as a document loader).
+, passing the |unsecuredDocument|, |proof|, and
+any custom JSON-LD API options (such as a document loader).
-
Initialize `bbsHeader` to the concatenation of `proofHash` and `mandatoryHash`
@@ -1463,7 +1485,7 @@
Verify Derived Proof (bbs-2023)
obtained from the UTF-8 encoding of the elements of the `nonMandatory` array.
-
-Initialize `verificationResult` to the result of applying the verification
+Initialize |verified| to the result of applying the verification
algorithm below, depending on whether the |pseudonym| value is empty.
-
@@ -1495,14 +1517,23 @@
Verify Derived Proof (bbs-2023)
hidden pid" cases.
-
+
+ -
+Return a [=verification result=] with [=struct/items=]:
+
+ - [=verified=]
+ - |verified|
+ - [=verifiedDocument=]
+ -
+|unsecuredDocument| if |verified| is `true`, otherwise Null
+
+
-
-