mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-12-06 00:32:32 -08:00
fix: KDF selection #2640
This commit is contained in:
2 files changed
+27
No files matched your search
@@ -83,6 +83,23 @@ class KdfSerializationTest {
|
||||
assertEquals(2L, deserialized.getParallelism())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testKdfEngineEquality() {
|
||||
val aes1 = AesKdf()
|
||||
aes1.setKeyRounds(100u)
|
||||
val aes2 = AesKdf()
|
||||
aes2.setKeyRounds(200u)
|
||||
|
||||
assertEquals(aes1, aes2)
|
||||
assertEquals(aes1.hashCode(), aes2.hashCode())
|
||||
|
||||
val argonD = Argon2Kdf(Argon2Kdf.Type.ARGON2_D)
|
||||
val argonId = Argon2Kdf(Argon2Kdf.Type.ARGON2_ID)
|
||||
|
||||
org.junit.Assert.assertNotEquals(argonD, argonId)
|
||||
org.junit.Assert.assertNotEquals(aes1, argonD)
|
||||
}
|
||||
|
||||
private fun serialize(obj: Any): ByteArray {
|
||||
val bos = ByteArrayOutputStream()
|
||||
val oos = ObjectOutputStream(bos)
|
||||
|
||||
Reference in new issue
Block a user