update dependencies
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package com.infendro.kdf
|
||||
|
||||
import com.infendro.bytearray.addAll
|
||||
import com.infendro.bytearray.toByteArray
|
||||
import com.infendro.bytearray.xor
|
||||
import com.infendro.hash.HashFunction
|
||||
import com.infendro.kdf.util.addAll
|
||||
import com.infendro.kdf.util.toByteArray
|
||||
import com.infendro.kdf.util.xor
|
||||
import com.infendro.mac.HMAC
|
||||
|
||||
class PBKDF2(
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.infendro.kdf.util
|
||||
|
||||
import kotlin.experimental.xor
|
||||
|
||||
internal infix fun ByteArray.xor(
|
||||
that: ByteArray,
|
||||
): ByteArray {
|
||||
if (this.size != that.size) throw Exception()
|
||||
|
||||
return ByteArray(size) { i ->
|
||||
this[i] xor that[i]
|
||||
}
|
||||
}
|
||||
|
||||
internal fun MutableCollection<Byte>.addAll(
|
||||
bytes: ByteArray,
|
||||
): Boolean {
|
||||
return addAll(bytes.toList())
|
||||
}
|
||||
|
||||
internal fun UInt.toByteArray(): ByteArray {
|
||||
return ByteArray(4) { i ->
|
||||
val offset = (3 - i) * 8
|
||||
(this shr offset).toByte()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user