fix kdf test

This commit is contained in:
subtly 2015-03-08 13:45:23 +01:00
parent 845053da19
commit 587e544063

View File

@ -267,14 +267,14 @@ BOOST_AUTO_TEST_CASE(ecies_kdf)
// nonce // nonce
Secret z1; Secret z1;
ecdh::agree(local.sec(), remote.pub(), z1); ecdh::agree(local.sec(), remote.pub(), z1);
auto key1 = s_secp256k1.eciesKDF(z1, bytes(), 512); auto key1 = s_secp256k1.eciesKDF(z1, bytes(), 64);
bytesConstRef eKey1 = bytesConstRef(&key1).cropped(0, 32); bytesConstRef eKey1 = bytesConstRef(&key1).cropped(0, 32);
bytesRef mKey1 = bytesRef(&key1).cropped(32, 32); bytesRef mKey1 = bytesRef(&key1).cropped(32, 32);
sha3(mKey1, mKey1); sha3(mKey1, mKey1);
Secret z2; Secret z2;
ecdh::agree(remote.sec(), local.pub(), z2); ecdh::agree(remote.sec(), local.pub(), z2);
auto key2 = s_secp256k1.eciesKDF(z2, bytes(), 512); auto key2 = s_secp256k1.eciesKDF(z2, bytes(), 64);
bytesConstRef eKey2 = bytesConstRef(&key2).cropped(0, 32); bytesConstRef eKey2 = bytesConstRef(&key2).cropped(0, 32);
bytesRef mKey2 = bytesRef(&key2).cropped(32, 32); bytesRef mKey2 = bytesRef(&key2).cropped(32, 32);
sha3(mKey2, mKey2); sha3(mKey2, mKey2);