convert MAC to interface

This commit is contained in:
Infendro committed 2025-12-12 14:15:16 +01:00
1 parent fec960065d
commit 6f4d1c38a3
2 files changed
+4 -4

No files matched your search

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