Skip to content

Commit

Permalink
Merge pull request #12 from keemobile/refine/reduce-exposed-extensions
Browse files Browse the repository at this point in the history
Don't expose unnecessary extension methods
  • Loading branch information
Anvell authored Jan 21, 2024
2 parents 4513c78 + fa625a8 commit 40e45d0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import kotlin.experimental.xor
private const val Sha256 = "SHA-256"
private const val Sha512 = "SHA-512"

fun ByteArray.sha256(): ByteArray = MessageDigest
internal fun ByteArray.sha256(): ByteArray = MessageDigest
.getInstance(Sha256)
.digest(this)

fun ByteArray.sha512(): ByteArray = MessageDigest
internal fun ByteArray.sha512(): ByteArray = MessageDigest
.getInstance(Sha512)
.digest(this)

fun ByteArray.clear() {
internal fun ByteArray.clear() {
for (i in indices) this[i] = 0x0
}

fun ByteArray.constantTimeEquals(other: ByteArray): Boolean {
internal fun ByteArray.constantTimeEquals(other: ByteArray): Boolean {
if (this === other) {
return true
}
Expand Down

0 comments on commit 40e45d0

Please sign in to comment.