argon2.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132
  1. import { type KDFInput } from './utils.ts';
  2. /**
  3. * Argon2 options.
  4. * * t: time cost, m: mem cost in kb, p: parallelization.
  5. * * key: optional key. personalization: arbitrary extra data.
  6. * * dkLen: desired number of output bytes.
  7. */
  8. export type ArgonOpts = {
  9. t: number;
  10. m: number;
  11. p: number;
  12. version?: number;
  13. key?: KDFInput;
  14. personalization?: KDFInput;
  15. dkLen?: number;
  16. asyncTick?: number;
  17. maxmem?: number;
  18. onProgress?: (progress: number) => void;
  19. };
  20. /** argon2d GPU-resistant version. */
  21. export declare const argon2d: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array;
  22. /** argon2i side-channel-resistant version. */
  23. export declare const argon2i: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array;
  24. /** argon2id, combining i+d, the most popular version from RFC 9106 */
  25. export declare const argon2id: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Uint8Array;
  26. /** argon2d async GPU-resistant version. */
  27. export declare const argon2dAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise<Uint8Array>;
  28. /** argon2i async side-channel-resistant version. */
  29. export declare const argon2iAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise<Uint8Array>;
  30. /** argon2id async, combining i+d, the most popular version from RFC 9106 */
  31. export declare const argon2idAsync: (password: KDFInput, salt: KDFInput, opts: ArgonOpts) => Promise<Uint8Array>;
  32. //# sourceMappingURL=argon2.d.ts.map