sha3.d.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import { Hash, type CHash, type CHashXO, type HashXOF, type Input } from './utils.ts';
  2. /** `keccakf1600` internal function, additionally allows to adjust round count. */
  3. export declare function keccakP(s: Uint32Array, rounds?: number): void;
  4. /** Keccak sponge function. */
  5. export declare class Keccak extends Hash<Keccak> implements HashXOF<Keccak> {
  6. protected state: Uint8Array;
  7. protected pos: number;
  8. protected posOut: number;
  9. protected finished: boolean;
  10. protected state32: Uint32Array;
  11. protected destroyed: boolean;
  12. blockLen: number;
  13. suffix: number;
  14. outputLen: number;
  15. protected enableXOF: boolean;
  16. protected rounds: number;
  17. constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number);
  18. clone(): Keccak;
  19. protected keccak(): void;
  20. update(data: Input): this;
  21. protected finish(): void;
  22. protected writeInto(out: Uint8Array): Uint8Array;
  23. xofInto(out: Uint8Array): Uint8Array;
  24. xof(bytes: number): Uint8Array;
  25. digestInto(out: Uint8Array): Uint8Array;
  26. digest(): Uint8Array;
  27. destroy(): void;
  28. _cloneInto(to?: Keccak): Keccak;
  29. }
  30. /** SHA3-224 hash function. */
  31. export declare const sha3_224: CHash;
  32. /** SHA3-256 hash function. Different from keccak-256. */
  33. export declare const sha3_256: CHash;
  34. /** SHA3-384 hash function. */
  35. export declare const sha3_384: CHash;
  36. /** SHA3-512 hash function. */
  37. export declare const sha3_512: CHash;
  38. /** keccak-224 hash function. */
  39. export declare const keccak_224: CHash;
  40. /** keccak-256 hash function. Different from SHA3-256. */
  41. export declare const keccak_256: CHash;
  42. /** keccak-384 hash function. */
  43. export declare const keccak_384: CHash;
  44. /** keccak-512 hash function. */
  45. export declare const keccak_512: CHash;
  46. export type ShakeOpts = {
  47. dkLen?: number;
  48. };
  49. /** SHAKE128 XOF with 128-bit security. */
  50. export declare const shake128: CHashXO;
  51. /** SHAKE256 XOF with 256-bit security. */
  52. export declare const shake256: CHashXO;
  53. //# sourceMappingURL=sha3.d.ts.map