From a5074640af3e97165335f0e175aa89bc2d4d95af Mon Sep 17 00:00:00 2001 From: RangerMauve Date: Fri, 7 Sep 2018 12:49:42 -0400 Subject: Added functions for sign/verify to DEP 0002 Closes #39 --- proposals/0002-hypercore.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- cgit v1.2.3