Skip to content

Commit

Permalink
Align JCS Verify Proof prose with EdDSA cryptosuite.
Browse files Browse the repository at this point in the history
  • Loading branch information
msporny committed Aug 5, 2024
1 parent 5f1a68c commit 74cd3e5
Showing 1 changed file with 45 additions and 41 deletions.
86 changes: 45 additions & 41 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -993,75 +993,79 @@ <h4>Verify Proof (ecdsa-jcs-2019)</h4>
The following algorithm specifies how to verify a [=data integrity proof=] given
an <a>secured data document</a>. Required inputs are an
<a>secured data document</a> ([=map=] |securedDocument|). This algorithm returns
a [=verification result=], which is a [=struct=] whose
[=struct/items=] are:
a [=verification result=], which is a [=struct=] whose [=struct/items=] are:
</p>

<dl>
<dt>[=verification result/verified=]</dt>
<dd>`true` or `false`</dd>
<dt>[=verification result/verifiedDocument=]</dt>
<dd>
<a data-cite="INFRA#nulls">Null</a>, if [=verification result/verified=] is
`false`; otherwise, an [=unsecured data document=]
if [=verification result/verified=] is `true`, an [=unsecured data document=];
otherwise <a data-cite="INFRA#nulls">Null</a>
</dd>
</dl>


<ol class="algorithm">
<li>
Let |unsecuredDocument| be a copy of |securedDocument| with
the `proof` value removed.
</li>
<li>
Let |proofConfig| be a copy of |securedDocument|.|proof| with `proofValue`
<li>
Let |unsecuredDocument| be a copy of |securedDocument| with the `proof` value
removed.
</li>
<li>
</li>
<li>
Let |proofOptions| be the result of a copy of |securedDocument|.|proof| with
`proofValue` removed.
</li>
<li>
Let |proofBytes| be the
<a data-cite="VC-DATA-INTEGRITY#multibase-0">Multibase decoded base58-btc
value</a> in |securedDocument|.|proof|.|proofValue|.
</li>
<li>
If |proofConfig|.<var>@context</var> exists:
</li>
<li>
If |proofOptions|.<var>@context</var> exists:
<ol class="algorithm">
<li>
Check that the |securedDocument|.<var>@context</var> starts with all values
contained in the |proofConfig|.<var>@context</var> in the same order.
contained in the |proofOptions|.<var>@context</var> in the same order.
Otherwise, set |verified| to `false` and skip to the last step.
</li>
<li>
Set |unsecuredDocument|.<var>@context</var> equal to
|proofConfig|.<var>@context</var>.
|proofOptions|.<var>@context</var>.
</li>
</ol>
</li>
<li>
Let |transformedData| be the result of running the algorithm in Section <a
href="#transformation-ecdsa-jcs-2019"></a> with |unsecuredDocument| and
|proofConfig| passed as parameters.
</li>
<li>
<li>
Let |transformedData| be the result of running the algorithm in Section
[[[#transformation-ecdsa-jcs-2019]]] with |unsecuredDocument| and
|proofOptions| passed as parameters.
</li>
<li>
Let |proofConfig| be the result of running the algorithm in Section
[[[#proof-configuration-ecdsa-jcs-2019]]] with |proofOptions| passed
as the parameter.
</li>
<li>
Let |hashData| be the result of running the algorithm in Section
[[[#hashing-ecdsa-jcs-2019]]] with |transformedData| and |proofConfig|
passed as a parameters.
</li>
<li>
Let |verified:boolean| be the result of running the algorithm in Section
[[[#proof-verification-ecdsa-jcs-2019]]] algorithm on |hashData|,
|proofBytes|, and |proofConfig|.
[[[#hashing-ecdsa-jcs-2019]]] with |transformedData| and |proofConfig| passed as
a parameters.
</li>
<li>
Let |verified:boolean| be the result of running the algorithm in Section
[[[#proof-verification-ecdsa-jcs-2019]]] on |hashData|, |proofBytes|, and
|proofConfig|.
</li>
<li>
Return a [=verification result=] with [=struct/items=]:
<dl data-link-for="verification result">
<dt>[=verified=]</dt>
<dd>|verified|</dd>
<dt>[=verifiedDocument=]</dt>
<dd>
|unsecuredDocument| if |verified| is `true`, otherwise <a data-cite="INFRA#nulls">Null</a></dd>
</dl>
</li>
</ol>

<dl data-link-for="verification result">
<dt>[=verified=]</dt>
<dd>|verified|</dd>
<dt>[=verifiedDocument=]</dt>
<dd>
if |verified| is `true`, |unsecuredDocument|;
otherwise, <a data-cite="INFRA#nulls">Null</a></dd>
</dl>
</li>
</ol>
</section>

<section>
Expand Down

0 comments on commit 74cd3e5

Please sign in to comment.