blake3.d.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { BLAKE } from './_blake.js';
  2. import { Input, HashXOF } from './utils.js';
  3. export type Blake3Opts = {
  4. dkLen?: number;
  5. key?: Input;
  6. context?: Input;
  7. };
  8. declare class BLAKE3 extends BLAKE<BLAKE3> implements HashXOF<BLAKE3> {
  9. private IV;
  10. private flags;
  11. private state;
  12. private chunkPos;
  13. private chunksDone;
  14. private stack;
  15. private posOut;
  16. private bufferOut32;
  17. private bufferOut;
  18. private chunkOut;
  19. private enableXOF;
  20. constructor(opts?: Blake3Opts, flags?: number);
  21. protected get(): never[];
  22. protected set(): void;
  23. private b2Compress;
  24. protected compress(buf: Uint32Array, bufPos?: number, isLast?: boolean): void;
  25. _cloneInto(to?: BLAKE3): BLAKE3;
  26. destroy(): void;
  27. private b2CompressOut;
  28. protected finish(): void;
  29. private writeInto;
  30. xofInto(out: Uint8Array): Uint8Array;
  31. xof(bytes: number): Uint8Array;
  32. digestInto(out: Uint8Array): Uint8Array;
  33. digest(): Uint8Array;
  34. }
  35. /**
  36. * BLAKE3 hash function.
  37. * @param msg - message that would be hashed
  38. * @param opts - dkLen, key, context
  39. */
  40. export declare const blake3: {
  41. (msg: Input, opts?: Blake3Opts | undefined): Uint8Array;
  42. outputLen: number;
  43. blockLen: number;
  44. create(opts: Blake3Opts): HashXOF<BLAKE3>;
  45. };
  46. export {};
  47. //# sourceMappingURL=blake3.d.ts.map