Skip to content

Commit 25a72fe

Browse files
wesbiggsWes Biggs
and
Wes Biggs
authored
Minor hygiene items (#291)
- open external links in a new tab (some via mdbook extension, others by hardcoding HTML) - fix reference to deprecated public key announcement in PRId algorithm - give a more useful internal link for assertionMethodPublicKeys in the Verifiable Credentials overview - name items in the PRId description a little more consistently --------- Co-authored-by: Wes Biggs <[email protected]>
1 parent 9cb0bf8 commit 25a72fe

File tree

7 files changed

+23
-27
lines changed

7 files changed

+23
-27
lines changed

.github/workflows/common/set-up-mdbook/action.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ runs:
88
using: "composite"
99
steps:
1010
- name: Setup mdBook 📚
11-
uses: jontze/action-mdbook@0765bef0c7c5792f93bf3ed3d487a0ca32c9da33
12-
with:
13-
token: ${{ inputs.token }}
14-
mdbook-version: "~0.4.37" # Use a semver compatible string
15-
# Optional Plugins have to be enabled
16-
use-linkcheck: true
17-
linkcheck-version: "~0.7.7"
18-
11+
shell: bash
12+
run: cargo install mdbook mdbook-linkcheck mdbook-external-links
1913
- name: Show mdbook version
2014
shell: bash
2115
run: mdbook --version

.spellcheckerdict.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ cryptographically
2222
[Cc]ryptosuites
2323
CtxSharedSecretA
2424
CtxSharedSecretB
25-
CtxSharedSecretBob
2625
Curve25519
2726
decrypt(ed)?
2827
Delegator
@@ -100,6 +99,7 @@ repo
10099
resolvers
101100
RFC[1-9][0-9]*
102101
Ristretto
102+
RootSharedSecretAB
103103
RPC
104104
S3
105105
schemaless

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ Note: Remember that you can link to the tag on GitHub before creating the tag.
3030
To build the spec generator locally, install [mdBook](https://github.com/rust-lang/mdBook.git) and [link checker](https://github.com/Michael-F-Bryan/mdbook-linkcheck). The link checker will run during build process and throw warnings for any broken internal or external links.
3131

3232
``` bash
33-
cargo install mdbook
34-
cargo install mdbook-linkcheck
33+
cargo install mdbook mdbook-linkcheck mdbook-external-links
3534
```
3635

3736
To run the spec generator locally and preview the formatted spec website, use the following commands:

book.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[book]
2-
authors = ["Unfinished"]
2+
authors = ["Project Liberty Institute"]
33
language = "en"
44
multilingual = false
55
src = "pages"
@@ -21,3 +21,6 @@ exclude = ['en\.bitcoin\.it', 'github\.com/LibertyDSNP/spec', 'w3\.org']
2121

2222
[output.html.fold]
2323
enable = true
24+
25+
# https://github.com/jonahgoldwastaken/mdbook-external-links
26+
[preprocessor.external-links]

pages/DSNP/Identifiers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Graph connections are formed through the DSNP User Id.
1313

1414
- MUST be a multibase string using the `base32` encoding
1515
- MUST represent a valid [multihash](https://github.com/multiformats/multihash) encoding of the hashing algorithm output for the bytes of the content
16-
- MUST use a [Supported Hashing Algorithm](Announcements.md#supported-hashing-algorithms)
16+
- MUST use a [Supported Hashing Algorithm](#supported-hashing-algorithms)
1717

1818
### Serialization Steps
1919

pages/DSNP/Types/PRId.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,17 @@ Definitions:
4141
Algorithm:
4242

4343
1. Both Alice and Bob generate an asymmetric key pair for use with X25519 <abbr title="Elliptic Curve Integrated Encryption Scheme">ECIES</abbr>.
44-
Each publishes a Public Key Announcement with their generated public key with a `keyType` value of `keyAgreement`.
44+
Each uses the [Replace User Data](../UserData.md#replace-user-data-operation) Operation to publish their generated public key in `keyAgreementPublicKeys`.
4545

4646
<table style="table-layout:fixed">
4747
<tr><th>Libsodium</th><th>Algorithm</th></tr>
4848
<tr><td>
4949
<tt>
5050
<pre>
51-
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#key-pair-generation">crypto_box_keypair</a>(
51+
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#key-pair-generation" target="_blank">crypto_box_keypair</a>(
5252
&a_public,
5353
&a_secret);
54-
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#key-pair-generation">crypto_box_keypair</a>(
54+
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#key-pair-generation" target="_blank">crypto_box_keypair</a>(
5555
&b_public,
5656
&b_secret);
5757
</pre>
@@ -71,7 +71,7 @@ Algorithm:
7171
<tr><th>Libsodium</th><th>Algorithm</th></tr>
7272
<tr><td>
7373
<tt><pre>
74-
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#precalculation-interface">crypto_box_beforenm</a>(
74+
<a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption#precalculation-interface" target="_blank">crypto_box_beforenm</a>(
7575
&root_shared_secret,
7676
b_public,
7777
a_secret);
@@ -83,13 +83,13 @@ RootSharedSecret<sub>AB</sub> &#8592;
8383
</pre></tt>
8484
</td></tr></table>
8585

86-
3. Alice derives a context-specific subkey <code>CtxSharedSecret<sub>Bob</sub></code> from the shared secret `RootSharedSecret` as the master key, Bob's DSNP User Id as the 64-bit key identifier, and the ASCII encoding of the [PRId Context](#contexts) string (`"PRIdCtx0"` for connections).
86+
3. Alice derives a context-specific subkey <code>CtxSharedSecret<sub>A→B</sub></code> from the shared secret <code>RootSharedSecret<sub>AB</sub></code> as the master key, Bob's DSNP User Id as the 64-bit key identifier, and the ASCII encoding of the [PRId Context](#contexts) string (`"PRIdCtx0"` for connections).
8787

8888
<table style="table-layout:fixed">
8989
<tr><th>Libsodium</th><th>Algorithm</th></tr>
9090
<tr><td>
9191
<tt><pre>
92-
<a href="https://libsodium.gitbook.io/doc/key_derivation">crypto_kdf_derive_from_key</a>(
92+
<a href="https://libsodium.gitbook.io/doc/key_derivation" target="_blank">crypto_kdf_derive_from_key</a>(
9393
ctx_shared_secret,
9494
32,
9595
b_user_id,
@@ -98,7 +98,7 @@ RootSharedSecret<sub>AB</sub> &#8592;
9898
</pre></tt>
9999
</td><td>
100100
<tt><pre>
101-
CtxSharedSecret<sub>A→B</sub> &#8592
101+
CtxSharedSecret<sub>A→B,C</sub> &#8592
102102
Blake2b<sub>256</sub>(
103103
key = RootSharedSecret<sub>AB</sub>,
104104
message = {},
@@ -108,7 +108,7 @@ CtxSharedSecret<sub>A→B</sub> &#8592
108108
</td></tr></table>
109109

110110
4. Alice uses Bob's DSNP User Id to form an 8-byte little-endian message.
111-
Alice encrypts this message using [XSalsa20](http://cr.yp.to/snuffle/xsalsa-20110204.pdf) with the PRId key <code>CtxSharedSecret<sub>A→B</sub></code> and a nonce of her own User Id (little-endian) followed by 16 zero bytes.
111+
Alice encrypts this message using [XSalsa20](http://cr.yp.to/snuffle/xsalsa-20110204.pdf) with the PRId key <code>CtxSharedSecret<sub>A→B,C</sub></code> and a nonce of her own User Id (little-endian) followed by 16 zero bytes.
112112

113113
<table style="table-layout:fixed">
114114
<tr><th>Libsodium</th><th>Algorithm</th></tr>
@@ -120,7 +120,7 @@ for (i = 0; i < 8; i++) {
120120
nonce[i] = (user_id_a >> (i*8))
121121
& 0xff;
122122
}<br>
123-
<a href="https://libsodium.gitbook.io/doc/secret-key_cryptography/secretbox#detached-mode">crypto_secretbox_detached</a>(
123+
<a href="https://libsodium.gitbook.io/doc/secret-key_cryptography/secretbox#detached-mode" target="_blank">crypto_secretbox_detached</a>(
124124
&prid,
125125
&mac_unused,
126126
user_id_b,
@@ -136,7 +136,7 @@ for (i = 0; i < 8; i++) {
136136
PRId<sub>A→B,C</sub> &#8592
137137
XSalsa20(
138138
message = Id<sub>B</sub>,
139-
key = CtxSharedSecret<sub>A→B</sub>,
139+
key = CtxSharedSecret<sub>A→B,C</sub>,
140140
nonce = Padded24BytesLE(Id<sub>A</sub>)
141141
)
142142
</pre></tt>
@@ -147,7 +147,7 @@ PRId<sub>A→B,C</sub> &#8592
147147
Similarly, Bob can calculate the same root shared secret `RootSharedSecret` using <code>Alice<sub>public</sub></code> and <code>Bob<sub>secret</sub></code> and derive the same <code>PRId<sub>A→B,C</sub></code> in order to check if it is in Alice's published PRIds.
148148
Bob can also derive the PRId subkey for Alice's DSNP User Id and encrypt Alice's User Id, using his own as the nonce, to generate the Bob-to-Alice PRId (<code>PRId<sub>B→A,C</sub></code>), and then publish it to his own list, if desired.
149149

150-
If Alice or Bob wants to prove to a third party that their PRIds are in each other's PRId list, they can provide the third party with their own subkey <code>CtxSharedSecret<sub>A→B</sub></code> or <code>CtxSharedSecret<sub>B→A</sub></code>.
150+
If Alice or Bob wants to prove to a third party that their PRIds are in each other's PRId list, they can provide the third party with their own subkey <code>CtxSharedSecret<sub>A→B,C</sub></code> or <code>CtxSharedSecret<sub>B→A,C</sub></code>.
151151
The third party can repeat the encryption step using Alice and Bob's User Ids, and check that the output is present in the published set of PRIds. The root shared secret `RootSharedSecret` (used as a master key in this algorithm) should _not_ be divulged.
152152

153153
### Test Vector
@@ -169,6 +169,6 @@ An implementation of the PRId generation algorithm should produce the following
169169
| Output | Value |
170170
| --- | --- |
171171
| <tt>PRId<sub>A→B</sub></tt> | `0xace4d2995b1a829c` |
172-
| <tt>CtxSharedSecret<sub>A→B</sub></tt> | `0x37cb1a870f0c1dce06f5116faf145ac2cf7a2f7d30136be4eea70c324932e6d2` |
172+
| <tt>CtxSharedSecret<sub>A→B,C</sub></tt> | `0x37cb1a870f0c1dce06f5116faf145ac2cf7a2f7d30136be4eea70c324932e6d2` |
173173
| <tt>PRId<sub>B→A</sub></tt> | `0x1a53b02a26503600` |
174-
| <tt>CtxSharedSecret<sub>B→A</sub></tt> | `0x32c45c49fcfe12f9db60e74fa66416c5a05832c298814d82032a6783a4b1fca0` |
174+
| <tt>CtxSharedSecret<sub>B→A,C</sub></tt> | `0x32c45c49fcfe12f9db60e74fa66416c5a05832c298814d82032a6783a4b1fca0` |

pages/VerifiableCredentials/Overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Current usage with DSNP relies on the following specifications:
2222
### Cryptography
2323

2424
The Data Integrity specification provides a generic format for expressing cryptographic proofs, where the detailed representation of each data item is defined in individual cryptosuites.
25-
DSNP compliant applications MUST support the following cryptosuites, which correspond to the allowed algorithms for `assertionMethod` [Public Keys](../DSNP/Types/PublicKey.md):
25+
DSNP compliant applications MUST support the following cryptosuites, which correspond to the allowed algorithms for the DSNP User Data item [`assertionMethodPublicKeys`](../DSNP/Types/PublicKeyUserData.md#allowed-key-types):
2626

2727
| Specification | Version/Status | Multikey codec |
2828
| --- | --- | --- |

0 commit comments

Comments
 (0)