How to use the futoin-hkdf.extract function in futoin-hkdf

To help you get started, we’ve selected a few futoin-hkdf examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bandprotocol / libra-web / packages / libra-web-core-utils / crypto / Hkdf.ts View on Github external
public extract(ikm: Uint8Array, salt: string): Uint8Array {
    const ikmBuffer = Buffer.from(ikm)
    const prk = hkdf.extract(this.hashAlgorithm, this.hashLength, ikmBuffer, salt)
    return new Uint8Array(prk)
  }
github kulapio / libra-core / lib / crypto / Hkdf.ts View on Github external
public extract(ikm: Uint8Array, salt: string): Uint8Array {
    const ikmBuffer = Buffer.from(ikm);
    const prk = this.hashAlgorithm.toLowerCase() === 'sha3-256'
        ? this.sha3_256Extract(ikmBuffer, salt)
        : hkdf.extract(this.hashAlgorithm, this.hashLength, ikmBuffer, salt)
    return new Uint8Array(prk);
  }

futoin-hkdf

RFC5869: HMAC-based Extract-and-Expand Key Derivation Function (HKDF)

Apache-2.0
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis