Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ public object Sha256 {
0x510e527f, -0x64fa9774, 0x1f83d9ab, 0x5be0cd19
)

// Working arrays
private val W = IntArray(64)
private val H = IntArray(8)
private val TEMP = IntArray(8)

/**
* Hashes the given message with SHA-256 and returns the digest.
*
* @param message The bytes to digest.
* @return The digest's bytes.
*/
public fun digest(message: ByteArray): ByteArray {
// Working arrays
val W = IntArray(64)
val H = IntArray(8)
val TEMP = IntArray(8)

// Let H = H0
H0.copy(0,
H, 0, H0.size)
Expand Down