hkdf.d.ts 1.2 KB

123456789101112131415161718192021222324252627
  1. import { CHash, Input } from './utils.js';
  2. /**
  3. * HKDF-Extract(IKM, salt) -> PRK
  4. * Arguments position differs from spec (IKM is first one, since it is not optional)
  5. * @param hash
  6. * @param ikm
  7. * @param salt
  8. * @returns
  9. */
  10. export declare function extract(hash: CHash, ikm: Input, salt?: Input): Uint8Array;
  11. /**
  12. * HKDF-expand from the spec.
  13. * @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step)
  14. * @param info - optional context and application specific information (can be a zero-length string)
  15. * @param length - length of output keying material in octets
  16. */
  17. export declare function expand(hash: CHash, prk: Input, info?: Input, length?: number): Uint8Array;
  18. /**
  19. * HKDF (RFC 5869): extract + expand in one step.
  20. * @param hash - hash function that would be used (e.g. sha256)
  21. * @param ikm - input keying material, the initial key
  22. * @param salt - optional salt value (a non-secret random value)
  23. * @param info - optional context and application specific information
  24. * @param length - length of output keying material in octets
  25. */
  26. export declare const hkdf: (hash: CHash, ikm: Input, salt: Input | undefined, info: Input | undefined, length: number) => Uint8Array;
  27. //# sourceMappingURL=hkdf.d.ts.map