Function rename for digest provider.
This commit is contained in:
@@ -28,13 +28,13 @@ actual class MacInstance actual constructor(
|
|||||||
algorithm: String,
|
algorithm: String,
|
||||||
key: ByteArray,
|
key: ByteArray,
|
||||||
) {
|
) {
|
||||||
private var nativeHmac = HMac(altDigestForAlgorithm(algorithm), key)
|
private var nativeHmac = HMac(digestForAlgorithm(algorithm), key)
|
||||||
|
|
||||||
actual fun init(
|
actual fun init(
|
||||||
key: ByteArray,
|
key: ByteArray,
|
||||||
algorithm: String,
|
algorithm: String,
|
||||||
) {
|
) {
|
||||||
nativeHmac = HMac(altDigestForAlgorithm(algorithm), key)
|
nativeHmac = HMac(digestForAlgorithm(algorithm), key)
|
||||||
}
|
}
|
||||||
|
|
||||||
actual fun getMacLength(): Int = nativeHmac.macSize
|
actual fun getMacLength(): Int = nativeHmac.macSize
|
||||||
@@ -56,7 +56,7 @@ actual class MacInstance actual constructor(
|
|||||||
nativeHmac.digest(output, offset)
|
nativeHmac.digest(output, offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun altDigestForAlgorithm(algorithm: String) =
|
private fun digestForAlgorithm(algorithm: String) =
|
||||||
when (algorithm) {
|
when (algorithm) {
|
||||||
"HmacSHA256" -> Sha256()
|
"HmacSHA256" -> Sha256()
|
||||||
"HmacSHA512" -> Sha512()
|
"HmacSHA512" -> Sha512()
|
||||||
|
|||||||
Reference in New Issue
Block a user