Removed digest from stateless has interface and pushed it down, as some hashes don't support keys or different hash lengths
This commit is contained in:
1 parent
03275dd44c
commit
9c9383d54f
12 files changed
+27
-20
No files matched your search
+1
-8
@@ -64,14 +64,7 @@ class Sha256Pure : Sha256 {
|
||||
)
|
||||
|
||||
|
||||
fun digest(inputString: String, key: String?, hashLength: Int): UByteArray {
|
||||
return digest(
|
||||
inputString.encodeToByteArray().toUByteArray(),
|
||||
key?.run { encodeToByteArray().toUByteArray()} ?: ubyteArrayOf(),
|
||||
hashLength)
|
||||
}
|
||||
|
||||
override fun digest(inputMessage: UByteArray, key: UByteArray, hashLength: Int): UByteArray {
|
||||
override fun digest(inputMessage: UByteArray): UByteArray {
|
||||
|
||||
var h = iv.copyOf()
|
||||
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ class Sha512Pure : Sha512 {
|
||||
)
|
||||
|
||||
|
||||
override fun digest(inputMessage: UByteArray, key: UByteArray, hashLength: Int): UByteArray {
|
||||
override fun digest(inputMessage: UByteArray): UByteArray {
|
||||
|
||||
var h = iv.copyOf()
|
||||
|
||||
|
||||
Reference in new issue
Block a user