From 022e86493b52c8c8dfe414940acc3a04cdfa3382 Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Tue, 17 Apr 2018 14:36:53 +0700 Subject: BCrypt: Add method for explicitly including trailing zero on password --- crypto/test/src/crypto/test/BCryptTest.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crypto/test') diff --git a/crypto/test/src/crypto/test/BCryptTest.cs b/crypto/test/src/crypto/test/BCryptTest.cs index 2d9771d17..42d925f80 100644 --- a/crypto/test/src/crypto/test/BCryptTest.cs +++ b/crypto/test/src/crypto/test/BCryptTest.cs @@ -134,6 +134,8 @@ namespace Org.BouncyCastle.Crypto.Tests DoTest(password, salt, cost, expected); } + IsTrue(AreEqual(BCrypt.Generate(BCrypt.PasswordToByteArray("12341234".ToCharArray()), Hex.Decode("01020304050607080102030405060708"), 5), Hex.Decode("cdd19088721c50e5cb49a7b743d93b5a6e67bef0f700cd78"))); + IsTrue(AreEqual(BCrypt.Generate(BCrypt.PasswordToByteArray("1234".ToCharArray()), Hex.Decode("01020304050607080102030405060708"), 5), Hex.Decode("02a3269aca2732484057b40c614204814cbfc2becd8e093e"))); } private void DoTest(byte[] password, byte[] salt, int cost, byte[] expected) -- cgit 1.5.1