Vana SDK - v2.2.2
    Preparing search index...

    Class BrowserECIESProvider

    Browser-specific ECIES provider using @noble/secp256k1

    This implementation uses:

    • Web Crypto API for AES operations
    • @noble/secp256k1 for elliptic curve operations
    • @noble/hashes for SHA and HMAC operations
    • No Buffer or Node.js dependencies

    Hierarchy

    • BaseECIESUint8
      • BrowserECIESProvider
    Index

    Methods

    • Encrypts data using ECIES.

      Parameters

      • publicKey: Uint8Array

        The recipient's public key (compressed or uncompressed)

      • message: Uint8Array

        The data to encrypt

      Returns Promise<ECIESEncrypted>

      Promise resolving to encrypted data structure

    • Decrypts ECIES encrypted data.

      Parameters

      • privateKey: Uint8Array

        The recipient's private key (32 bytes)

      • encrypted: ECIESEncrypted

        The encrypted data structure from encrypt()

      Returns Promise<Uint8Array<ArrayBufferLike>>

      Promise resolving to the original plaintext

    • Normalizes a public key to uncompressed format (65 bytes with 0x04 prefix). Handles compressed (33 bytes) and uncompressed (65 bytes) formats only.

      Parameters

      • publicKey: Uint8Array

        The public key to normalize (33 or 65 bytes)

      Returns Uint8Array

      The normalized uncompressed public key (65 bytes)

      Strict policy: Does not accept 64-byte raw coordinates to avoid masking malformed data. Callers must provide properly formatted keys.

      When public key format is invalid or decompression fails