upgrade
This commit is contained in:
@@ -5,8 +5,20 @@ interface KDF {
|
||||
val bits: Int
|
||||
get() = bytes * 8
|
||||
|
||||
fun hash(
|
||||
value: UByteArray,
|
||||
salt: UByteArray,
|
||||
): UByteArray
|
||||
fun hashInto(value: ByteArray, salt: ByteArray, destination: ByteArray, destinationOffset: Int = 0)
|
||||
|
||||
fun hashInto(value: ByteArray, salt: ByteArray, destination: UByteArray, destinationOffset: Int = 0) =
|
||||
hashInto(value, salt, destination.asByteArray(), destinationOffset)
|
||||
|
||||
fun hashInto(value: UByteArray, salt: UByteArray, destination: ByteArray, destinationOffset: Int = 0) =
|
||||
hashInto(value.asByteArray(), salt.asByteArray(), destination, destinationOffset)
|
||||
|
||||
fun hashInto(value: UByteArray, salt: UByteArray, destination: UByteArray, destinationOffset: Int = 0) =
|
||||
hashInto(value.asByteArray(), salt.asByteArray(), destination.asByteArray(), destinationOffset)
|
||||
|
||||
fun hash(value: ByteArray, salt: ByteArray): ByteArray =
|
||||
ByteArray(bytes).also { hashInto(value, salt, it) }
|
||||
|
||||
fun hash(value: UByteArray, salt: UByteArray): UByteArray =
|
||||
UByteArray(bytes).also { hashInto(value, salt, it) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user