How to use futoin-hkdf - 6 common examples

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 expand(prk: Uint8Array, info: string, outputLen: number): Uint8Array {
    const prkBuffer = Buffer.from(prk)
    const okm = hkdf.expand(this.hashAlgorithm, this.hashLength, prkBuffer, outputLen, info)
    return new Uint8Array(okm)
  }
github kulapio / libra-core / lib / crypto / Hkdf.ts View on Github external
public expand(prk: Uint8Array, info: BuffString, outputLen: number): Uint8Array {
    const prkBuffer = Buffer.from(prk);
    const okm = this.hashAlgorithm.toLowerCase() === 'sha3-256'
        ? this.sha3_256Expand(prkBuffer, outputLen, info)
        : hkdf.expand(this.hashAlgorithm, this.hashLength, prkBuffer, outputLen, info)
    return new Uint8Array(okm);
  }
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);
  }
github kulapio / libra-core / lib / crypto / Hkdf.ts View on Github external
get hashLength(): number {
    return hkdf.hash_length(this.hashAlgorithm);
  }
}
github bandprotocol / libra-web / packages / libra-web-core-utils / crypto / Hkdf.ts View on Github external
get hashLength(): number {
    return hkdf.hash_length(this.hashAlgorithm)
  }
}

futoin-hkdf

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

Apache-2.0
Latest version published 9 months ago

Package Health Score

60 / 100
Full package analysis