sha3.d.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import { Hash, Input, HashXOF } from './utils.js';
  2. export declare function keccakP(s: Uint32Array, rounds?: number): void;
  3. export declare class Keccak extends Hash<Keccak> implements HashXOF<Keccak> {
  4. blockLen: number;
  5. suffix: number;
  6. outputLen: number;
  7. protected enableXOF: boolean;
  8. protected rounds: number;
  9. protected state: Uint8Array;
  10. protected pos: number;
  11. protected posOut: number;
  12. protected finished: boolean;
  13. protected state32: Uint32Array;
  14. protected destroyed: boolean;
  15. constructor(blockLen: number, suffix: number, outputLen: number, enableXOF?: boolean, rounds?: number);
  16. protected keccak(): void;
  17. update(data: Input): this;
  18. protected finish(): void;
  19. protected writeInto(out: Uint8Array): Uint8Array;
  20. xofInto(out: Uint8Array): Uint8Array;
  21. xof(bytes: number): Uint8Array;
  22. digestInto(out: Uint8Array): Uint8Array;
  23. digest(): Uint8Array;
  24. destroy(): void;
  25. _cloneInto(to?: Keccak): Keccak;
  26. }
  27. export declare const sha3_224: {
  28. (msg: Input): Uint8Array;
  29. outputLen: number;
  30. blockLen: number;
  31. create(): Hash<Keccak>;
  32. };
  33. /**
  34. * SHA3-256 hash function
  35. * @param message - that would be hashed
  36. */
  37. export declare const sha3_256: {
  38. (msg: Input): Uint8Array;
  39. outputLen: number;
  40. blockLen: number;
  41. create(): Hash<Keccak>;
  42. };
  43. export declare const sha3_384: {
  44. (msg: Input): Uint8Array;
  45. outputLen: number;
  46. blockLen: number;
  47. create(): Hash<Keccak>;
  48. };
  49. export declare const sha3_512: {
  50. (msg: Input): Uint8Array;
  51. outputLen: number;
  52. blockLen: number;
  53. create(): Hash<Keccak>;
  54. };
  55. export declare const keccak_224: {
  56. (msg: Input): Uint8Array;
  57. outputLen: number;
  58. blockLen: number;
  59. create(): Hash<Keccak>;
  60. };
  61. /**
  62. * keccak-256 hash function. Different from SHA3-256.
  63. * @param message - that would be hashed
  64. */
  65. export declare const keccak_256: {
  66. (msg: Input): Uint8Array;
  67. outputLen: number;
  68. blockLen: number;
  69. create(): Hash<Keccak>;
  70. };
  71. export declare const keccak_384: {
  72. (msg: Input): Uint8Array;
  73. outputLen: number;
  74. blockLen: number;
  75. create(): Hash<Keccak>;
  76. };
  77. export declare const keccak_512: {
  78. (msg: Input): Uint8Array;
  79. outputLen: number;
  80. blockLen: number;
  81. create(): Hash<Keccak>;
  82. };
  83. export type ShakeOpts = {
  84. dkLen?: number;
  85. };
  86. export declare const shake128: {
  87. (msg: Input, opts?: ShakeOpts | undefined): Uint8Array;
  88. outputLen: number;
  89. blockLen: number;
  90. create(opts: ShakeOpts): HashXOF<HashXOF<Keccak>>;
  91. };
  92. export declare const shake256: {
  93. (msg: Input, opts?: ShakeOpts | undefined): Uint8Array;
  94. outputLen: number;
  95. blockLen: number;
  96. create(opts: ShakeOpts): HashXOF<HashXOF<Keccak>>;
  97. };
  98. //# sourceMappingURL=sha3.d.ts.map