Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
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);
}