more sugar to be like unicrypto by functions
This commit is contained in:
1 parent
a6c7dafb70
commit
78383fbece
6 files changed
+53
-3
No files matched your search
@@ -3,6 +3,7 @@ import net.sergeych.crypto2.PBKD
|
||||
import net.sergeych.crypto2.initCrypto
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertEquals
|
||||
import kotlin.test.assertNotNull
|
||||
|
||||
class PBKDTest {
|
||||
|
||||
@@ -32,5 +33,17 @@ class PBKDTest {
|
||||
assertEquals(i.kdp, kx.id.kdp)
|
||||
|
||||
}
|
||||
val (y1,y2,y3) = k1.id.kdp!!.kdf.deriveMultiple("foobar", 3)
|
||||
for( (a,b) in listOf(y1,y2,y3).zip(listOf(k1,k2,k3))) {
|
||||
assertEquals(a,b)
|
||||
assertNotNull(a.id.kdp)
|
||||
assertNotNull(b.id.kdp)
|
||||
assertEquals(a.id.kdp, b.id.kdp)
|
||||
assertEquals(a.id, b.id)
|
||||
}
|
||||
assertEquals(k1, y1)
|
||||
assertEquals(k2, y2)
|
||||
assertEquals(k3, y3)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user