convert MAC to interface

This commit is contained in:
2025-12-12 14:15:16 +01:00
parent fec960065d
commit 6f4d1c38a3
2 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import com.infendro.hash.HashFunction
class HMAC( class HMAC(
val function: HashFunction, val function: HashFunction,
) : MAC() { ) : MAC {
override val bytes: Int override val bytes: Int
get() = function.bytes get() = function.bytes

View File

@@ -1,11 +1,11 @@
package com.infendro.mac package com.infendro.mac
abstract class MAC { interface MAC {
abstract val bytes: Int val bytes: Int
val bits: Int val bits: Int
get() = bytes * 8 get() = bytes * 8
abstract fun hash( fun hash(
key: UByteArray, key: UByteArray,
value: UByteArray, value: UByteArray,
): UByteArray ): UByteArray