Test method for 'BCrypt.gensalt(int)'
()
| 111 | * Test method for 'BCrypt.gensalt(int)' |
| 112 | */ |
| 113 | public void testGensaltInt() { |
| 114 | System.out.print("BCrypt.gensalt(log_rounds):"); |
| 115 | for (int i = 4; i <= 12; i++) { |
| 116 | System.out.print(" " + Integer.toString(i) + ":"); |
| 117 | for (int j = 0; j < test_vectors.length; j += 4) { |
| 118 | String plain = test_vectors[j][0]; |
| 119 | String salt = BCrypt.gensalt(i); |
| 120 | String hashed1 = BCrypt.hashpw(plain, salt); |
| 121 | String hashed2 = BCrypt.hashpw(plain, hashed1); |
| 122 | assertEquals(hashed1, hashed2); |
| 123 | System.out.print("."); |
| 124 | } |
| 125 | } |
| 126 | System.out.println(""); |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Test method for 'BCrypt.gensalt()' |