aboutsummaryrefslogtreecommitdiffstats
path: root/proposals
diff options
context:
space:
mode:
authorRangerMauve <RangerMauve@hotmail.com>2018-09-07 12:49:42 -0400
committerGitHub <noreply@github.com>2018-09-07 12:49:42 -0400
commita5074640af3e97165335f0e175aa89bc2d4d95af (patch)
tree28fd853892cf91b952e09b0fc0462d186095d8af /proposals
parent61681ac33350f17ad5c2bf12dc1d2b20f80c9b21 (diff)
downloaddat-deps-a5074640af3e97165335f0e175aa89bc2d4d95af.tar.gz
dat-deps-a5074640af3e97165335f0e175aa89bc2d4d95af.zip
Added functions for sign/verify to DEP 0002
Closes #39
Diffstat (limited to 'proposals')
-rw-r--r--proposals/0002-hypercore.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/proposals/0002-hypercore.md b/proposals/0002-hypercore.md
index 5469cbb..dcf7cd9 100644
--- a/proposals/0002-hypercore.md
+++ b/proposals/0002-hypercore.md
@@ -283,6 +283,18 @@ function root_hash (roots) {
return blake2b(buffers)
}
+
+function sign (roots, secretKey) {
+ var hash = root_hash(roots)
+
+ return ed25519.detached.sign(hash, secretKey)
+}
+
+function verify (roots, signature, publicKey) {
+ var hash = root_hash(roots)
+
+ return ed25519.detached.verify(signature, publicKey)
+}
```
# Parameters