var should = require('chai').should();
var KDF = require('../lib/kdf');
var Hash = require('../lib/hash');

describe('KDF', function() {
  
  describe('#buf2keypair', function() {

    it('should compute these known values', function() {
      var buf = Hash.sha256(new Buffer('test'));
      var keypair = KDF.buf2keypair(buf);
      keypair.privkey.toString().should.equal('KxxVszVMFLGzmxpxR7sMSaWDmqMKLVhKebX5vZbGHyuR8spreQ7V');
      keypair.pubkey.toString().should.equal('03774f761ae89a0d2fda0d532bad62286ae8fcda9bc38c060036296085592a97c1');
    });

  });

  describe('#sha256hmac2keypair', function() {

    it('should compute these known values', function() {
      var buf = Hash.sha256(new Buffer('test'));
      var keypair = KDF.sha256hmac2keypair(buf);
      keypair.privkey.toString().should.equal('KxxVszVMFLGzmxpxR7sMSaWDmqMKLVhKebX5vZbGHyuR8spreQ7V');
      keypair.pubkey.toString().should.equal('03774f761ae89a0d2fda0d532bad62286ae8fcda9bc38c060036296085592a97c1');
    });

  });

  describe('#sha256hmac2privkey', function() {

    it('should compute this known privkey', function() {
      var buf = Hash.sha256(new Buffer('test'));
      var privkey = KDF.sha256hmac2privkey(buf);
      privkey.toString().should.equal('KxxVszVMFLGzmxpxR7sMSaWDmqMKLVhKebX5vZbGHyuR8spreQ7V');
    });

  });

});

@@ -1,12 +1,27 @@
+'use strict';%0A%0A
 var should =
@@ -51,19 +51,23 @@
 ();%0Avar 
-KDF
+bitcore
  = requi
@@ -74,55 +74,65 @@
 re('
-../lib/kdf');%0Avar Hash = require('../lib/h
+bitcore');%0Avar KDF = bitcore.KDF;%0Avar Hash = bitcore.H
 ash
-')
 ;%0A%0Ad
@@ -159,18 +159,16 @@
 ion() %7B%0A
-  
 %0A  descr

fix tests for kdf