edgeport - v1.0.3
    Preparing search index...

    Function deriveShared

    • Derives the 32-byte X25519 shared secret from our private key and the peer's raw public key. Rejects (per RFC 8731) if the result is all zero, which signals a small-order point attack.

      Parameters

      • privateKey: CryptoKey

        Our ephemeral private key.

      • peerPublicKey: Uint8Array

        The peer's 32-byte raw public key.

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The 32-byte shared secret K.

      If the derived secret is all zero.

      1.0.0