also fix MD5
This commit is contained in:
@@ -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),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user