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