This commit is contained in:
Vitor Pamplona
2024-05-28 11:49:20 -04:00
6 changed files with 98 additions and 1 deletions
@@ -64,10 +64,19 @@ object CryptoUtils {
return secp256k1.secKeyVerify(il)
}
fun signString(
message: String,
privKey: ByteArray,
auxrand32: ByteArray = random(32),
): ByteArray {
return sign(sha256(message.toByteArray()), privKey, auxrand32)
}
fun sign(
data: ByteArray,
privKey: ByteArray,
): ByteArray = secp256k1.signSchnorr(data, privKey, null)
auxrand32: ByteArray? = null,
): ByteArray = secp256k1.signSchnorr(data, privKey, auxrand32)
fun verifySignature(
signature: ByteArray,