Recovers the signer of a raw secp256k1 signature and compares it with the registered key.
key_data must be a 65-byte uncompressed SEC1 point (0x04 || X || Y)
and sig_data must be r[32] || s[32] || recovery_id[1], with a raw
recovery ID of 0 or 1. The Soroban host requires a normalized low-S
signature. The supplied 32-byte hash is passed directly to the Soroban
host without another hashing step.
The hazmat API is necessary here because the generic verifier boundary
represents the already-SHA-256-hashed Latch auth digest as Bytes. The
SDK has no supported conversion from those raw bytes back to Hash<32>;
hashing again to obtain that type would verify a different message.
Secp256k1VerifierError::InvalidHashLength] - hash is not 32
bytes.Secp256k1VerifierError::InvalidKeyEncoding] - key_data does not
start with the uncompressed SEC1 prefix 0x04.Secp256k1VerifierError::InvalidRecoveryId] - the signature recovery
ID is not 0 or 1; Ethereum-style 27/28 vafn verify(
env: soroban_sdk::Env,
hash: soroban_sdk::Bytes,
key_data: soroban_sdk::BytesN<65>,
sig_data: soroban_sdk::BytesN<65>,
) -> bool
Returns the canonical 65-byte uncompressed SEC1 public key unchanged.
Secp256k1VerifierError::InvalidKeyEncoding] - key_data does not
start with the uncompressed SEC1 prefix 0x04.fn canonicalize_key(
env: soroban_sdk::Env,
key_data: soroban_sdk::BytesN<65>,
) -> soroban_sdk::Bytes
Canonicalizes every secp256k1 key while preserving input order.
Secp256k1VerifierError::InvalidKeyEncoding] - any key does not
start with the uncompressed SEC1 prefix 0x04.fn batch_canonicalize_key(
env: soroban_sdk::Env,
key_data: soroban_sdk::Vec>,
) -> soroban_sdk::Vec