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

    Class NodeECIESProvider

    Node.js-specific ECIES provider using native secp256k1

    This implementation:

    • Uses native secp256k1 for all EC operations (optimal performance)
    • Uses Node.js crypto for SHA-512, HMAC, and AES operations
    • Internally works with Uint8Array
    • Only uses Buffer at crypto API boundaries

    Hierarchy

    • BaseECIESUint8
      • NodeECIESProvider
    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