Contract d608b7ad39a7225f1747697f35c39891d5ac1252ae91e1233b06a84fa32ab01d

← Back to Index 📥 Download WASM

Meta

cliver 28.0.0#300aaf69ab100536678bdb641428b06f06b318ea
rssdk_spec_shaking 2
rssdkver 26.1.1#8ac18efb681a1c0b4b85a38c5a380300344e3f39
rsver 1.94.1

Instances

  • CA2ZL2FBY3LKYFQLBSHVDY34WOR62473VMK6QDXGQWJKL7YLFV7RISVH

Interface

Verifies a raw P-256 signature over a Soroban authorization payload hash.

key_data must be a 65-byte uncompressed SEC1 point (0x04 || X || Y), and sig_data must be a low-S 64-byte compact signature (r || s). The supplied 32-byte hash is passed directly to the Soroban host without another hashing step.

Errors

  • [P256VerifierError::InvalidHashLength] - hash is not 32 bytes.
  • [P256VerifierError::InvalidKeyEncoding] - key_data does not start with the uncompressed SEC1 prefix 0x04.
  • Native Error(Crypto, InvalidInput) - the point, signature components, signature, key, or digest is cryptographically invalid.
fn verify(
    env: soroban_sdk::Env,
    hash: soroban_sdk::Bytes,
    key_data: soroban_sdk::BytesN<65>,
    sig_data: soroban_sdk::BytesN<64>,
) -> bool

Returns the canonical 65-byte uncompressed SEC1 public key unchanged.

Errors

  • [P256VerifierError::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 P-256 key while preserving input order.

Errors

  • [P256VerifierError::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

Imports

WebAssembly Text (WAT) ▶