convert MAC to interface
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user