fixed kdfForSizeInBytes unneeded parameter
This commit is contained in:
parent
a77fdd79c1
commit
2d55af4e3b
@ -47,9 +47,9 @@ sealed class KDF {
|
||||
fun kdfForSize(numberOfKeys: Int,salt: UByteArray = Argon.randomSalt()): KDF =
|
||||
creteDefault(SymmetricKey.keyLength * numberOfKeys, this, salt)
|
||||
|
||||
fun kdfForSizeInBytes(sizeInBytes: Int, complexity: Complexity, domain: String): KDF {
|
||||
fun kdfForSizeInBytes(sizeInBytes: Int, domain: String): KDF {
|
||||
val salt = Hash.Blake2b.deriveSalt(domain, Argon.saltSize)
|
||||
return creteDefault(sizeInBytes, complexity, salt)
|
||||
return creteDefault(sizeInBytes, this, salt)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ class KDFTest {
|
||||
val domain = "kdf-size-in-bytes-test"
|
||||
val expectedSalt = Hash.Blake2b.deriveSalt(domain, KDF.Argon.saltSize)
|
||||
|
||||
val kdf = KDF.Complexity.Sensitive.kdfForSizeInBytes(size, KDF.Complexity.FixedLow, domain)
|
||||
val kdf = KDF.Complexity.FixedLow.kdfForSizeInBytes(size, domain)
|
||||
assertIs<KDF.Argon>(kdf)
|
||||
|
||||
assertEquals(KDF.Argon.create(KDF.Complexity.FixedLow, expectedSalt, size), kdf)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user