This commit is contained in:
@@ -19,7 +19,7 @@ object `Blake-224` : HashFunction {
|
||||
0x64f98fa7U, 0xbefa4fa4U,
|
||||
).asIntArray()
|
||||
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray) {
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
|
||||
val length = value.size.toULong() * 8UL
|
||||
val input = pad(value)
|
||||
val h = initial.copyOf()
|
||||
@@ -31,7 +31,7 @@ object `Blake-224` : HashFunction {
|
||||
t += minOf(length - t, 512UL).toUInt()
|
||||
`Blake-256`.compress(h, input, i, m, v, t)
|
||||
}
|
||||
h.copyInto(destination, endIndex = 7)
|
||||
h.copyInto(destination, destinationOffset, endIndex = 7)
|
||||
}
|
||||
|
||||
private fun pad(value: ByteArray): ByteArray {
|
||||
|
||||
@@ -44,7 +44,7 @@ object `Blake-256` : HashFunction {
|
||||
intArrayOf(10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0),
|
||||
)
|
||||
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray) {
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
|
||||
val length = value.size.toULong() * 8UL
|
||||
val input = pad(value)
|
||||
val h = initial.copyOf()
|
||||
@@ -56,7 +56,7 @@ object `Blake-256` : HashFunction {
|
||||
t += minOf(length - t, 512UL).toUInt()
|
||||
compress(h, input, i, m, v, t)
|
||||
}
|
||||
h.copyInto(destination)
|
||||
h.copyInto(destination, destinationOffset)
|
||||
}
|
||||
|
||||
private fun pad(value: ByteArray): ByteArray {
|
||||
|
||||
@@ -19,7 +19,7 @@ object `Blake-384` : HashFunction {
|
||||
0xdb0c2e0d64f98fa7U, 0x47b5481dbefa4fa4U,
|
||||
).asLongArray()
|
||||
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray) {
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
|
||||
val length = value.size.toULong() * 8UL
|
||||
val input = pad(value)
|
||||
val h = initial.copyOf()
|
||||
@@ -31,7 +31,7 @@ object `Blake-384` : HashFunction {
|
||||
t += minOf(length - t, 1024UL)
|
||||
`Blake-512`.compress(h, input, i, m, v, t)
|
||||
}
|
||||
h.copyInto(destination, endIndex = 6)
|
||||
h.copyInto(destination, destinationOffset, endIndex = 6)
|
||||
}
|
||||
|
||||
private fun pad(value: ByteArray): ByteArray {
|
||||
|
||||
@@ -44,7 +44,7 @@ object `Blake-512` : HashFunction {
|
||||
intArrayOf(10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0),
|
||||
)
|
||||
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray) {
|
||||
override fun hashInto(value: ByteArray, destination: ByteArray, destinationOffset: Int) {
|
||||
val length = value.size.toULong() * 8UL
|
||||
val input = pad(value)
|
||||
val h = initial.copyOf()
|
||||
@@ -56,7 +56,7 @@ object `Blake-512` : HashFunction {
|
||||
t += minOf(length - t, 1024UL)
|
||||
compress(h, input, i, m, v, t)
|
||||
}
|
||||
h.copyInto(destination)
|
||||
h.copyInto(destination, destinationOffset)
|
||||
}
|
||||
|
||||
private fun pad(value: ByteArray): ByteArray {
|
||||
|
||||
Reference in New Issue
Block a user