Skip to content

Commit

Permalink
DeriveKey Scrypt unit test (#886)
Browse files Browse the repository at this point in the history
* Strengthen PBKDF2

* Update SCrypt.cs

* Scrypt DeriveKey ut

* Deterministic behaviour
  • Loading branch information
shargon authored Jul 8, 2019
1 parent aab9572 commit 29fb4ed
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions neo.UnitTests/UT_Scrypt.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Neo.Cryptography;
using System;

namespace Neo.UnitTests
{
[TestClass]
public class UT_Scrypt
{
[TestMethod]
public void DeriveKeyTest()
{
int N = 16384, r = 8, p = 8;

var derivedkey = SCrypt.DeriveKey(new byte[] { 0x01, 0x02, 0x03 }, new byte[] { 0x04, 0x05, 0x06 }, N, r, p, 64).ToHexString();
Assert.AreEqual("2bb9c7bb9c392f0dd37821b76e42b01944902520f48d00946a51e72c960fba0a3c62a87d835c9df10a8ad66a04cdf02fbb10b9d7396c20959f28d6cb3ddfdffb", derivedkey);
}
}
}

0 comments on commit 29fb4ed

Please sign in to comment.