diff options
Diffstat (limited to 'proposals/0002-hypercore.md')
-rw-r--r-- | proposals/0002-hypercore.md | 12 |
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 |