diff options
Diffstat (limited to 'wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt')
-rw-r--r-- | wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt b/wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt index 7ca2ba8..39a2014 100644 --- a/wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt +++ b/wallet/src/commonMain/kotlin/net/taler/lib/crypto/Crypto.kt @@ -36,13 +36,13 @@ internal interface Crypto { fun setupRefreshPlanchet(secretSeed: ByteArray, coinNumber: Int): FreshCoin } -interface HashSha512State { +internal interface HashSha512State { fun update(data: ByteArray): HashSha512State fun final(): ByteArray } -class EddsaKeyPair(val privateKey: ByteArray, val publicKey: ByteArray) -class EcdheKeyPair(val privateKey: ByteArray, val publicKey: ByteArray) -data class FreshCoin(val coinPublicKey: ByteArray, val coinPrivateKey: ByteArray, val bks: ByteArray) { +internal class EddsaKeyPair(val privateKey: ByteArray, val publicKey: ByteArray) +internal class EcdheKeyPair(val privateKey: ByteArray, val publicKey: ByteArray) +internal data class FreshCoin(val coinPublicKey: ByteArray, val coinPrivateKey: ByteArray, val bks: ByteArray) { override fun equals(other: Any?): Boolean { if (this === other) return true if (other == null || this::class != other::class) return false @@ -67,12 +67,12 @@ internal expect object CryptoFactory { private val hexArray = arrayOf('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f') -fun ByteArray.toHexString(): String { +public fun ByteArray.toHexString(): String { val hexChars = CharArray(this.size * 2) for (j in this.indices) { val v = (this[j].toInt() and 0xFF) hexChars[j * 2] = hexArray[v ushr 4] hexChars[j * 2 + 1] = hexArray[v and 0x0F] } - return String(hexChars) + return hexChars.concatToString() } |