@hpke/dhkem-x25519
    Preparing search index...

    Class HkdfSha256

    Hierarchy

    • HkdfSha256Native
      • HkdfSha256
    Index

    Constructors

    Properties

    _api: SubtleCrypto = undefined
    _suiteId: Uint8Array = EMPTY
    algHash: HmacKeyGenParams = ...

    The parameters for Web Cryptography API

    hashSize: number = 32

    32

    id: KdfId = KdfId.HkdfSha256

    KdfId.HkdfSha256 (0x0001)

    Methods

    • Builds a labeled input keying material.

      Parameters

      • label: Uint8Array

        A byte string indicating the cryptographic context/operation.

      • ikm: Uint8Array

      Returns Uint8Array

      An input keying material as bytes.

    • Builds a labeled info string.

      Parameters

      • label: Uint8Array

        A byte string indicating the cryptographic context/operation.

      • info: Uint8Array

        An additional byte string.

      • len: number

        The length of the output byte string.

      Returns Uint8Array

      An info string as bytes.

    • Expands a pseudorandom key prk.

      Parameters

      • prk: ArrayBuffer

        A pseudorandom key.

      • info: ArrayBuffer

        An additional byte string.

      • len: number

        The length in bytes of the output keying material.

      Returns Promise<ArrayBuffer>

      An output keying material as bytes.

    • Parameters

      • salt: ArrayBuffer
      • ikm: ArrayBuffer

      Returns Promise<ArrayBuffer>

    • Extracts a pseudorandom key and expand it to a specified length keying material.

      Parameters

      • salt: ArrayBuffer

        An additional random byte string.

      • ikm: ArrayBuffer

        An input keying material

      • info: ArrayBuffer

        An additional byte string.

      • len: number

        The length in bytes of the output keying material.

      Returns Promise<ArrayBuffer>

      An output keying material as bytes.

    • Initializes the instance by setting a suite_id defined in RFC9180.

      Parameters

      • suiteId: Uint8Array

        A suite_id defined in RFC9180.

      Returns void

    • Extracts a pseudorandom key with label.

      Parameters

      • prk: ArrayBuffer

        A pseudorandom key.

      • label: Uint8Array

        A byte string indicating the cryptographic context/operation.

      • info: Uint8Array

        An additional byte string.

      • len: number

        The length in bytes of the output keying material.

      Returns Promise<ArrayBuffer>

      An output keying material as bytes.

    • Extracts a pseudorandom key with label.

      Parameters

      • salt: ArrayBuffer

        An additional random byte string.

      • label: Uint8Array

        A byte string indicating the cryptographic context/operation.

      • ikm: Uint8Array

        An input keying material

      Returns Promise<ArrayBuffer>

      A pseudorandom key as bytes.