16 lines
378 B
Kotlin
16 lines
378 B
Kotlin
package com.infendro.kdf
|
|
|
|
interface KDF {
|
|
val bytes: Int
|
|
val bits: Int
|
|
get() = bytes * 8
|
|
|
|
fun hashInto(value: ByteArray, salt: ByteArray, destination: ByteArray, destinationOffset: Int = 0)
|
|
|
|
fun hash(value: ByteArray, salt: ByteArray): ByteArray {
|
|
val result = ByteArray(bytes)
|
|
hashInto(value, salt, result)
|
|
return result
|
|
}
|
|
}
|