var assert = require('assert');
var sodium = require('../build/Release/sodium');

var expected1 = Buffer.from([
    0xed,0x77,0x49,0xb4,0xd9,0x89,0xf6,0x95,
    0x7f,0x3b,0xfd,0xe6,0xc5,0x67,0x67,0xe9,
    0x88,0xe2,0x1c,0x9f,0x87,0x84,0xd9,0x1d,
    0x61,0x00,0x11,0xcd,0x55,0x3f,0x9b,0x06,
]);

var expected2 = Buffer.from([
    0xac,0xcd,0x44,0xeb,0x8e,0x93,0x31,0x9c,
    0x05,0x70,0xbc,0x11,0x00,0x5c,0x0e,0x01,
    0x89,0xd3,0x4f,0xf0,0x2f,0x6c,0x17,0x77,
    0x34,0x11,0xad,0x19,0x12,0x93,0xc9,0x8f,

]);


var seed = Buffer.from([
    0x77, 0x07, 0x6d, 0x0a, 0x73, 0x18, 0xa5,
    0x7d, 0x3c, 0x16, 0xc1, 0x72, 0x51, 0xb2,
    0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb,
    0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5,
    0x1d, 0xb9, 0x2c, 0x2a
]);

describe("libsodium_auth3", function () {
    it('crypto_box_seed_keypair key generation', function() {
        var keys = sodium.crypto_box_seed_keypair(seed);
        assert(keys.publicKey.equals(expected1));
        assert(keys.secretKey.equals(expected2));
    });
});

