feat: expose verifySchnorrFast in Secp256k1InstanceOurs + Android benchmark
Wire verifySchnorrFast (x-check only, no y-parity inversion) into: - Secp256k1InstanceOurs wrapper for app-level usage - Android benchmark as verifySchnorrFastOurs for Pixel 8 measurement Expected: ~15% faster than verifySchnorrOurs (~100μs vs ~120μs on Pixel 8) https://claude.ai/code/session_01EMY5RnXb9rnsyU2KbXrSaY
This commit is contained in:
+7
@@ -123,6 +123,13 @@ class Secp256k1Benchmark {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun verifySchnorrFastOurs() {
|
||||||
|
benchmarkRule.measureRepeated {
|
||||||
|
assertTrue(Secp256k1InstanceOurs.verifySchnorrFast(signature, msg32, xOnlyPub))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun signSchnorrOurs() {
|
fun signSchnorrOurs() {
|
||||||
benchmarkRule.measureRepeated {
|
benchmarkRule.measureRepeated {
|
||||||
|
|||||||
@@ -62,6 +62,16 @@ object Secp256k1InstanceOurs {
|
|||||||
pubKey: ByteArray,
|
pubKey: ByteArray,
|
||||||
): Boolean = Secp256k1.verifySchnorr(signature, hash, pubKey)
|
): Boolean = Secp256k1.verifySchnorr(signature, hash, pubKey)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fast Nostr verify — skips BIP-340 y-parity inversion (~15% faster).
|
||||||
|
* Safe for Nostr event verification. See Secp256k1.verifySchnorrFast KDoc.
|
||||||
|
*/
|
||||||
|
fun verifySchnorrFast(
|
||||||
|
signature: ByteArray,
|
||||||
|
hash: ByteArray,
|
||||||
|
pubKey: ByteArray,
|
||||||
|
): Boolean = Secp256k1.verifySchnorrFast(signature, hash, pubKey)
|
||||||
|
|
||||||
fun privateKeyAdd(
|
fun privateKeyAdd(
|
||||||
first: ByteArray,
|
first: ByteArray,
|
||||||
second: ByteArray,
|
second: ByteArray,
|
||||||
|
|||||||
Reference in New Issue
Block a user