implement tests
Some checks failed
/ publish (push) Has been cancelled

also fix MD5
This commit is contained in:
2025-11-10 17:42:15 +01:00
parent 9b93fbd093
commit d033d895da
28 changed files with 469 additions and 30 deletions

View File

@@ -5,7 +5,6 @@ import com.infendro.bytearray.toUByteArray
import com.infendro.bytearray.toUIntArray
import com.infendro.hash.HashFunction
@Suppress("UNUSED")
object MD5 : HashFunction() {
override val bytes: Int
get() = 16
@@ -94,10 +93,11 @@ object MD5 : HashFunction() {
in 32..47 -> (3 * i + 5) % 16
else -> (7 * i) % 16
}
val temp = a
a = d
d = c
c = b
b += (f + a + k[i] + w[g]).rotateLeft(s[i])
b += (temp + f + k[i] + w[g]).rotateLeft(s[i])
}
a0 += a
@@ -113,4 +113,4 @@ object MD5 : HashFunction() {
*d0.toUByteArray(LITTLE_ENDIAN),
)
}
}
}