public void StandardScryptHashConstraintsTooLow() { var standardScryptHash = new StandardScrypt() { DerivedKeyLength = -1, BlockSize = 4, Parallelization = 2, MemoryCost = 13, }; Assert.Throws <ArgumentException>(() => standardScryptHash.GetProperties()); standardScryptHash = new StandardScrypt() { DerivedKeyLength = 2, BlockSize = -1, Parallelization = 2, MemoryCost = 13, }; Assert.Throws <ArgumentException>(() => standardScryptHash.GetProperties()); standardScryptHash = new StandardScrypt() { DerivedKeyLength = 2, BlockSize = 4, Parallelization = -2, MemoryCost = 13, }; Assert.Throws <ArgumentException>(() => standardScryptHash.GetProperties()); standardScryptHash = new StandardScrypt() { DerivedKeyLength = 2, BlockSize = 4, Parallelization = 2, MemoryCost = -1, }; Assert.Throws <ArgumentException>(() => standardScryptHash.GetProperties()); }
public void StandardScryptHash() { UserImportHash hash = new StandardScrypt() { DerivedKeyLength = 8, BlockSize = 4, Parallelization = 2, MemoryCost = 13, }; var props = hash.GetProperties(); var expectedResult = new Dictionary <string, object> { { "hashAlgorithm", "STANDARD_SCRYPT" }, { "dkLen", 8 }, { "blockSize", 4 }, { "parallization", 2 }, { "memoryCost", 13 }, }; Assert.Equal(expectedResult, hash.GetProperties()); }