UNPKG

409 BJavaScriptView Raw
1var tape = require("tape");
2var ssbkeys = require("..");
3
4tape("secretBox, secretUnbox", function (t) {
5 var key = Buffer.from(
6 "somewhere-over-the-rainbow-way-up-high".substring(0, 32)
7 );
8
9 var boxed = ssbkeys.secretBox({ okay: true }, key);
10 if (process.env.VERBOSE_TESTS) console.log("boxed", boxed);
11 var msg = ssbkeys.secretUnbox(boxed, key);
12 t.deepEqual(msg, { okay: true });
13 t.end();
14});